> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.qonversion.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Set main offering

> Atomically marks the offering as the project's main offering
(`tag = 1`) and clears the previous main (`tag = 0`), inside a single
transaction. No request body required — the action target is fully
identified by the path parameter. Pass an `Idempotency-Key` header to
make retries safe (the same key replays the original response).
Experiment-variant offerings return `422` (typed code
`cannot_setmain_experiment_variant`).




## OpenAPI

````yaml /api-reference/rest-api-v4.yaml post /offerings/{offering_id}/set-main
openapi: 3.0.3
info:
  title: Qonversion REST API v4
  version: '4.0'
  description: >-
    Qonversion REST API v4 follows REST standards. It has predictable
    resource-oriented URLs, accepts JSON-encoded request bodies, returns
    JSON-encoded responses, and uses standard HTTP response codes,
    authentication, and verbs.
servers:
  - url: https://api.qonversion.io/v4
    description: Production
security:
  - secretAuth: []
tags:
  - name: Users
    description: Retrieve Qonversion users
  - name: User Properties
    description: Manage user-level attributes
  - name: Identities
    description: Link Qonversion users to your own auth IDs
  - name: Entitlements
    description: Entitlement definitions and user grants
  - name: Purchases
    description: A user's purchase history
  - name: Products
    description: Products configured in the Qonversion dashboard
  - name: Customers
    description: Aggregated customer records, properties, permissions, and metrics
  - name: Segments
    description: Dynamic and system segments of users
  - name: Experiments
    description: Paywall and offering A/B experiments
  - name: Screens
    description: No-code paywall screens — CRUD, publish, analytics
  - name: Analytics
    description: Charts, cards, cohorts, LTV, and insights
  - name: Exports
    description: Asynchronous data exports
  - name: Events
    description: Event catalog
  - name: Scheduled Reports
    description: Recurring reports delivered to external destinations
  - name: Integrations
    description: Third-party integrations configuration
  - name: Automations
    description: Event-driven automations
  - name: Project Settings
    description: Project-level configuration, secret, and store credentials
paths:
  /offerings/{offering_id}/set-main:
    parameters:
      - name: offering_id
        in: path
        required: true
        schema:
          type: string
          maxLength: 64
          pattern: ^[a-zA-Z0-9._:\- ]+$
        example: premium_monthly
    post:
      tags:
        - Offerings
      summary: Set main offering
      description: |
        Atomically marks the offering as the project's main offering
        (`tag = 1`) and clears the previous main (`tag = 0`), inside a single
        transaction. No request body required — the action target is fully
        identified by the path parameter. Pass an `Idempotency-Key` header to
        make retries safe (the same key replays the original response).
        Experiment-variant offerings return `422` (typed code
        `cannot_setmain_experiment_variant`).
      operationId: v4SetMainOffering
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Offering marked as main.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V4Offering'
              example:
                object: offering
                id: winback
                url: /v4/offerings/winback
                tag: 1
                product_ids:
                  - premium_annual_2999
                created_at: '2025-10-02T09:15:00Z'
                updated_at: '2025-11-14T08:45:00Z'
        '400':
          description: Invalid offering id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V4Error'
        '401':
          description: Missing or invalid authentication token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V4Error'
        '404':
          description: Offering not found in this project.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V4Error'
        '409':
          description: Transactional conflict during set-main.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V4Error'
        '422':
          description: >-
            Operation cannot be performed in the current state. Typed code:
            `cannot_setmain_experiment_variant` — the offering is owned by the
            experiments service.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V4Error'
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V4Error'
      security:
        - secretAuth: []
components:
  schemas:
    V4Offering:
      type: object
      required:
        - object
        - id
        - url
        - tag
        - product_ids
        - created_at
        - updated_at
      properties:
        object:
          type: string
          enum:
            - offering
          readOnly: true
        id:
          type: string
          maxLength: 64
          pattern: ^[a-zA-Z0-9._:\- ]+$
          example: premium_monthly
        url:
          type: string
          example: /v4/offerings/premium_monthly
          readOnly: true
        tag:
          type: integer
          format: int16
          nullable: true
          description: |
            Offering role within the project. `1` = main offering (`TAG_MAIN`)
            — exactly one offering per project has tag=1 at any time; promote
            via `POST /v4/offerings/{offering_id}/set-main`. `0` = regular
            offering that was demoted from main. `null` = regular offering
            that has never been tagged. Treat `0` and `null` as equivalent on
            read. The Offerings endpoints filter out experiment-variant
            offerings, but legacy rows could carry historical values other
            than `0`, `1`, or `null`, so the response field is intentionally
            not enum-restricted. Write schemas restrict accepted values
            server-side.
        product_ids:
          type: array
          items:
            type: string
            maxLength: 255
            pattern: ^[a-zA-Z0-9._:\- ]+$
          description: Product UIDs that belong to this offering, in display order.
        created_at:
          type: string
          format: date-time
          example: '2025-09-15T12:30:00Z'
          readOnly: true
        updated_at:
          type: string
          format: date-time
          example: '2025-11-03T10:26:40Z'
          readOnly: true
    V4Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
          properties:
            type:
              type: string
              enum:
                - request
                - resource
                - logical
                - internal
            code:
              type: string
              description: |
                Machine-readable snake_case error code. Examples include
                `invalid_data`, `invalid_request`, `invalid_product_id`,
                `not_found`, `already_exists`, `offering_already_exists`,
                `product_not_in_project`, `cannot_set_main_directly`,
                `cannot_demote_main`, `cannot_patch_experiment_variant`,
                `cannot_delete_experiment_variant`, and
                `cannot_setmain_experiment_variant`. Resource-specific codes
                are documented on the corresponding reference page.
            message:
              type: string
              description: Human-readable description. May change; do not parse.
            details:
              type: array
              nullable: true
              description: Per-field validation errors, present on 400 validation failures.
              items:
                type: object
                properties:
                  field:
                    type: string
                  message:
                    type: string
  securitySchemes:
    secretAuth:
      type: http
      scheme: bearer
      bearerFormat: sk_…
      description: >-
        Bearer authentication using the project **Secret Key** (prefixed with
        `sk_`, or `test_sk_` for sandbox). All v4 public endpoints require the
        Secret Key — see [Authentication](/reference/v4/authentication). Never
        expose the Secret Key in client-side code.

````