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

# Create Rolling Offer

> Creates a rolling offer.

<RequestExample>
  ```bash Create Rolling Offer theme={"system"}
  curl -X POST \
    'https://api.appcharge.com/v2/offer' \
    -H 'Content-Type: application/json' \
    -H 'x-publisher-token: <x-publisher-token>' \
    -d '{
      "publisherOfferId": "rolling-offer-1",
      "name": "My Rolling Offer",
      "type": "RollingOffer",
      "active": true,
      "productsSequence": [
        {
          "index": 1,
          "products": [
            {
              "publisherProductId": "613",
              "name": "Sword",
              "textFontColorHex": "#f60404",
              "type": "Quantity",
              "prefix": "$",
              "suffix": "M",
              "priority": "Main",
              "images": [
                {
                  "type": "product",
                  "url": "https://media.appcharge.com/media/25cb7861ec8924a6b69a0f59/408472.png"
                },
                {
                  "type": "productPrefix",
                  "url": ""
                }
              ],
              "createdAt": "2024-03-01T10:14:34.142Z",
              "updatedAt": "2025-02-05T13:20:50.759Z",
              "displayName": "Sword",
              "productId": "25e1aa8a7ef37e0d94b16fdf"
            }
          ],
          "priceInUsdCents": 5000
        },
        {
          "index": 2,
          "products": [
            {
              "product": {
                "publisherProductId": "614",
                "name": "Boost",
                "textFontColorHex": "#bfc6e8",
                "type": "Quantity",
                "prefix": "+",
                "suffix": "🎉",
                "priority": "Sub",
                "images": [
                  {
                    "type": "product",
                    "url": "https://media.appcharge.com/media/25cb7861ec8924a6b69a0f59/1730204644395__99c7d8e4-4658-49db-ac4f-501ab93fee9a"
                  },
                  {
                    "type": "productPrefix",
                    "url": ""
                  }
                ],
                "displayName": "Boost",
                "createdAt": "2024-10-29T12:24:23.083Z",
                "updatedAt": "2025-01-16T09:38:15.446Z",
                "productId": "6720d3f7aaca102ce5fb0ce2"
              }
            }
          ],
          "priceInUsdCents": 3000
        }
      ],
      "priority": 1,
      "schedule": {
        "permanent": false,
        "timeFrames": [
          {
            "startTime": "2025-06-22T12:05:00.000Z",
            "endTime": "2025-06-22T12:10:00.000Z",
            "notes": "",
            "id": "68078610fb23b166fb160469"
          }
        ]
      },
      "productSale": {
        "type": "percentage",
        "sale": 100
      },
      "priceDiscount": {
        "type": "percentage",
        "discount": 20
      },
      "displayName": "My Rolling Offer",
      "description": "This is my rolling offer description.",
      "segments": [
        "New User"
      ],
      "publisherTabId": "tab-1"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json Create Rolling Offer theme={"system"}
  {
    "publisherId": "35nb7861ec9924a6b69a0fe59",
    "offerId": "726cff96123a8717",
    "publisherOfferId": "rolling-offer-1",
    "name": "My Rolling Offer",
    "type": "RollingOffer",
    "active": true,
    "active": true,
    "displayName": "My Rolling Offer",
    "description": "This is my rolling offer description.",
    "segments": [
        "New User"
    ],
    "publisherTabId": "tab-1",
    "offerUi": null,
    "productsSequence": [
        {
            "index": 1,
            "products": [
                {
                    "publisherProductId": "613",
                    "name": "Sword",
                    "textFontColorHex": "#f60404",
                    "type": "Quantity",
                    "prefix": "$",
                    "suffix": "M",
                    "priority": "Main",
                    "images": [
                        {
                            "type": "product",
                            "url": "https://media.appcharge.com/media/25cb7861ec8924a6b69a0f59/408472.png"
                        },
                        {
                            "type": "productPrefix",
                            "url": ""
                        }
                    ],
                    "createdAt": "2024-03-01T10:14:34.142Z",
                    "updatedAt": "2025-02-05T13:20:50.759Z",
                    "displayName": "Sword",
                    "productId": "25e1aa8a7ef37e0d94b16fdf"
                }
            ],
            "priceInUsdCents": 5000
        },
        {
            "index": 2,
            "products": [
                {
                    "product": {
                        "publisherProductId": "614",
                        "name": "Boost",
                        "textFontColorHex": "#bfc6e8",
                        "type": "Quantity",
                        "prefix": "+",
                        "suffix": "🎉",
                        "priority": "Sub",
                        "images": [
                            {
                                "type": "product",
                                "url": "https://media.appcharge.com/media/25cb7861ec8924a6b69a0f59/1730204644395__99c7d8e4-4658-49db-ac4f-501ab93fee9a"
                            },
                            {
                                "type": "productPrefix",
                                "url": ""
                            }
                        ],
                        "displayName": "Boost",
                        "createdAt": "2024-10-29T12:24:23.083Z",
                        "updatedAt": "2025-01-16T09:38:15.446Z",
                        "productId": "6720d3f7aaca102ce5fb0ce2"
                    }
                }
            ],
            "priceInUsdCents": 3000
        }
    ],
    "priority": 1,
    "schedule": {
        "permanent": false,
        "timeFrames": [
            {
                "startTime": "2025-06-22T12:05:00.000Z",
                "endTime": "2025-06-22T12:10:00.000Z",
                "notes": "",
                "id": "68078610fb23b166fb160469"
            }
        ]
    },
    "productSale": {
        "type": "percentage",
        "sale": 100
    },
    "priceDiscount": {
        "type": "percentage",
        "discount": 20
    },
    "createdAt": "2025-04-06T10:00:44.528Z",
    "updatedAt": "2025-04-06T10:00:44.528Z"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml openapi-rolling-offer.json POST /v2/offer
openapi: 3.0.1
info:
  title: Rolling Offer API
  description: API for managing Rolling Offers.
  version: '1.0'
servers:
  - url: https://api-sandbox.appcharge.com
security: []
paths:
  /v2/offer:
    post:
      tags:
        - Rolling Offers
      summary: Create a new rolling offer
      description: Creates a rolling offer.
      operationId: createRollingOffer
      parameters:
        - name: x-publisher-token
          in: header
          required: true
          description: The publisher token used for authentication.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRollingOfferDto'
      responses:
        '201':
          description: Rolling offer created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RollingOfferDtoResponse'
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  requestUrl:
                    type: string
                  body:
                    type: string
        '401':
          description: Unauthorized.
components:
  schemas:
    CreateRollingOfferDto:
      type: object
      required:
        - publisherOfferId
        - name
        - type
        - active
        - segments
        - productsSequence
        - priority
      properties:
        publisherOfferId:
          type: string
          description: >-
            The rolling offer ID provided by the publisher. This is the offer's
            **External ID** value in the Publisher Dashboard.
        name:
          type: string
          description: The name of the rolling offer (at least 3 characters).
        type:
          type: string
          description: The type of offer - In this case 'RollingOffer'.
          enum:
            - RollingOffer
        active:
          type: boolean
          description: Whether the rolling offer is active.
        offerUiId:
          type: string
          description: >-
            Internal ID of the Offer UI. Required if offerExternalUiId is not
            provided.
        offerExternalUiId:
          type: string
          description: The offer UI ID as configured in the Publisher Dashboard.
        priority:
          type: integer
          description: >-
            The priority level of the rolling offer. The priority starts from 1,
            where 1 is the highest priority. **Important:** Only the rolling
            offer with the highest priority will be returned. Rolling offers
            with the same or no priority will be sorted by createdAt date in
            ascending order.
        publisherTabId:
          type: string
          description: Tab ID in the web store.
        segments:
          type: array
          description: List of player segments that this rolling offer applies to.
          items:
            type: string
        productsSequence:
          type: array
          description: >-
            The sequence of products included in the rolling offer. A minimum of
            2 productSequence objects is required, with a maximum limit of 50
            product sequences.
          items:
            type: object
            properties:
              index:
                type: integer
                description: >-
                  The order of the product in the rolling offer. The index must
                  start from 1 and be sequential.
              displayName:
                type: string
                description: Sub offer display name.
              products:
                type: array
                description: >-
                  List of products in the rolling offer, with a maximum of 3 per
                  productSequence object.
                items:
                  type: object
                  required:
                    - publisherProductId
                    - quantity
                    - priority
                  properties:
                    publisherProductId:
                      type: string
                      description: The unique ID of the product.
                    quantity:
                      type: integer
                      description: The quantity of the product in the rolling offer.
                    priority:
                      type: string
                      description: >-
                        Specifies the display priority of a product within the
                        rolling offer.
                      enum:
                        - Main
                        - Sub
                      x-enum-descriptions:
                        - Main: >-
                            Primary display, with more prominent placement in
                            supported templates.
                        - Sub: >-
                            Secondary display, with less prominent placement in
                            supported templates.
              priceInUsdCents:
                type: integer
                description: >-
                  The price of the product in cents. The value must be either 0
                  (free), or have a minimum 80 cents.
              progressBarPoints:
                type: array
                description: >-
                  List of Progress Bar offers to which this offer contributes
                  points.
                items:
                  type: object
                  properties:
                    publisherBarId:
                      type: string
                      description: >-
                        The Progress Bar offer ID provided by the publisher.
                        This is the Progress Bar offer's **External ID** value
                        in the Publisher Dashboard.
                    points:
                      type: number
                      description: >-
                        The number of points this offer contributes to the
                        specified Progress Bar. This value is displayed in the
                        Points Ribbon shown on contributing offers.
              priceDiscount:
                type: object
                description: >-
                  Price discount applied to the offer. Not relevant for free
                  offers.
                properties:
                  discount:
                    type: integer
                    description: The discount amount.
                  type:
                    type: string
                    description: The type of discount.
                    default: percentage
                    enum:
                      - percentage
              productSale:
                type: object
                description: >-
                  Sale details for the product quantity (relevant only for paid
                  sub offers). The sale will only be applied on the first
                  product.
                properties:
                  sale:
                    type: integer
                    description: The sale amount.
                  type:
                    type: string
                    description: The type of sale.
                    default: percentage
                    enum:
                      - percentage
              badges:
                type: array
                description: List of badges associated with the rolling offer.
                items:
                  type: object
                  properties:
                    publisherBadgeId:
                      type: string
                      description: The unique identifier of the badge.
            required:
              - index
              - products
              - priceInUsdCents
        schedule:
          type: object
          required:
            - timeFrames
            - permanent
          description: The schedule for when the rolling offer is available.
          properties:
            permanent:
              type: boolean
              description: Whether the rolling offer is permanent.
            timeFrames:
              type: array
              description: >-
                Time frame for the scheduled offer. Leave blank if permanent is
                set to true. If permanent is false, at least 1 time frame is
                required. When specifying multiple timeFrames, the startTime and
                endTime of each must not overlap.
              items:
                type: object
                properties:
                  startTime:
                    type: string
                    description: Scheduled offer start time.
                    format: date-time
                  endTime:
                    type: string
                    description: Scheduled offer end time. Can't be a past date.
                    format: date-time
                  notes:
                    type: string
                    description: Notes about the scheduled offer.
                required:
                  - startTime
                  - endTime
        publisherSectionId:
          type: string
          description: The publisher section ID.
        displayName:
          type: string
          description: If not specified, the offer name will be used.
        description:
          type: string
          description: The offer description.
    RollingOfferDtoResponse:
      type: object
      properties:
        publisherId:
          type: string
          description: Publisher ID.
        offerId:
          type: string
          description: The unique identifier of the rolling offer.
        publisherOfferId:
          type: string
          description: >-
            The rolling offer ID provided by the publisher. This is the offer's
            **External ID** value in the Publisher Dashboard.
        name:
          type: string
          description: The name of the rolling offer.
        type:
          type: string
          description: The type of rolling offer.
        active:
          type: boolean
          description: Whether the rolling offer is active.
        priority:
          type: integer
          description: >-
            The priority level of the rolling offer. The priority starts from 1,
            where 1 is the highest priority. **Important:** Only the rolling
            offer with the highest priority will be returned. Rolling offers
            with the same or no priority will be sorted by createdAt date in
            ascending order.
        segments:
          type: array
          description: The player segments associated with the rolling offer.
          items:
            type: string
        publisherTabId:
          type: string
          description: Tab ID in the web store.
        offerUi:
          type: object
          description: >-
            Information about the rolling offer design, as configured in the
            Publisher Dashboard.
          properties:
            offerUiId:
              type: string
              description: The ID of the rolling offer design.
            active:
              type: boolean
              description: Whether the rolling offer design is active.
            offerUiType:
              type: string
              description: The type of offer design. In this case, ‘RollingOffer’.
            name:
              type: string
              description: The name of the rolling offer design.
            description:
              type: string
              description: The description of the rolling offer design.
            backgroundImage:
              type: string
              description: The background image of the rolling offer.
            borderColor:
              type: object
              description: Border color details for the rolling offer.
              properties:
                colorOne:
                  type: string
                  description: The primary border color.
                colorTwo:
                  type: string
                  description: >-
                    The secondary border color. Returned only if the border
                    color in the UI is set to **Linear**.
                direction:
                  type: string
                  description: >-
                    The direction of the gradient between both border colors.
                    Returned only if the border color in the UI is set to
                    **Linear**.
            borderWidth:
              type: integer
              description: The width of the border surrounding the rolling offer.
            externalId:
              type: string
              description: >-
                The SKU of the rolling offer design, as defined in the Publisher
                Dashboard.
            rollingOffer:
              type: object
              description: >-
                Specific settings for the rolling offer UI, as configured in the
                Publisher Dashboard.
              properties:
                arrowColor:
                  type: string
                  description: The arrow color.
                backgroundColor:
                  type: object
                  description: Information about the background color of the rolling offer.
                  properties:
                    colorOne:
                      type: string
                      description: The primary background color of the rolling offer.
                    colorTwo:
                      type: string
                      description: >-
                        The secondary background color of the rolling offer.
                        Returned only if the background color in the UI is set
                        to **Linear**.
                    gradientDirection:
                      type: string
                      description: >-
                        The direction of the gradient between both background
                        colors. Returned only if the background color in the UI
                        is set to **Linear**.
                headerImage:
                  type: string
                  description: The header image of the rolling offer.
                backgroundOpacity:
                  type: integer
                  description: The opacity level of the rolling offer background.
                subRollingOffer:
                  type: object
                  description: Information about the sub offer design.
                  properties:
                    backgroundColor:
                      type: object
                      description: Information about the background color of the sub offer.
                      properties:
                        colorOne:
                          type: string
                          description: The primary background color of the sub offer.
                        colorTwo:
                          type: string
                          description: >-
                            The secondary background color of the sub offer.
                            Returned only if the background color in the UI is
                            set to **Linear**.
                        direction:
                          type: string
                          description: >-
                            The direction of the gradient between both
                            background colors. Returned only if the background
                            color in the UI is set to **Linear**.
                    backgroundImage:
                      type: string
                      description: The background image of the sub offer.
                    lockImage:
                      type: string
                      description: The image shown when the sub offer is locked.
                    collectText:
                      type: string
                      description: >-
                        The text displayed on the button used to claim the sub
                        offer.
        productsSequence:
          type: array
          description: |-
            The sequence of products within the rolling offer. 
             Min: 2 
             Max: 50
          items:
            type: object
            properties:
              index:
                type: integer
                description: >-
                  The order of the product in the rolling offer. The index must
                  start from 1 and be sequential.
              displayName:
                type: string
                description: Sub offer display name.
              products:
                type: array
                description: |-
                  List of products in the rolling offer. 
                   Max: 3
                items:
                  type: object
                  properties:
                    publisherProductId:
                      type: string
                      description: The unique ID of the product.
                    quantity:
                      type: integer
                      description: The quantity of the product in the rolling offer.
                    priority:
                      type: string
                      description: >-
                        Specifies the display priority of a product within the
                        rolling offer.
                      enum:
                        - Main
                        - Sub
                      x-enum-descriptions:
                        - Main: >-
                            Primary display, with more prominent placement in
                            supported templates. Only one product can be marked
                            as **Main**.
                        - Sub: >-
                            Secondary display, with less prominent placement in
                            supported templates.
              priceInUsdCents:
                type: integer
                description: >-
                  The price of the product in cents. The value must be either 0
                  (free), or have a minimum 80 cents.
              progressBarPoints:
                type: array
                description: >-
                  List of Progress Bar offers to which this offer contributes
                  points.
                items:
                  type: object
                  properties:
                    publisherBarId:
                      type: string
                      description: >-
                        The Progress Bar offer ID provided by the publisher.
                        This is the Progress Bar offer's **External ID** value
                        in the Publisher Dashboard.
                    points:
                      type: number
                      description: >-
                        The number of points this offer contributes to the
                        specified Progress Bar. This value is displayed in the
                        Points Ribbon shown on contributing offers.
              badges:
                type: array
                description: List of badges associated with the rolling offer.
                items:
                  type: object
                  properties:
                    publisherBadgeId:
                      type: string
                      description: The unique identifier of the badge.
        schedule:
          type: object
          description: The schedule for when the rolling offer is available.
          properties:
            permanent:
              type: boolean
              description: Whether the rolling offer is permanent.
              default: true
            timeFrames:
              type: array
              description: >-
                Time frame for the scheduled offer. Leave blank if permanent is
                set to true. If permanent is false, at least 1 time frame is
                required. When specifying multiple timeFrames, the startTime and
                endTime of each must not overlap.
              items:
                type: object
                properties:
                  startTime:
                    type: string
                    description: Scheduled offer start time.
                    format: date-time
                  endTime:
                    type: string
                    description: Scheduled offer end time. Can't be a past date.
                    format: date-time
                  notes:
                    type: string
                    description: Notes about the scheduled offer.
          items:
            type: object
        createdAt:
          type: string
          description: Date the rolling offer was created.
          format: date-time
        updatedAt:
          type: string
          description: Date the rolling offer was updated.
          format: date-time

````