> ## 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.

# Update Popup



## OpenAPI

````yaml openapi-update-popups_v1.json PUT /offering/offer/popup/{offerSKU}
openapi: 3.0.0
info:
  title: Offering API
  description: Offering API for enabling publishers to push new assets
  version: '1.0'
  contact: {}
servers:
  - url: https://api-sandbox.appcharge.com
security: []
tags: []
paths:
  /offering/offer/popup/{offerSKU}:
    put:
      tags:
        - Offers
      operationId: update-popup-by-Id
      parameters:
        - name: offerSKU
          required: true
          in: path
          schema:
            type: string
            description: The publisher Id of the offer.
        - name: x-publisher-token
          required: true
          in: header
          description: The publisher token
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOfferDto'
      responses:
        '200':
          description: Update Offer by Id
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OfferDtoResponse'
        '401':
          description: Not Authorized
components:
  schemas:
    UpdateOfferDto:
      type: object
      properties:
        publisherOfferId:
          type: string
          description: The new Id of the offer.
          example: Test_Popup_New
        name:
          type: string
          description: The name of the offer. At least 3 letters.
          example: Test_Popup
        displayName:
          type: string
          description: >-
            The display name of the offer. If not specified, the offer name will
            be used.
        description:
          type: string
          description: The description of the offer.
          example: Best offer ever.
        offerUiId:
          type: string
          description: >-
            The Internal ID for the Offer UI. The Offer UI is responsible to add
            UI elements to the offers such as background image and title. Once
            you create the Offer UI using the dashboard, you will get the
            internal ID. This must correspond with the type of offer you
            configure. In this case "Popup".
          example: 64a55b82e06998282d3d9b59
        offerExternalUiId:
          type: string
          description: >-
            The offer UI ID as configured by the publisher. If offerExternalUiId
            is provided, then offerUiId will not be required.
          example: b9c1e7a3d1f8b2a4c6e5d8f3
        dynamicOfferUi:
          $ref: '#/components/schemas/DynamicOfferUiDto'
        active:
          type: boolean
          description: Is the offer active? true/false.
          example: 'true'
        startOver:
          type: boolean
          description: Popup will repeat itself.
        showAfter:
          type: string
          description: 'Optional values: "login", "purchase"'
        triggers:
          type: array
          description: >-
            An array of objects specifying the conditions under which the popup
            should be triggered.
          items:
            type: object
            properties:
              type:
                type: string
                description: Type of trigger.
                enum:
                  - event
              eventName:
                type: string
                description: Name of the event that triggers the popup.
                enum:
                  - purchase
              every:
                type: integer
                description: Number of purchases required to present the popup.
              rules:
                type: array
                description: >-
                  Rules to specify conditions under which the popup appears. If
                  it can apply to any offers, leave the array empty.
                items:
                  type: object
                  properties:
                    fieldName:
                      type: string
                      description: Name of the field to evaluate.
                      enum:
                        - publisherOfferId
                    operator:
                      type: string
                      description: Operator to compare the field value.
                      enum:
                        - in
                    value:
                      type: array
                      description: Array of 'publisherOfferId'(s)
                      items:
                        type: string
        segments:
          type: array
          items:
            type: string
          description: >-
            The Ids of the player segments to be used in the segmentation
            algorithm. for example: [“NewUser”, “BigSpender”].
          example: NewUser
        productsSequence:
          type: array
          items:
            $ref: '#/components/schemas/ProductsSequence'
          description: >-
            Relevant only for rolling offers, for any other offer (store tile,
            single promotion) report all products under sequence ‘1’
    OfferDtoResponse:
      type: object
      properties:
        offerId:
          type: string
          description: The Id of the offer.
          example: 655dc8a546822b3e7586b7b7
        publisherOfferId:
          type: string
          description: The offer publisher Id.
          example: offer1
        name:
          type: string
          description: The name of the offer.
          example: Test_popup
        displayName:
          type: string
          description: >-
            The display name of the offer. If not specified, the offer name will
            be used.
        description:
          type: string
          description: The description of the offer. Conditionally returned.
          example: N/A
        type:
          type: string
          description: The type of the offer. In this case "Popup"
          example: Popup
        createdBy:
          type: string
          description: The platform which the offer was created from (Dashboard, API)
          example: API
        offerUi:
          $ref: '#/components/schemas/OfferUiDto'
        dynamicOfferUi:
          $ref: '#/components/schemas/DynamicOfferUiDto'
        active:
          type: boolean
          description: Is the offer active? true/false.
          example: 'true'
        coolDownInHours:
          type: number
          description: >-
            Used for cooldown between orders. **DEPRECATION WARNING**: This
            field will be removed in future releases.
          example: '1'
        segments:
          type: array
          items:
            type: string
          description: >-
            The Ids of the player segments to be used in the segmentation
            algorithm. for example: [“NewUser”, “BigSpender”].
          example: '[NewUser]'
        productsSequence:
          type: array
          items:
            $ref: '#/components/schemas/ProductsSequenceResponse'
          description: The products sequense containing the sets of products.
        startOver:
          type: boolean
          description: Will the popup repeat itself?
        priority:
          type: number
          description: The priority of the PopUp.
        showAfter:
          type: string
          description: Either "login" or "purchase"
        triggers:
          type: array
          description: >-
            An array of objects specifying the conditions under which the popup
            should be triggered.
          items:
            type: object
            properties:
              type:
                type: string
              eventName:
                type: string
              every:
                type: integer
              rules:
                type: array
                items: {}
        createdAt:
          format: date-time
          type: string
          description: the time when the offer was created, in UTC.
          example: '2023-07-05T12:01:06.113Z'
        updatedAt:
          format: date-time
          type: string
          description: the time when the offer was updated, in UTC.
          example: '2023-07-05T12:01:06.113Z'
    DynamicOfferUiDto:
      type: object
      description: UI element that can be configured dynamically.
      properties:
        badges:
          type: array
          description: The badges of the offer.
          items:
            type: object
            properties:
              publisherBadgeId:
                type: string
                description: The publiher badge Id.
                example: badge1
              badge:
                $ref: '#/components/schemas/BadgeDto'
        salePercentage:
          type: number
          description: The sale percentage on the offer.
        salePercentageDisplayType:
          type: string
          description: 'Optional Values: percentage, multiplier, fixed_amount'
    ProductsSequence:
      type: object
      properties:
        index:
          type: number
          description: Position of the offered products. Starts with 1.
          example: 1
        playerAvailability:
          type: number
          description: How many available for a player.
          example: 2
          minimum: 1
          maximum: 99
        priceInUsdCents:
          type: number
          description: Price of the products set in cents.
          example: 300
        products:
          type: array
          items:
            $ref: '#/components/schemas/ProductsSet'
          description: The products in the set that the offer contains.
      required:
        - playerAvailability
    OfferUiDto:
      type: object
      properties:
        offerUiId:
          type: string
          description: The Id of the offer UI in Mongo DB format.
          example: 6548afb2ed7ec741ac8dee3a
        externalId:
          type: string
          description: the publisher offer Offer design ID
        active:
          type: boolean
          description: Is the offer UI active? true/false.
          example: 'true'
        offerUiType:
          type: string
          description: >-
            The type of offer associaciated with the UI you configured. In this
            case "Popup"
          example: Popup
        name:
          type: string
          description: The name of the offer UI
          example: test_offerUi
        description:
          type: string
          description: The description of the offer UI
          example: Best Offer UI
        backgroundImage:
          type: string
          description: The background Image URL of the offer UI
          example: https://media.appcharge.com/defaults/background.png
        specialOffer:
          type: object
          description: Additional design fields for the type of Offer UI you configured.
          properties:
            templateType:
              type: string
              description: 'The template type: Single/Multiple.'
              example: Single
            presentOfferEndTimer:
              type: boolean
              description: Should an end timer be presented for the offer? true/false.
              example: 'false'
            title:
              type: string
              example: ''
            fontSize:
              type: number
              example: 18
            fontWeight:
              type: string
              example: normal
            fontColor:
              type: object
              properties:
                colorOne:
                  type: string
                  example: black
                colorTwo:
                  type: string
                  description: Conditionally returned
                  example: black
                direction:
                  type: string
                  description: Conditionally returned
                  example: to right
            backgroundColor:
              type: object
              properties:
                colorOne:
                  type: string
                  example: black
                colorTwo:
                  type: string
                  description: Conditionally returned
                  example: black
                direction:
                  type: string
                  description: Conditionally returned
                  example: to right
    ProductsSequenceResponse:
      type: object
      properties:
        index:
          type: number
          description: Position of the offered products. Starts with 1.
          example: 1
        playerAvailability:
          type: number
          description: How many available for a player. Conditionally returned.
          example: 2
        priceInUsdCents:
          type: number
          description: Price of the products set in cents.
          example: 300
        products:
          type: array
          items:
            $ref: '#/components/schemas/ProductsSetResponse'
          description: The products in the set that the offer contains.
    BadgeDto:
      type: object
      properties:
        badgeId:
          type: string
          description: The Id of the badge.
          example: 6548afb2ed7ec741ac8deeff
        publisherBadgeId:
          type: string
          description: The publiher badge Id.
          example: badge1
        position:
          type: string
          description: 'The position of the badge on the offer: right/left/center.'
          example: right
        name:
          type: string
          description: The name of the badge.
          example: test_badge
        type:
          type: string
          description: 'The type of the badge: emblem/ribbon.'
          example: emblem
        emblem:
          type: object
          description: Returned only if the badge type is emblem
          properties:
            imageUrl:
              type: string
        ribbon:
          type: object
          description: Returned only if the badge type is ribbon
          properties:
            text:
              type: string
            backgroundColor:
              type: object
              properties:
                gradientDirection:
                  type: string
                colorOne:
                  type: string
                colorTwo:
                  type: string
            textColor:
              type: object
              properties:
                gradientDirection:
                  type: string
                colorOne:
                  type: string
                colorTwo:
                  type: string
    ProductsSet:
      type: object
      properties:
        quantity:
          type: number
          description: The quantity of the product.
          example: 500
        publisherProductId:
          type: string
          description: The publisher product Id as configured in the Appcharge dashboard.
          example: product1
      required:
        - quantity
        - publisherProductId
    ProductsSetResponse:
      type: object
      properties:
        quantity:
          type: number
          description: The quantity of the product.
          example: 500
        product:
          $ref: '#/components/schemas/ProductDto'
    ProductDto:
      type: object
      properties:
        publisherProductId:
          type: string
          description: The publisher product Id.
          example: product1
        name:
          type: string
          description: The name of the product.
          example: test_product
        textFontColorHex:
          type: string
          description: The color of the text in Hex.
          example: '#FFFF'
        type:
          type: string
          description: 'The type of the product: Time/Quantity.'
          example: Time
        prefix:
          type: string
          description: The prefix of the product.
          example: '100'
        suffix:
          type: string
          description: The suffix of the product.
          example: '500'
        priority:
          type: string
          description: 'The priority of the product: Main/Sub.'
          example: Main
        images:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
              url:
                type: string
        createdAt:
          format: date-time
          type: string
          description: the time when the product was created, in UTC.
          example: '2023-07-05T12:01:06.113Z'
        updatedAt:
          format: date-time
          type: string
          description: the time when the product was updated, in UTC.
          example: '2023-07-05T12:01:06.113Z'
        productId:
          type: string
          description: The Id of the product.
          example: 655dc8a546822b3e7586b7b7

````