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

# Create redemption

> Creates a redemption for a specific promotion using the corresponding `promotionId` value in the request body.



## OpenAPI

````yaml redemptions.openapi post /redemptions
openapi: 3.0.0
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
servers:
  - url: https://api.fabric.inc/v3
    description: Production environment
security: []
externalDocs:
  description: Find out more about Offers
  url: https://developer.fabric.inc/docs/offers-overview
paths:
  /redemptions:
    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
      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'
      security:
        - AuthorizationToken: []
components:
  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
  schemas:
    createRedemptionRequest:
      $ref: '#/components/schemas/redemptionRequest'
    createRedemptionResponse:
      $ref: '#/components/schemas/redemption'
    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
    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
    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'
    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'
  headers:
    xFabricRequestIdResponse:
      description: Unique request ID
      schema:
        type: string
        example: 263e731c-45c8-11ed-b878-0242ac120002
  securitySchemes:
    AuthorizationToken:
      type: http
      scheme: bearer
      bearerFormat: JWT

````