> ## 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 Post Purchase Popup

> Updates a post purchase offer.

<RequestExample>
  ```bash Update Post Purchase Popup theme={"system"}
  curl -X PUT \
    'https://api.appcharge.com/v2/offer/post-purchase-1' \
    -H 'Content-Type: application/json' \
    -H 'x-publisher-token: <x-publisher-token>' \
    -d '{
      "name": "New Post Purchase Name",
      "displayName": "Purchase Reward Offer",
      "description": "The post purchase offer for VIP players.",
      "type": "PopUp",
      "subType": "PostPurchase",
      "active": true,
      "priority": 1,
      "offerExternalUiId": "popup",
      "segments": [],
      "productsSequence": [
        {
          "index": 1,
          "products": [
            {
              "priority": "Main",
              "publisherProductId": "ManeProduct",
              "quantity": 104
            }
          ],
          "priceInUsdCents": 2000
        }
      ]
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json Update Post Purchase Popup theme={"system"}
  {
    "publisherId": "35nb7861ec9924a6b69a0fe59",
    "publisherOfferId": "post-purchase-1",
    "name": "New Post Purchase Name",
    "displayName": "Purchase Reward Offer",
    "description": "Post purchase offer for VIP players.",
    "type": "PopUp",
    "subType": "PostPurchase",
    "active": true,
    "segments": [],
    "offerUi": {
        "offerUiId": "68b41c5aa1c5b1a284737e9b",
        "active": true,
        "offerUiType": "PopUp",
        "name": "popup",
        "description": "description",
        "backgroundImage": "https://media.appcharge.com/media/35nb7861ec9924a6b69a0fe59/2755379465856__fa883338-5790-47c8-a6a0-23cb43db58844",
        "externalId": "popup"
    },
    "productsSequence": [
        {
            "index": 1,
            "products": [
                {
                    "product": {
                        "publisherProductId": "TreasureChest",
                        "name": "Treasure Chest",
                        "type": "Quantity",
                        "prefix": "$",
                        "suffix": "M",
                        "priority": "Main",
                        "images": [
                            {
                                "type": "product",
                                "url": "https://media.appcharge.com/media/35nb7861ec9924a6b69a0fe59/2208472.png"
                            },
                            {
                                "type": "productPrefix",
                                "url": ""
                            }
                        ],
                        "displayName": "Treasure Chest"
                    }
                }
            ]
        }
    ],
    "priority": 1,
    "showAfter": "purchase",
    "triggers": [
        {
            "type": "event",
            "eventName": "purchase",
            "every": 1,
            "rules": []
        }
    ],
    "createdAt": "2025-09-01T14:16:09.499Z",
    "updatedAt": "2025-09-01T14:16:09.499Z",
    "offerId": "68b5aaa9b73fceb9ffc26f9b"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml openapi-post-purchase.json PUT /v2/offer/${publisherOfferId}
openapi: 3.0.1
info:
  title: Post Purchase Offer API
  description: API for managing Post Purchase Offers.
  version: '1.0'
servers:
  - url: https://api-sandbox.appcharge.com
security: []
paths:
  /v2/offer/${publisherOfferId}:
    put:
      tags:
        - Post Purchase Offers
      summary: Update an existing Post Purchase Popup
      description: Updates a Post Purchase popup offer.
      operationId: updatePostPurchaseOffer
      parameters:
        - name: publisherOfferId
          in: path
          required: true
          description: >-
            The Post Purchase Popup ID provided by the publisher. This is the
            offer's **External ID** value in the Publisher Dashboard.
          schema:
            type: string
        - 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/UpdatePostPurchaseOfferDto'
      responses:
        '200':
          description: Post purchase offer updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostPurchaseOfferDtoResponse'
        '401':
          description: Unauthorized.
components:
  schemas:
    UpdatePostPurchaseOfferDto:
      type: object
      required:
        - type
      properties:
        name:
          type: string
          description: The name of the Post Purchase Popup (at least 3 characters).
        displayName:
          type: string
          description: >-
            The display name of the Post Purchase Popup. If not provided, the
            name will be used.
        description:
          type: string
          description: The description of the Post Purchase Popup.
        type:
          type: string
          description: The type of offer - In this case 'PopUp'.
          enum:
            - PopUp
          default: PopUp
        subType:
          type: string
          description: The sub type of the offer - In this case 'PostPurchase'.
          enum:
            - PostPurchase
          default: PostPurchase
        active:
          type: boolean
          description: Whether the Post Purchase Popup is active.
        priority:
          type: integer
          description: >-
            The priority level of the Post Purchase Popup. The priority start
            from 1 (1 being the highest priority).
        offerUiId:
          type: string
          description: >-
            Offer Design ID generated by Appcharge. This is the design's **ID**
            value in the Publisher Dashboard. Required if `offerExternalUiId` is
            not provided.
          example: 68b41c5aa1c5b1a284737e9b
        offerExternalUiId:
          type: string
          description: >-
            Offer Design ID. This is the design's **External ID** value in the
            Publisher Dashboard. Required if `offerUiId` is not provided.
          example: post_purchase_popup_design
        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.
                default: event
                enum:
                  - event
              eventName:
                type: string
                description: Name of the event that triggers the popup.
                default: purchase
                enum:
                  - purchase
              every:
                type: integer
                default: 1
                description: Number of purchases required to present the popup.
              rules:
                type: array
                description: Rules to specify conditions under which the popup appears.
                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` strings.
                      items:
                        type: string
        segments:
          type: array
          description: List of player segments that this Post Purchase Popup applies to.
          items:
            type: string
        productsSequence:
          type: array
          description: >-
            The sequence of products included in the Post Purchase Popup. Only
            one product sequence index is allowed.
          items:
            type: object
            properties:
              index:
                type: integer
                description: The order of the product in the Post Purchase Popup.
              products:
                type: array
                description: >-
                  List of products in the Post Purchase Popup. Currently only 1
                  product is allowed.
                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 Post Purchase Popup.
                    priority:
                      type: string
                      description: >-
                        Specifies the display priority of a product within the
                        Post Purchase Popup.
                      enum:
                        - Main
                        - Sub
              priceInUsdCents:
                type: integer
                description: >-
                  The price of the product in cents. The price can either be 0
                  (free), or a minimum of 80 cents.
            required:
              - index
              - products
              - priceInUsdCents
        publisherSectionId:
          type: string
          description: The publisher section ID.
        publisherTabId:
          type: string
          description: Tab ID in the web store.
        startOver:
          type: boolean
          description: Whether the popup availability starts over after collection.
    PostPurchaseOfferDtoResponse:
      type: object
      properties:
        publisherId:
          type: string
          description: Publisher ID.
        offerId:
          type: string
          description: The unique identifier of the Post Purchase Popup.
        publisherOfferId:
          type: string
          description: >-
            The Post Purchase Popup 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 Post Purchase Popup.
        displayName:
          type: string
          description: >-
            The display name of the Post Purchase Popup. If not provided, the
            name will be used.
        description:
          type: string
          description: The description of the Post Purchase Popup (conditionally returned).
        type:
          type: string
          description: The type of offer.
        subtype:
          type: string
          description: The sub type of the offer - In this case 'PostPurchase'.
        active:
          type: boolean
          description: Whether the Post Purchase Popup is active.
        segments:
          type: array
          description: >-
            List of player segments that this Post Purchase Popup applies to
            (e.g., ["NewUser", "BigSpender"]). This is empty by default.
          items:
            type: string
        showAfter:
          type: string
          description: The player action after which the offer is displayed.
          example: purchase
        offerUi:
          type: object
          description: UI configuration for the Post Purchase Popup.
          properties:
            offerUiId:
              type: string
              description: >-
                Offer Design ID generated by Appcharge. This is the design's
                **ID** value in the Publisher Dashboard.
              example: 68b41c5aa1c5b1a284737e9b
            offerExternalUiId:
              type: string
              description: >-
                Offer Design ID. This is the design's **External ID** value in
                the Publisher Dashboard.
              example: post_purchase_popup_design
            active:
              type: boolean
              description: Whether the Post Purchase Popup design is active.
            offerUiType:
              type: string
              description: The type of offer design. In this case, ‘Post Purchase Popup’.
            name:
              type: string
              description: >-
                The name of the Post Purchase Popup design, as defined in the
                Publisher Dashboard.
            description:
              type: string
              description: >-
                The description of the Post Purchase Popup design, as defined in
                the Publisher Dashboard.
            backgroundImage:
              type: string
              description: >-
                The background image of the Post Purchase Popup design, as
                defined in the Publisher Dashboard.
            specialOffer:
              type: object
              description: Details on the Post Purchase Popup template and design.
              properties:
                templateType:
                  type: string
                  description: The template type, as configured in the Publisher Dashboard.
                title:
                  type: string
                  description: >-
                    The title of the Post Purchase Popup, as configured in the
                    Publisher Dashboard.
                fontSize:
                  type: number
                  description: >-
                    The font size of the Post Purchase Popup title, as
                    configured in the Publisher Dashboard.
                fontWeight:
                  type: string
                  description: >-
                    The font weight of the Post Purchase Popup title, as
                    configured in the Publisher Dashboard.
                fontColor:
                  type: object
                  description: >-
                    Details on the font color of the Post Purchase Popup title
                    as configured in the Publisher Dashboard. If the font color
                    is set to linear, both 'colorOne' and 'colorTwo' will be
                    returned. 'colorThree' may also be returned, if configured.
                  properties:
                    colorOne:
                      type: string
                      description: The font color of the Post Purchase Popup title.
                    colorTwo:
                      type: string
                      description: >-
                        The second font color of the Post Purchase Popup title.
                        Relevant only if the font color is set to linear.
                    colorThree:
                      type: string
                      description: >-
                        The third font color of the Post Purchase Popup title.
                        Relevant only if the font color is set to linear.
                backgroundColor:
                  type: object
                  description: >-
                    Details on the background color of the Post Purchase Popup
                    title as configured in the Publisher Dashboard. If the
                    background color is set to linear, the direction will be
                    returned along with ‘colorOne’ and ‘colorTwo’.
                  properties:
                    colorOne:
                      type: string
                      description: The background color of the Post Purchase Popup title.
                    colorTwo:
                      type: string
                      description: >-
                        The second background color of the Post Purchase Popup
                        title. Relevant only if the background color is set to
                        linear.
                    direction:
                      type: string
                      description: >-
                        The direction of the linear gradient. Relevant only if
                        the background color is set to linear.
        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.
                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` strings.
                      items:
                        type: string
        productsSequence:
          type: array
          description: A sequence of products in the Post Purchase Popup.
          items:
            type: object
            properties:
              index:
                type: integer
                description: The order of the product in the Post Purchase Popup.
              products:
                type: array
                description: List of products in the Post Purchase Popup.
                items:
                  type: object
                  properties:
                    product:
                      type: object
                      description: Information about the product.
                      properties:
                        publisherProductId:
                          type: string
                          description: The unique ID of the product.
                        quantity:
                          type: integer
                          description: >-
                            The quantity of the product in the Post Purchase
                            Popup.
                        priority:
                          type: string
                          description: >-
                            Specifies the display priority of a product within
                            the Post Purchase Popup. Either `Main` or `Sub`.
              priceInUsdCents:
                type: integer
                description: >-
                  The price of the product in cents. The price can either be 0
                  (free), or a minimum of 80 cents.
        createdAt:
          type: string
          description: Date the Post Purchase Popup was created.
          format: date-time
        updatedAt:
          type: string
          description: Date the Post Purchase Popup was updated.
          format: date-time

````