openapi: 3.0.0
x-mint:
  mcp:
    enabled: true
info:
  title: Offers - Redemptions
  description: >-
    fabric Redemption API lets shoppers use a coupon to get discount or other
    benefit, configured on the coupon, during checkout. These endpoints let
    merchants create and manage such redemption records.
  version: 3.0.0
  x-audience: external-public
  termsOfService: https://fabric.inc/terms-of-use
  contact:
    name: Offers support
    email: support@fabric.inc
  license:
    name: fabric API License
    url: https://fabric.inc/api-license
externalDocs:
  description: Find out more about Offers
  url: https://developer.fabric.inc/docs/offers-overview
servers:
  - url: https://api.fabric.inc/v3
    description: Production environment
paths:
  /coupons/{couponId}/redemptions:
    post:
      tags:
        - Redemptions
      summary: Create redemption
      description: >-
        Creates a redemption for a specific coupon using the corresponding
        `couponId` value.
      operationId: createRedemptionDeprecated
      deprecated: true
      security:
        - AuthorizationToken: []
      parameters:
        - $ref: '#/components/parameters/xFabricTenantId'
        - $ref: '#/components/parameters/xFabricChannelId'
        - $ref: '#/components/parameters/xClientId'
        - $ref: '#/components/parameters/xFabricRequestId'
        - name: couponId
          in: path
          description: >-
            A 24-character system-generated coupon ID generated using the
            [create coupon](/v3/api-reference/offers/coupons/create-coupon)
            endpoint.
          required: true
          schema:
            type: string
            example: 614b58924e92f6861ac9d43b
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/createRedemptionRequestDeprecated'
      responses:
        '201':
          description: Created
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/createRedemptionResponseDeprecated'
        '400':
          description: Bad request
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/couponIdNotValid'
                  - $ref: '#/components/schemas/missingTenantHeader'
                  - $ref: '#/components/schemas/error400'
        '401':
          description: Unauthorized
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error401'
        '500':
          description: Internal server error
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /coupons/{couponId}/redemptions/{redemptionId}:
    delete:
      tags:
        - Redemptions
      summary: Delete a coupon redemption by ID
      description: Delete a specific redemption by redemption ID.
      operationId: deleteRedemptionDeprecated
      deprecated: true
      security:
        - AuthorizationToken: []
      parameters:
        - $ref: '#/components/parameters/xFabricTenantId'
        - $ref: '#/components/parameters/xFabricChannelId'
        - $ref: '#/components/parameters/xClientId'
        - $ref: '#/components/parameters/xFabricRequestId'
        - name: couponId
          in: path
          description: >-
            A 24-character system-generated coupon ID generated using the
            [create coupon](/v3/api-reference/offers/coupons/create-coupon)
            endpoint.
          required: true
          schema:
            type: string
            example: 614b58924e92f6861ac9d43b
        - name: redemptionId
          in: path
          description: >-
            The redemption ID generated using the [create redemption with coupon
            ID](/v3/api-reference/offers/redemptions/create-redemption) endpoint
            to delete the redemption.
          required: true
          schema:
            type: string
            example: 614b58924e92f6861ac9d43b
      responses:
        '200':
          description: OK
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/deleteRedemptionResponse'
        '400':
          description: Bad request
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/redemptionIdNotValid'
                  - $ref: '#/components/schemas/couponIdNotValid'
                  - $ref: '#/components/schemas/missingTenantHeader'
                  - $ref: '#/components/schemas/error400'
        '401':
          description: Unauthorized
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error401'
        '404':
          description: Not Found
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/redemptionNotFound'
        '500':
          description: Internal server error
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /redemptions:
    get:
      tags:
        - Redemptions
      summary: Get all redemption details
      description: >-
        Use this endpoint to retrieve a list of redemption records. You can
        filter the records using parameters, such as `couponCode`, `userId`,
        `email`, `orderId`, or `storeId`.
      operationId: getRedemptions
      security:
        - AuthorizationToken: []
      parameters:
        - $ref: '#/components/parameters/xFabricTenantId'
        - $ref: '#/components/parameters/xFabricChannelId'
        - $ref: '#/components/parameters/xClientId'
        - $ref: '#/components/parameters/xFabricRequestId'
        - $ref: '#/components/parameters/queryParameterSize'
        - $ref: '#/components/parameters/queryParameterStartCursor'
        - name: promotionId
          in: query
          description: Promotion ID for which you want to get the redemption records
          required: false
          schema:
            type: string
            example: 62d172529da20e000924dfb5
        - name: couponCode
          in: query
          description: Coupon code for which you want to get the redemption records
          required: false
          schema:
            type: string
            example: BESTSUMMER
        - name: userId
          in: query
          description: ID of the user for whom you want to get the redemption records
          required: false
          schema:
            type: string
            example: 5f8b8b2a9da20e000924dfb5
        - name: email
          in: query
          description: >-
            Email address of the user for whom you want to get the redemption
            records
          required: false
          schema:
            type: string
            example: guest@gmail.com
        - name: orderId
          in: query
          description: Order ID associated with the redemption records
          required: false
          schema:
            type: string
            example: 1590-2016-123456
        - name: storeId
          in: query
          description: >-
            Comma-separated IDs of the stores for which you want to get the
            redemption records
          required: false
          schema:
            type: string
            example: 10001
        - name: status
          in: query
          description: >
            Status by which you want to filter the redemption records. The
            options are:

            - `ACTIVE`: Refers to the created redemption records.

            - `INACTIVE`: Refers to the redemption records that were generated
            but are inactive due to order cancellations.
          required: false
          schema:
            type: string
            example: ACTIVE
            enum:
              - ACTIVE
              - INACTIVE
        - name: redeemedFrom
          in: query
          description: >-
            If specified, it returns the redemption records that are created
            from this specific date
          required: false
          schema:
            type: string
            example: 2023-10-18T19:00:51.459Z
        - name: redeemedTo
          in: query
          description: >-
            If specified, it returns the created redemption records till this
            specific date
          required: false
          schema:
            type: string
            example: 2023-11-18T19:00:51.459Z
        - name: updatedFrom
          in: query
          description: >-
            If specified, it returns the redemption records that are updated
            from this specific date
          required: false
          schema:
            type: string
            example: 2023-10-18T19:00:51.459Z
        - name: updatedTo
          in: query
          description: >-
            If specified, it returns the updated redemption records till this
            specific date
          required: false
          schema:
            type: string
            example: 2023-11-18T19:00:51.459Z
        - name: additionalAttributes
          in: query
          description: Additional attributes to filter redemption records
          required: false
          schema:
            type: string
            example: '{"name":"brand","values":"Nike"}'
        - name: promotionAdditionalAttributes
          in: query
          description: >-
            Promotion-specific additional attributes to filter redemption
            records
          required: false
          schema:
            type: string
            example: '{"name":"WeboutletValid","values":"NO"}'
        - name: promotionName
          in: query
          description: Promotion name by which you want to filter the redemption records
          required: false
          schema:
            type: string
            example: Summer promotion
        - name: isImplicit
          in: query
          description: >-
            This boolean query parameter is used to filter for redemptions
            associated with either implicit or non-implicit promotions. If the
            filter isn't provided, the response will include all redemptions.
          required: false
          schema:
            type: boolean
            example: false
        - name: singleMultiUse
          in: query
          description: >-
            Filter that indicates if the redemptions will belong to SINGLE or
            MULTI use coupon. If not sent, all redemptions will be returned.
          required: false
          schema:
            type: string
            example: SINGLE_USE
            enum:
              - SINGLE_USE
              - MULTI_USE
      responses:
        '200':
          description: OK
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getRedemptionsResponse'
        '400':
          description: Bad request
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/badSizeError'
                  - $ref: '#/components/schemas/badStartCursorError'
                  - $ref: '#/components/schemas/missingTenantHeader'
                  - $ref: '#/components/schemas/error400'
        '401':
          description: Unauthorized
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error401'
        '500':
          description: Internal server error
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
    post:
      tags:
        - Redemptions
      summary: Create redemption
      description: >-
        Creates a redemption for a specific promotion using the corresponding
        `promotionId` value in the request body.
      operationId: createRedemption
      security:
        - AuthorizationToken: []
      parameters:
        - $ref: '#/components/parameters/xFabricTenantId'
        - $ref: '#/components/parameters/xFabricChannelId'
        - $ref: '#/components/parameters/xClientId'
        - $ref: '#/components/parameters/xFabricRequestId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/createRedemptionRequest'
      responses:
        '201':
          description: Created
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/createRedemptionResponse'
        '400':
          description: Bad request
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/promotionIdNotValid'
                  - $ref: '#/components/schemas/missingTenantHeader'
                  - $ref: '#/components/schemas/error400'
        '401':
          description: Unauthorized
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error401'
        '500':
          description: Internal server error
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /redemptions/{redemptionId}:
    get:
      tags:
        - Redemptions
      summary: Get redemption by ID
      description: >-
        Retrieves a specific redemption using the corresponding `redemptionId`
        value.
      operationId: getRedemption
      security:
        - AuthorizationToken: []
      parameters:
        - $ref: '#/components/parameters/xFabricTenantId'
        - $ref: '#/components/parameters/xFabricChannelId'
        - $ref: '#/components/parameters/xClientId'
        - $ref: '#/components/parameters/xFabricRequestId'
        - name: redemptionId
          in: path
          description: >
            Redemption ID to get the redemption details. The redemption ID
            generated using the following endpoints:

            - [Create
            redemption](/v3/api-reference/offers/redemptions/create-redemption)

            - [Create redemption using coupon
            ID](/v3/api-reference/offers/redemptions/create-redemption-using-coupon)
          required: true
          schema:
            type: string
            example: 614b58924e92f6861ac9d43b
      responses:
        '200':
          description: OK
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getRedemptionResponse'
        '400':
          description: Bad request
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/redemptionIdNotValid'
                  - $ref: '#/components/schemas/missingTenantHeader'
                  - $ref: '#/components/schemas/error400'
        '401':
          description: Unauthorized
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error401'
        '404':
          description: Not Found
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/redemptionNotFound'
        '500':
          description: Internal server error
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
    put:
      tags:
        - Redemptions
      summary: Update redemption by ID
      description: Updates a specific redemption using the corresponding `redemptionId`.
      operationId: updateRedemption
      security:
        - AuthorizationToken: []
      parameters:
        - $ref: '#/components/parameters/xFabricTenantId'
        - $ref: '#/components/parameters/xFabricChannelId'
        - $ref: '#/components/parameters/xClientId'
        - $ref: '#/components/parameters/xFabricRequestId'
        - name: redemptionId
          in: path
          description: >
            Redemption ID to update the redemption. The redemption ID generated
            using the following endpoints:

            - [Create
            redemption](/v3/api-reference/offers/redemptions/create-redemption)

            - [Create redemption using coupon
            ID](/v3/api-reference/offers/redemptions/create-redemption-using-coupon)
          required: true
          schema:
            type: string
            example: 614b58924e92f6861ac9d43b
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/updateRedemptionRequest'
      responses:
        '200':
          description: OK
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/updateRedemptionResponse'
        '400':
          description: Bad request
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/redemptionIdNotValid'
                  - $ref: '#/components/schemas/missingTenantHeader'
                  - $ref: '#/components/schemas/error400'
        '401':
          description: Unauthorized
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error401'
        '404':
          description: Not Found
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/redemptionNotFound'
        '500':
          description: Internal server error
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
    delete:
      tags:
        - Redemptions
      summary: Delete redemption by ID
      description: >-
        Deletes a specific redemption using the corresponding `redemptionId`
        value.
      operationId: deleteRedemption
      security:
        - AuthorizationToken: []
      parameters:
        - $ref: '#/components/parameters/xFabricTenantId'
        - $ref: '#/components/parameters/xFabricChannelId'
        - $ref: '#/components/parameters/xClientId'
        - $ref: '#/components/parameters/xFabricRequestId'
        - name: redemptionId
          in: path
          description: >-
            The redemption ID generated using the [create
            redemption](/v3/api-reference/offers/redemptions/delete-redemption-by-id)
            endpoint to delete the redemption.
          required: true
          schema:
            type: string
            example: 614b58924e92f6861ac9d43b
      responses:
        '200':
          description: OK
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/deleteRedemptionResponse'
        '400':
          description: Bad request
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/redemptionIdNotValid'
                  - $ref: '#/components/schemas/missingTenantHeader'
                  - $ref: '#/components/schemas/error400'
        '401':
          description: Unauthorized
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error401'
        '404':
          description: Not Found
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/redemptionNotFound'
        '500':
          description: Internal server error
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /redemptions/batch:
    put:
      tags:
        - Redemptions
      summary: Bulk update redemptions
      description: >-
        Use this endpoint to update multiple redemptions by including the
        corresponding `redemptionId` values in the request body. You can update
        up to 25 redemptions at a time.
      operationId: bulkUpdateRedemption
      security:
        - AuthorizationToken: []
      parameters:
        - $ref: '#/components/parameters/xFabricTenantId'
        - $ref: '#/components/parameters/xFabricChannelId'
        - $ref: '#/components/parameters/xClientId'
        - $ref: '#/components/parameters/xFabricRequestId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/batchUpdateRedemptionRequest'
      responses:
        '200':
          description: OK
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/batchUpdateRedemptionResponse'
        '400':
          description: Bad request
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/couponIdNotValid'
                  - $ref: '#/components/schemas/missingTenantHeader'
                  - $ref: '#/components/schemas/error400'
        '401':
          description: Unauthorized
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error401'
        '500':
          description: Internal server error
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
components:
  securitySchemes:
    AuthorizationToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
  schemas:
    missingTenantHeader:
      type: object
      description: Tenant header is missing
      properties:
        type:
          description: The error code.
          type: string
          example: TENANT_HEADER_REQUIRED
        message:
          description: An error message corresponding to the `type`.
          type: string
          example: x-fabric-tenant-id header is required
    error400:
      type: object
      description: Bad request error
      properties:
        type:
          description: The error code.
          type: string
          example: BAD_REQUEST
        message:
          description: An error message corresponding to the `type`.
          type: string
          example: Bad request
    error401:
      type: object
      description: Unauthorized error
      properties:
        type:
          description: The error code.
          type: string
          example: UNAUTHORIZED
        message:
          description: An error message corresponding to the `type`.
          type: string
          example: Invalid credentials
    error500:
      type: object
      description: Internal server error
      properties:
        type:
          description: The error code.
          type: string
          example: INTERNAL_SERVER_ERROR
        message:
          description: An error message corresponding to the `type`.
          type: string
          example: Internal server error
    createdAt:
      type: string
      format: date-time
      description: Record's creation time
      example: 2019-08-20T14:15:22.000Z
    updatedAt:
      type: string
      format: date-time
      description: Record's last updated time
      example: 2019-08-20T14:15:22.000Z
    isDeleted:
      type: boolean
      description: |
        - `true`: Record is deleted.
        - `false`: Record isn't deleted.
      example: false
    cursorQuery:
      type: object
      description: The pagination details.
      properties:
        size:
          description: The maximum number of records per page.
          type: integer
          format: int32
          minimum: 1
          default: 10
          maximum: 100
          example: 10
        nextCursor:
          description: Reference point to start the search for records in the next data set
          type: string
          nullable: true
          maxLength: 1000
          example: H796HJHGANLSADS
    badSizeError:
      type: object
      description: Pagination size error, an invalid value was sent
      properties:
        type:
          description: The error code.
          type: string
          example: REQUEST_VALIDATION
        message:
          description: An error message corresponding to the `type`.
          type: string
          example: Size should be a valid number
    badStartCursorError:
      type: object
      description: Invalid `startCursor` value sent
      properties:
        type:
          description: The error code.
          type: string
          example: REQUEST_VALIDATION
        message:
          description: An error message corresponding to the `type`.
          type: string
          example: Start cursor is invalid
    redemption:
      type: object
      description: Coupon's redemption details
      required:
        - id
        - orderId
        - promotionId
        - createdAt
        - updatedAt
      properties:
        id:
          description: System-generated redemption ID
          type: string
          example: 614b58924e92f6861ac9d43b
        promotionId:
          description: ID of the promotion to which the coupon code belongs
          type: string
          example: 614b58924e92f6861ac91234
        couponCode:
          description: Redeemed coupon code
          type: string
          example: BESTSUMMER
        orderId:
          description: Purchase order ID associated with the redemption
          type: string
          example: 1590-2016-12345
        userId:
          description: ID of the user who redeems the coupon
          type: string
          example: 614b58924e92f61234567890
          nullable: true
        email:
          description: Email address of the user who redeems the coupon
          type: string
          example: guest@example.com
          nullable: true
        storeId:
          description: ID of the store where the coupon is redeemed
          type: string
          example: A-100001
        redeemedAt:
          description: The timestamp in UTC format for when the coupon was redeemed.
          type: string
          format: date-time
          example: 2020-12-14T12:15:43.646Z
        status:
          description: >
            The following are redemption statuses:

            - `ACTIVE`: Represents created redemption records.

            - `INACTIVE`: Represents redemption records that were created but
            became inactive due to order cancellation.
          type: string
          enum:
            - INACTIVE
            - ACTIVE
          example: ACTIVE
        additionalAttributes:
          description: Merchant-specified attributes associated with the redemption
          type: array
          items:
            type: object
            description: Merchant-specified attributes associated with the redemption
            required:
              - name
              - values
            properties:
              name:
                description: >-
                  Merchant-specified attribute `name` associated with the
                  redemption
                type: string
                example: brand
              values:
                oneOf:
                  - type: string
                    description: >-
                      Merchant-specified attribute `value` associated with the
                      redemption
                    example: Nike
                  - type: array
                    description: >-
                      Merchant-specified attribute `values` associated with the
                      redemption.
                    items:
                      type: string
                      description: >-
                        Merchant-specified attribute `value` associated with the
                        redemption.
                      example:
                        - '2'
                        - '3'
        promotionAdditionalAttributes:
          description: >-
            Merchant-specified attributes associated with the related promotion.
            This value is automatically populated according to the attributes of
            the related promotion.
          type: array
          items:
            type: object
            description: >-
              Merchant-specified attributes associated with the related
              promotion.
            required:
              - name
              - values
            properties:
              name:
                description: >-
                  Merchant-specified attribute `name` associated with the
                  related promotion.
                type: string
                example: eventName
              values:
                oneOf:
                  - type: string
                    description: >-
                      Merchant-specified attribute `value` associated with the
                      related promotion.
                    example: Store sale
                  - type: array
                    description: >-
                      Merchant-specified attribute `values` associated with the
                      related promotion.
                    items:
                      type: string
                      description: >-
                        Merchant-specified attribute `value` associated with the
                        related promotion.
                      example:
                        - Holiday
                        - Christmas
        promotionName:
          description: Promotion name by which you want to filter the redemption records
          type: string
          example: Summer promotion
        createdAt:
          description: >-
            The timestamp in UTC format of when the coupon redemption was
            created.
          type: string
          format: date-time
          example: 2020-12-14T12:15:43.646Z
        updatedAt:
          description: >-
            The timestamp in UTC format of when the coupon redemption was last
            updated.
          type: string
          format: date-time
          example: 2021-12-14T12:15:43.646Z
    redemptionRequest:
      type: object
      description: Redemption details
      required:
        - promotionId
        - orderId
      properties:
        promotionId:
          oneOf:
            - type: string
              example: 65031fa9f92c730009b6d4ea
              description: ID of the promotion to which the coupon code belongs
            - type: object
              description: Merchant-specified attributes associated with the promotion
              required:
                - name
                - values
              properties:
                name:
                  type: string
                  example: couponId
                  description: Merchant-specified attribute`name` for the promotion
                values:
                  type: string
                  example: '19822'
                  description: >-
                    Merchant-specified attribute `value` for the `name`
                    associated with the promotion
        couponCode:
          description: Coupon code to be redeemed
          type: string
          example: BESTSUMMER
        orderId:
          description: Purchase order ID associated with the redemption
          type: string
          example: 1590-2016-12345-7897
        userId:
          description: ID of the user who redeems the coupon
          type: string
          example: 614b58924e92f61234567890
          nullable: true
        email:
          description: Email address of the user who redeems the coupon
          type: string
          example: guest@example.com
          nullable: true
        storeId:
          description: ID of the store where the coupon is redeemed
          type: string
          example: A-100001
          nullable: true
        redeemedAt:
          description: The timestamp in UTC format for when the coupon was redeemed.
          type: string
          format: date-time
          example: 2020-12-14T12:15:43.646Z
          nullable: true
        additionalAttributes:
          description: Merchant-specified attributes associated with the redemption
          type: array
          items:
            type: object
            description: Merchant-specified attributes associated with the redemption
            required:
              - name
              - values
            properties:
              name:
                description: >-
                  Merchant-specified attribute `name` associated with the
                  redemption
                type: string
                example: brand
              values:
                oneOf:
                  - type: string
                    description: >-
                      Merchant-specified attribute `value` associated with the
                      redemption
                    example: Nike
                  - type: array
                    description: >-
                      Merchant-specified attribute `values` associated with the
                      redemption
                    items:
                      type: string
                      description: >-
                        Merchant-specified attribute `value` associated with the
                        redemption
                      example:
                        - '2'
                        - '3'
    batchUpdateRedemptionRequest:
      type: object
      description: Redemption details
      required:
        - data
      properties:
        data:
          type: array
          description: Redemptions list
          minItems: 1
          maxItems: 25
          items:
            type: object
            description: Redemption details
            required:
              - promotionId
              - couponCode
            properties:
              id:
                description: >-
                  System-generated redemption ID. If not provided, the update
                  will be applied to the redemption with the matching
                  `promotionId` and `couponCode`.
                type: string
                example: 614b58924e92f6861ac9d43b
              promotionId:
                oneOf:
                  - type: string
                    description: System-generated coupon ID
                    example: 63128d6ccd9ab60009ade8b7
                  - type: object
                    description: >-
                      Merchant-specified additional attributes for the
                      promotion. Each attribute with a `name:values` pair has a
                      unique ID that identifies a specific promotion.
                    required:
                      - name
                      - values
                    properties:
                      name:
                        type: string
                        description: Merchant-specified attribute `name` for the promotion
                        example: couponId
                      values:
                        type: string
                        description: >-
                          Merchant-specified attribute `value` for the `name`
                          associated with the promotion
                        example: 63128d6ccd9ab60009ade8b7
              couponCode:
                description: Coupon code to be redeemed
                type: string
                example: BESTSUMMER
              userId:
                description: ID of the user who redeems the coupon
                type: string
                example: 614b58924e92f61234567890
                nullable: true
              email:
                description: Email address of the user who redeems the coupon
                type: string
                example: guest@gmail.com
                nullable: true
              orderId:
                description: Purchase order ID associated with the redemption
                type: string
                example: 1590-2016-12345-7897
              storeId:
                description: ID of the store where the coupon is redeemed
                type: string
                example: 614b58924e92f61234567890
              redeemedAt:
                description: The timestamp in UTC format for when the coupon was redeemed.
                type: string
                format: date-time
                example: 2020-12-14T12:15:43.646Z
              status:
                description: >
                  The following are redemption statuses:

                  - `ACTIVE`: Represents created redemption records.

                  - `INACTIVE`: Represents redemption records that were created
                  but became inactive due to order cancellation.
                type: string
                enum:
                  - INACTIVE
                  - ACTIVE
                example: ACTIVE
              additionalAttributes:
                description: Merchant-specified attributes associated with the redemption
                type: array
                items:
                  type: object
                  description: Merchant-specified attributes associated with the redemption
                  required:
                    - name
                    - values
                  properties:
                    name:
                      description: >-
                        Merchant-specified attribute `name` associated with the
                        redemption
                      type: string
                      example: brand
                    values:
                      oneOf:
                        - type: string
                          description: >-
                            Merchant-specified attribute `value` associated with
                            the redemption
                          example: Nike
                        - type: array
                          description: >-
                            Merchant-specified attribute `values` associated
                            with the redemption
                          items:
                            type: string
                            description: >-
                              Merchant-specified attribute `value` associated
                              with the redemption
                            example:
                              - '2'
                              - '3'
    batchUpdateRedemptionResponse:
      type: object
      description: Updated redemption details
      required:
        - data
        - errors
      properties:
        data:
          type: array
          description: Array of updated redemption details
          items:
            $ref: '#/components/schemas/redemption'
        errors:
          type: array
          description: Array of errors
          items:
            $ref: '#/components/schemas/batchRedemptionError'
    getRedemptionsResponse:
      type: object
      description: Redemption information
      properties:
        query:
          $ref: '#/components/schemas/cursorQuery'
        data:
          type: array
          description: Redemptions list
          items:
            $ref: '#/components/schemas/redemption'
    createRedemptionRequest:
      $ref: '#/components/schemas/redemptionRequest'
    createRedemptionResponse:
      $ref: '#/components/schemas/redemption'
    updateRedemptionRequest:
      allOf:
        - $ref: '#/components/schemas/redemptionRequest'
        - type: object
          properties:
            status:
              description: >
                The following are redemption statuses:

                - `ACTIVE`: Represents created redemption records.

                - `INACTIVE`: Represents redemption records that were created
                but became inactive due to order cancellation.
              type: string
              enum:
                - INACTIVE
                - ACTIVE
              example: ACTIVE
    updateRedemptionResponse:
      $ref: '#/components/schemas/redemption'
    getRedemptionResponse:
      $ref: '#/components/schemas/redemption'
    deleteRedemptionResponse:
      type: object
      description: Deleted redemption
      required:
        - id
        - isDeleted
      properties:
        id:
          description: Redemption ID
          type: string
          example: 614b58924e92f6861ac9d43b
        isDeleted:
          description: |
            - `true`: Redemption is deleted.
            - `false`: Redemption isn't deleted.
          type: boolean
          example: true
    redemptionDeprecated:
      type: object
      description: Coupon's redemption details
      required:
        - id
        - couponCode
        - orderId
        - couponId
      properties:
        id:
          description: A 24-character system-generated redemption ID.
          type: string
          example: 614b58924e92f6861ac9d43b
        couponId:
          description: >-
            A 24-character system-generated coupon ID generated using the
            [create coupon](/v3/api-reference/offers/coupons/create-coupon)
            endpoint.
          type: string
          example: 614b58924e92f6861ac91234
        couponCode:
          description: Coupon code to redeem
          type: string
          example: BESTSUMMER
        orderId:
          description: Purchase order ID associated with the coupon redemption
          type: string
          example: 1590-2016-12345
        userId:
          description: ID of the user who redeems the coupon
          type: string
          example: 614b58924e92f61234567890
        email:
          description: Email address of the user who redeems the coupon
          type: string
          example: guest@example.com
          nullable: true
        createdAt:
          description: >-
            The timestamp in UTC format of when the coupon redemption was
            created.
          type: string
          format: date-time
          example: 2020-12-14T12:15:43.646Z
        updatedAt:
          description: >-
            The timestamp in UTC format of when the coupon redemption was last
            updated.
          type: string
          format: date-time
          example: 2021-12-14T12:15:43.646Z
    redemptionRequestDeprecated:
      type: object
      description: Coupon redemption details
      required:
        - orderId
        - couponCode
      properties:
        couponCode:
          description: Coupon code to be redeemed
          type: string
          example: BESTSUMMER
        orderId:
          description: Purchase order ID associated with the coupon redemption
          type: string
          example: 1590-2016-12345-7897
        userId:
          description: ID of the user who redeems the coupon
          type: string
          example: 614b58924e92f61234567890
          nullable: true
        email:
          description: Email address of the user who redeems the coupon
          type: string
          example: guest@example.com
          nullable: true
    createRedemptionRequestDeprecated:
      $ref: '#/components/schemas/redemptionRequestDeprecated'
    createRedemptionResponseDeprecated:
      $ref: '#/components/schemas/redemptionDeprecated'
    couponIdNotValid:
      type: object
      description: Invalid coupon ID
      properties:
        type:
          description: The error code.
          type: string
          example: COUPON_ID_NOT_VALID
        message:
          description: An error message corresponding to the `type`.
          type: string
          example: Coupon ID isn't valid, it must be a valid Object ID
    promotionIdNotValid:
      type: object
      description: Invalid promotion ID
      properties:
        type:
          description: The error code.
          type: string
          example: PROMOTION_ID_NOT_VALID
        message:
          description: An error message corresponding to the `type`.
          type: string
          example: Promotion ID isn't valid, it must be a valid Object ID
    redemptionIdNotValid:
      type: object
      description: Invalid redemption ID
      properties:
        type:
          description: The error code.
          type: string
          example: REDEMPTION_ID_NOT_VALID
        message:
          description: An error message corresponding to the `type`
          type: string
          example: Redemption ID isn't valid, it needs must be a valid Object ID
    redemptionNotFound:
      type: object
      description: Redemption not found
      properties:
        type:
          description: The error code.
          type: string
          example: REDEMPTION_NOT_FOUND
        message:
          description: An error message corresponding to the `type`.
          type: string
          example: The redemption record doesn't exist.
    batchRedemptionError:
      type: object
      description: Redemption error
      properties:
        id:
          description: Redemption ID
          type: string
          example: 614b58924e92f6861ac9d43b
        type:
          description: The error code.
          type: string
          example: REDEMPTION_NOT_FOUND
        message:
          description: An message corresponding to the `type`.
          type: string
          example: The redemption record doesn't exist.
  parameters:
    xFabricTenantId:
      in: header
      name: x-fabric-tenant-id
      schema:
        type: string
        minLength: 24
        maxLength: 24
      required: true
      example: 5f328bf0b5f328bf0b5f328b
      description: >-
        A header used by fabric to identify the tenant making the request. You
        must include tenant id in the authentication header for an API request
        to access any of fabric’s endpoints. You can retrieve the tenant id ,
        which is also called account id, from
        [Copilot](/v3/platform/settings/account-details/getting-the-account-id).
        This header is required.
    xFabricChannelId:
      in: header
      name: x-fabric-channel-id
      schema:
        type: string
        example: '12'
      description: >-
        x-fabric-channel-id identifies the sales channel where the API request
        is being made; primarily for multichannel use cases. The channel ids are
        12 corresponding to US and 13 corresponding to Canada. The default
        channel id is 12. This field is required.
    xClientId:
      in: header
      name: x-client-id
      schema:
        type: string
      required: false
      example: copilot
      description: >-
        A unique identifier obtained from
        [Copilot](/v3/platform/settings/api-apps/getting-system-app-credentials)
        for the System app in the fabric ecosystem, essential for OpenID Connect
        authentication flows.
    xFabricRequestId:
      in: header
      name: x-fabric-request-id
      description: A unique request ID.
      required: false
      schema:
        type: string
        example: 263e731c-45c8-11ed-b878-0242ac120002
    queryParameterSize:
      name: size
      in: query
      description: The maximum number of records per page.
      required: false
      schema:
        type: integer
        format: int32
        minimum: 1
        default: 10
        maximum: 100
    queryParameterStartCursor:
      name: startCursor
      in: query
      description: >-
        Specifies the record from which the search will start, effectively
        skipping all records before this point.
      required: false
      schema:
        type: string
        maxLength: 1000
        example: H796HJHGANLSADS
  headers:
    xFabricRequestIdResponse:
      description: Unique request ID
      schema:
        type: string
        example: 263e731c-45c8-11ed-b878-0242ac120002
