Elastic Path Promotion Codes API

You can apply promotions automatically to all customer carts, or you can create promotion codes that customers must enter to receive the discount. You can enable this feature by setting the automatic attribute to `false` in the promotions schema when you create a promotion. For more information, see [Create Promotion Codes](/docs/api/promotions/create-promotion-codes). You can generate and export codes for a promotion using the bulk code generation feature, which allows you to create a large number of unique codes and export them in CSV format. For details, refer to the [Generating Bulk Codes](/docs/commerce-manager/promotions-standard/overview#generating-bulk-codes) and [Managing Export Codes](/docs/commerce-manager/promotions-standard/overview#managing-code-export) sections. You can generate a maximum of 1000 codes for a promotion. If you need to generate more than 1000 codes, limit the promotion's duration to a maximum of 365 days from its start date. The promotion expiry date is 365 days. With the consume unit feature, you can limit the number of usages of a code for a promotion. You must create a code for this promotion to track the usage of the promotion. The consume unit options are `per_cart` and `per_item`. For example, consider a store that offers 50% off on *SKU1*, but limits the promotion to a maximum of two usages. Under the `per_cart` setting, a shopper can buy *SKU1* twice in a separate transaction, each at a 50% discount. However, with the `per_item` setting, if a shopper buys two SKU1s in a single purchase, both items count toward the promotion's usage limit. Therefore, the shopper would use up both usages of the promotion in a single purchase. Promotion codes can be group codes or individual codes. For example, you can offer a seasonal discount to all customers, such as *SUMMER-SALE*, or you can offer preferred customers unique discount codes. Promotion codes expire automatically at the end of the promotion period and are removed from the promotion. When a promotion expires, the promotion codes attached to the promotion automatically become invalid. However, when you re-enable the expired promotion, the promotion codes attached to the promotion are deleted. When you checkout a cart with an expired promotion, the expired promotion will be automatically removed from a cart and the checkout process is initiated. As a best practice, we recommend to update your cart to remove the expired promotion before initiating the checkout process. When extending the end date of an expired promotion with over 1000 codes, you will receive an error response. See [Update a Promotion](/docs/api/promotions/update-a-promotion). In such cases, we recommend [duplicating the promotion](/docs/commerce-manager/promotions-standard/overview#duplicating-promotions), allowing you to set the new end dates and create promotion codes as needed.

OpenAPI Specification

elastic-path-promotion-codes-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  version: 25.1126.6886238
  x-version-timestamp: 2025-11-26 19:10:23+00:00
  title: Addresses Introduction Account Addresses Promotion Codes API
  description: 'The Addresses API allows you to organize account addresses. Addresses are a sub-resource of `account` resources, an account can have multiple addresses, such as home, work, and neighbour.


    You can use an account address with either [client_credentials access token](/docs/api/authentication/create-an-access-token) or a combination of [implicit access token](/docs/api/authentication/create-an-access-token) and [Account Management authentication](/docs/api/accounts/post-v-2-account-members-tokens) token.

    '
  contact:
    name: Elastic Path
    url: https://www.elasticpath.com
    email: support@elasticpath.com
  license:
    url: https://elasticpath.dev
    name: MIT
servers:
- url: https://useast.api.elasticpath.com
  description: US East
- url: https://euwest.api.elasticpath.com
  description: EU West
security:
- BearerToken: []
tags:
- name: Promotion Codes
  description: 'You can apply promotions automatically to all customer carts, or you can create promotion codes that customers must enter to receive the discount. You can enable this feature by setting the automatic attribute to `false` in the promotions schema when you create a promotion. For more information, see [Create Promotion Codes](/docs/api/promotions/create-promotion-codes).


    You can generate and export codes for a promotion using the bulk code generation feature, which allows you to create a large number of unique codes and export them in CSV format. For details, refer to the [Generating Bulk Codes](/docs/commerce-manager/promotions-standard/overview#generating-bulk-codes) and [Managing Export Codes](/docs/commerce-manager/promotions-standard/overview#managing-code-export) sections.


    You can generate a maximum of 1000 codes for a promotion. If you need to generate more than 1000 codes, limit the promotion''s duration to a maximum of 365 days from its start date. The promotion expiry date is 365 days.


    With the consume unit feature, you can limit the number of usages of a code for a promotion. You must create a code for this promotion to track the usage of the promotion. The consume unit options are `per_cart` and `per_item`. For example, consider a store that offers 50% off on *SKU1*, but limits the promotion to a maximum of two usages. Under the `per_cart` setting, a shopper can buy *SKU1* twice in a separate transaction, each at a 50% discount. However, with the `per_item` setting, if a shopper buys two SKU1s in a single purchase, both items count toward the promotion''s usage limit. Therefore, the shopper would use up both usages of the promotion in a single purchase.


    Promotion codes can be group codes or individual codes. For example, you can offer a seasonal discount to all customers, such as *SUMMER-SALE*, or you can offer preferred customers unique discount codes. Promotion codes expire automatically at the end of the promotion period and are removed from the promotion.


    When a promotion expires, the promotion codes attached to the promotion automatically become invalid. However, when you re-enable the expired promotion, the promotion codes attached to the promotion are deleted.


    When you checkout a cart with an expired promotion, the expired promotion will be automatically removed from a cart and the checkout process is initiated. As a best practice, we recommend to update your cart to remove the expired promotion before initiating the checkout process.


    When extending the end date of an expired promotion with over 1000 codes, you will receive an error response. See [Update a Promotion](/docs/api/promotions/update-a-promotion). In such cases, we recommend [duplicating the promotion](/docs/commerce-manager/promotions-standard/overview#duplicating-promotions), allowing you to set the new end dates and create promotion codes as needed.

    '
paths:
  /v2/promotions/{promotionID}/codes:
    parameters:
    - $ref: '#/components/parameters/Authorization'
    get:
      tags:
      - Promotion Codes
      summary: Get Promotion Codes
      description: "You can use this endpoint to retrieve promotion codes. \n\n:::note\n- The `codes.max_uses` attribute represents the maximum usage of the codes. \n- The `codes.uses` attribute represents the remaining number of times the codes can be used for the promotion.\n- Codes created before April 27, 2023 will only have `codes.uses` attribute in the response body.\n:::\n"
      operationId: getPromotionCodes
      parameters:
      - name: promotionID
        in: path
        description: The unique identifier of the promotion.
        required: true
        style: simple
        schema:
          type: string
      - name: filter
        in: query
        schema:
          type: string
        description: 'This parameter accepts a filtering expression that uses specific operators and attributes. Promotion codes are case-insensitive.


          The following operators and attributes are available when filtering on this endpoint. See [Supported Filtering Characters](/guides/Getting-Started/filtering#supported-characters).


          | Attribute | Type     | Operator    | Example        |

          |:--------- |:---------|:------------|:---------------|

          | `code`    | `string`, `number` |  `eq`, `gt`       |  `eq(code,summer2024)`, `gt(code,2024)` |

          '
      responses:
        '200':
          description: ''
          headers: {}
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Response.Data'
                - properties:
                    data:
                      type: array
                      items:
                        $ref: '#/components/schemas/Data.PromotionsCodesObject'
                    links:
                      $ref: '#/components/schemas/Response.PageLinks'
                    meta:
                      $ref: '#/components/schemas/Response.Meta.Promotions'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response.Error'
              example:
              - errors:
                - status: 401
                  title: Unauthorized
      deprecated: false
    post:
      tags:
      - Promotion Codes
      summary: Create Promotion Codes
      description: 'Use this endpoint to create promotion codes for a specific promotion.


        :::note


        When a promotion expires, the promotion codes attached to the promotion automatically become invalid. However, when you re-enable the expired promotion, the promotion codes attached to the promotion are deleted.


        :::

        '
      operationId: createPromotionCodes
      parameters:
      - name: promotionID
        in: path
        description: The unique identifier of the promotion.
        required: true
        style: simple
        schema:
          type: string
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              allOf:
              - $ref: '#/components/schemas/Data.PromotionsCodesRequest'
      responses:
        '201':
          description: ''
          headers: {}
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Response.Data'
                - properties:
                    data:
                      type: object
                      $ref: '#/components/schemas/Data.PromotionObject'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response.Error'
              example:
              - errors:
                - status: 401
                  title: Unauthorized
      deprecated: false
    delete:
      tags:
      - Promotion Codes
      summary: Delete Multiple Promotion Codes
      description: Use this endpoint to delete multiple promotion codes within a specific promotion.
      operationId: deleteMultiplePromotionCodes
      parameters:
      - name: promotionID
        in: path
        description: The ID of the promotion associated with the codes.
        required: true
        style: simple
        schema:
          type: string
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response.Error'
              example:
              - errors:
                - status: 401
                  title: Unauthorized
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response.Error'
              example:
              - errors:
                - detail: promotion not found
                  status: 404
                  title: Not Found
      deprecated: false
  /v2/promotions/{promotionID}/codes/{code}:
    parameters:
    - $ref: '#/components/parameters/Authorization'
    delete:
      tags:
      - Promotion Codes
      summary: Delete a Promotion Code
      description: Use this endpoint to delete a single promotion code.
      operationId: deleteAPromotionCode
      parameters:
      - name: promotionID
        in: path
        description: Specifies the unique identifier of the promotion associated with the codes.
        required: true
        style: simple
        schema:
          type: string
      - name: code
        in: path
        description: Specifies the code that you want to delete.
        required: true
        style: simple
        schema:
          type: string
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response.Error'
              example:
              - errors:
                - status: 401
                  title: Unauthorized
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response.Error'
              example:
              - errors:
                - detail: promotion not found
                  status: 404
                  title: Not Found
      deprecated: false
components:
  schemas:
    Data.AttributeObject:
      title: Data.AttributeObject
      type: object
      properties:
        attribute:
          type: object
          properties:
            template:
              description: Specifies the name of the template slug to be excluded from a promotion.
              type: string
              examples:
              - products(shoes)
            field:
              description: Specifies the unique slug identifier for the field excluded from a promotion.
              type: string
              examples:
              - brand
            type:
              description: Specifies the type of the field, such as `string`, `integer`, `boolean`, `float`, or `date`.
              type: string
              examples:
              - string
            value:
              description: Specifies the value of the field that was specified in the `attributes.field`. For example, you can specify any color in the value if you indicate color in the `attributes.field`.
              type: string
              examples:
              - adidas
    Data.FixedBundleDiscountPromotion:
      title: Data.FixedBundleDiscountPromotion
      allOf:
      - $ref: '#/components/schemas/Data.BasePromotions'
      - type: object
        properties:
          schema:
            allOf:
            - $ref: '#/components/schemas/Data.Promotions.Schema.TargetCatalogs'
            - $ref: '#/components/schemas/Data.Promotions.Schema.AmountAndCurrencyArray'
            - $ref: '#/components/schemas/Data.Promotions.Schema.Requirements'
    Data.XForAmountDiscountPromotion:
      title: Data.XForAmountDiscountPromotion
      allOf:
      - $ref: '#/components/schemas/Data.BasePromotions'
      - type: object
        properties:
          schema:
            allOf:
            - $ref: '#/components/schemas/Data.Promotions.Schema.TargetCatalogs'
            - $ref: '#/components/schemas/Data.Promotions.Schema.Targets'
            - $ref: '#/components/schemas/Data.Promotions.Schema.TargetNodes'
            - $ref: '#/components/schemas/Data.Promotions.Schema.AmountAndCurrencyArray'
            - $ref: '#/components/schemas/Data.Promotions.Schema.Exclude'
            - $ref: '#/components/schemas/Data.Promotions.Schema.XValue'
    Data.Promotions.Schema.Gifts:
      title: Data.Promotions.Schema.Gifts
      type: object
      required:
      - gifts
      properties:
        gifts:
          description: Specifies all the gift items that a shopper can avail when they qualify for the promotion. The gift quantity applies to each specified item. For example, if the promotion includes `giftA` and `giftB`, shopper can avail both the gifts if the cart qualifies for the gift promotion. If the cart qualifies for two gift promotions, the shopper can use two `giftA` and two `giftB`.
          type: array
          items:
            type: string
        auto_add_free_gift:
          description: When set to `true`, free gift items are automatically added to the shopping cart for all the eligible products. Default is `false`.
          type: boolean
    Data.Promotions.Schema.TargetNodes:
      title: Data.Promotions.Schema.TargetNodes
      type: object
      properties:
        target_nodes:
          description: Specifies the unique identifiers of the nodes to be applied for the promotion in addition to the product SKUs applied in targets. You can also define `schema.target_nodes` without defining the `schema.targets` if the promotion is intended for a certain node. You cannot define "targets":"all" and `schema.target_nodes` within the same schema. This will result in a validation error.
          type: array
          items:
            type: string
            examples:
            - ff7d62d4-740c-43ac-97cd-a7b0c32221c2
    Data.Promotions.Schema.YValue:
      title: Data.Promotions.Schema.YValue
      type: object
      required:
      - y
      properties:
        y:
          description: Specifies the Y value for the promotion.
          type: integer
    Data.Promotions.Schema.PercentageAndCurrencyArray:
      title: Data.Promotions.Schema.PercentageAndCurrencyArray
      type: object
      required:
      - currencies
      properties:
        currencies:
          type: array
          items:
            $ref: '#/components/schemas/Data.Promotions.Schema.Currencies.PercentageAndCurrency'
    Data.Promotions.Schema.Currencies.AmountAndCurrency:
      title: Data.Promotions.Schema.Currencies.AmountAndCurrency
      type: object
      required:
      - amount
      - currency
      properties:
        amount:
          description: Specifies the fixed discount amount to be applied to the cart. For example, $10 off the total amount in the cart.
          type: integer
        currency:
          description: Specifies a three-letter currency code. For example, USD.
          type: string
    Data.ItemPercentDiscountPromotion:
      title: Data.ItemPercentDiscountPromotion
      allOf:
      - $ref: '#/components/schemas/Data.BasePromotions'
      - type: object
        properties:
          schema:
            allOf:
            - $ref: '#/components/schemas/Data.Promotions.Schema.TargetCatalogs'
            - $ref: '#/components/schemas/Data.Promotions.Schema.Targets'
            - $ref: '#/components/schemas/Data.Promotions.Schema.TargetNodes'
            - $ref: '#/components/schemas/Data.Promotions.Schema.TargetAttributes'
            - $ref: '#/components/schemas/Data.Promotions.Schema.Exclude'
            - $ref: '#/components/schemas/Data.Promotions.Schema.Percent'
    Data.Promotions.Schema.XValue:
      title: Data.Promotions.Schema.XValue
      type: object
      required:
      - x
      properties:
        x:
          description: Specifies the X value for the promotion.
          type: integer
    Response.PaginationPage:
      type: object
      properties:
        current:
          description: The current page.
          type: integer
        limit:
          description: The maximum number of records per page for this response. You can set this value up to 100.
          type: integer
        offset:
          description: The current offset by number of records, not pages. Offset is zero-based.
          type: integer
        total:
          description: The total page count.
          type: integer
    Data.ItemFixedDiscountPromotion:
      title: Data.ItemFixedDiscountPromotion
      allOf:
      - $ref: '#/components/schemas/Data.BasePromotions'
      - type: object
        properties:
          schema:
            allOf:
            - $ref: '#/components/schemas/Data.Promotions.Schema.TargetCatalogs'
            - $ref: '#/components/schemas/Data.Promotions.Schema.Targets'
            - $ref: '#/components/schemas/Data.Promotions.Schema.TargetNodes'
            - $ref: '#/components/schemas/Data.Promotions.Schema.TargetAttributes'
            - $ref: '#/components/schemas/Data.Promotions.Schema.AmountAndCurrencyArray'
            - $ref: '#/components/schemas/Data.Promotions.Schema.Exclude'
    Data.Promotions.Schema.Requirement:
      title: Data.Promotions.Schema.Requirement
      type: object
      required:
      - targets
      - quantity
      properties:
        targets:
          description: Specifies an array of required product SKUs or IDs for the bundle discount promotion.
          type: array
          items:
            type: string
        quantity:
          description: Specifies the quantities of products to be applied for the promotion.
          type: integer
    Data.FreeGiftPromotion:
      title: Data.FreeGiftPromotion
      allOf:
      - $ref: '#/components/schemas/Data.BasePromotions'
      - type: object
        properties:
          schema:
            allOf:
            - $ref: '#/components/schemas/Data.Promotions.Schema.TargetCatalogs'
            - $ref: '#/components/schemas/Data.Promotions.Schema.Requirements'
            - $ref: '#/components/schemas/Data.Promotions.Schema.Gifts'
    Data.Promotions.Schema.AmountAndCurrencyArray:
      title: Data.Promotions.Schema.AmountAndCurrencyArray
      type: object
      required:
      - currencies
      properties:
        currencies:
          type: array
          items:
            $ref: '#/components/schemas/Data.Promotions.Schema.Currencies.AmountAndCurrency'
    Data.Promotions.Schema.Currencies.PercentageAndCurrency:
      title: Data.Promotions.Schema.Currencies.PercentageAndCurrency
      type: object
      required:
      - percentage
      - currency
      properties:
        percentage:
          description: Specifies the discount percentage of the cart total value. For example, 10 represents 10% discount of the cart value of $100. You can add up to six decimal places for the discount percentage to be applied for the promotion.
          type: number
        currency:
          description: Specifies a three-letter currency code. For example, USD.
          type: string
    Response.Error:
      type: array
      properties:
        detail:
          type: string
        status:
          type: string
        title:
          type: string
    Data.CodeRequest:
      title: Data.CodeRequest
      type: object
      properties:
        code:
          description: Specifies the string to use as a code for the promotion.
          type: string
          examples:
          - ZXY_CBA
        consume_unit:
          description: Specifies whether the code is applied to a line item or cart. The options are `per_item` or `per_cart`. The default setting is per_cart, which is applied at cart level. The `per_item` setting specifies how many times a buyer can use a promotion code on promotion items in a cart. For example, in a store that offers 50% off on SKU1, but limits the maximum usage of the promotion code to two, buyer can apply the promotion to SKU1 up to 2 times if cart has two quantities of SKU1. The third SKU1 is sold for regular price. The code usage is applied at checkout. You must set the automatic setting to `false` and create a code for this promotion to work.
          type: string
          examples:
          - per_item
        user:
          description: Specifies the users who can use the code. You can use the customer object ID or an array of customer object IDs. For more information, see the [Create a customer](/docs/customer-management/customer-management-api/create-a-customer) section. Additionally, you could pass any identifying string to the promotions service that identifies a user.
          type: string
          examples:
          - '{customerID}'
        uses:
          description: Specifies the maximum number of times the code can be used. If no value is set, the shopper can use the code any number of times.
          type: number
          examples:
          - 10
    Data.BasePromotions:
      title: Data.Promotions
      type: object
      required:
      - type
      - id
      - name
      - description
      - automatic
      - enabled
      - promotion_type
      - schema
      - start
      - end
      properties:
        type:
          description: Specifies the type of the resource. The type of resource for promotions is `promotion`.
          type: string
          const: promotion
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          description: Specifies a name for the promotion.
          type: string
          examples:
          - Buy SKU1 and SKU2 to get free gift
        description:
          description: Specifies a description for the promotion.
          type: string
          examples:
          - SKU1 and SKU2 for free gift
        promotion_type:
          description: Specifies the type of the promotion.
          type: string
          enum:
          - fixed_discount
          - percent_discount
          - item_fixed_discount
          - item_percent_discount
          - x_for_y
          - x_for_amount
          - bundle_fixed_discount
          - bundle_gift
        enabled:
          description: Specifies whether the promotion is enabled. The options are `true` or `false`, and the default setting is `false`.
          type: boolean
          examples:
          - true
        automatic:
          description: Specifies whether the promotion is applied automatically to the cart or a code is required to apply the promotion. The default setting is to `false`. When this value is set to `true`, a code is autogenerated. If this value is set to `false`, you must create the code manually. For more information about creating codes, see the Create Promotion Codes section.
          type: boolean
          examples:
          - true
        start:
          description: Specifies the start date and time of the promotion or the start date of the promotion. You can provide a specific time in the HH:MM format.
          type: string
          examples:
          - 2020-01-01
        end:
          description: Specifies the end date and time of the promotion or the end date of the promotion.
          type: string
          examples:
          - 2100-01-01
        min_cart_value:
          description: Specifies an array of currency-value objects, `min_cart_value[].currency` and `min_cart_value[].amount`, that provides the minimum cart value required for the promotion to apply. You can add one or several value specifications in different currencies. Do not use `max_discount_value` for Cart Fixed Discount promotion and Item Fixed Discount promotion. If `max_discount_value` is greater than the `fixed_discount` value, the `fixed_discount` value is applied; otherwise the `max_discount value` is applied.
          type: object
          examples:
          - amount: 1000
            currency: USD
        max_applications_per_cart:
          description: Specifies the maximum number of application of a promotion per cart.
          type: number
          examples:
          - 0
    Data.Promotions.Schema.Exclude:
      title: Data.Promotions.Schema.Exclude
      type: object
      properties:
        conditions:
          type: object
          $ref: '#/components/schemas/Data.Conditions'
    Data.NodesObject:
      title: Data.NodesObject
      type: object
      properties:
        node:
          type: object
          properties:
            values:
              description: Specifies unique identifiers of the nodes to be excluded from the promotion.
              type: array
              items:
                type: string
                description: node or hierarchy ids
                examples:
                - 19650d2e-7e9d-496a-8658-5107dd8ad803
                - fe0cff14-1b7e-4abf-88db-cd0fd6a3ec5b
    Data.Promotions.Schema.Percent:
      title: Data.Promotions.Schema.Percent
      type: object
      required:
      - percent
      properties:
        percent:
          description: Specifies the discount percentage to be applied to the targeted SKU price. For example, 10% discount on a product SKU priced at $100. You can specify the discount percentage with up to six decimal places.
          type: integer
    Data.PromotionsCodesRequest:
      title: Data.PromotionsCodesRequest
      type: object
      properties:
        codes:
          type: array
          items:
            $ref: '#/components/schemas/Data.CodeRequest'
          description: ''
        type:
          description: Specifies the type of the resource. The type of resource for promotions is `promotion_codes`.
          type: string
          examples:
          - promotion_codes
    Response.Meta.Promotions:
      title: Response.Meta.Promotions
      type: object
      properties:
        page:
          $ref: '#/components/schemas/Response.PaginationPage'
        results:
          $ref: '#/components/schemas/Response.PaginationResults'
    Data.CartPercentDiscountPromotion:
      title: Data.CartPercentDiscountPromotion
      allOf:
      - $ref: '#/components/schemas/Data.BasePromotions'
      - type: object
        properties:
          schema:
            allOf:
            - $ref: '#/components/schemas/Data.Promotions.Schema.TargetCatalogs'
            - $ref: '#/components/schemas/Data.Promotions.Schema.PercentageAndCurrencyArray'
            - $ref: '#/components/schemas/Data.Promotions.Schema.Exclude'
    Data.PromotionsCodesObject:
      title: Data.PromotionsCodesObject
      type: object
      properties:
        data:
          $ref: '#/components/schemas/Data.PromotionsCodes'
    Data.PromotionsCodes:
      title: Data.PromotionsCodes
      type: object
      properties:
        codes:
          type: array
          items:
            $ref: '#/components/schemas/Data.CodeResponse'
          description: ''
    Data.CartFixedDiscountPromotion:
      title: Data.CartFixedDiscountPromotion
      allOf:
      - $ref: '#/components/schemas/Data.BasePromotions'
      - type: object
        properties:
          schema:
            allOf:
            - $ref: '#/components/schemas/Data.Promotions.Schema.TargetCatalogs'
            - $ref: '#/components/schemas/Data.Promotions.Schema.AmountAndCurrencyArray'
            - $ref: '#/components/schemas/Data.Promotions.Schema.Exclude'
    Data.Promotions.Schema.TargetAttributes:
      title: Data.Promotions.Schema.TargetAttributes
      type: object
      properties:
        target_attributes:
          type: array
          items:
            type: object
            properties:
              template:
                description: Specifies the name of the template slug to be included in a promotion.
                type: string
                examples:
                - products(shoes)
              field:
                description: Specifies the unique slug identifier for the field to be included in a promotion.
                type: string
                examples:
                - brand
              type:
                description: Specifies the type of the field, such as `string`, `integer`, `boolean`, `float`, or `date`.
                type: string
                examples:
                - string
              value:
                description: Specifies the value of the field that was specified in the `attributes.type`. For example, you can specify any color in the value if you indicate color in the `attributes.field`.
                type: string
                examples:
                - adidas
    Response.PaginationResults:
      type: object
      properties:
        total:
          description: The total number of results.
          type: integer
    Response.Data:
      description: Specifies the type of the resource. The type of resource for promotions is, `promotion_codes`.
      type: object
      properties:
        data: {}
    Data.Promotions.Schema.Requirements:
      title: Data.Promotions.Schema.Requirements
      type: object
      required:
      - requirements
      properties:
        requirements:
          type: array
          items:
            $ref: '#/components/schemas/Data.Promotions.Schema.Requirement'
    Response.PageLinks:
      type: object
      properties:
        current:
          description: Always the current page.
          type: string
        first:
          description: Always the first page.
          type: string
        last:
          description: If there is only one page, it returns `null`.
          type: string
        next:
          description: If there is only one page, it returns `null`.
          type: string
        prev:
          description: If the user is on the first page, it returns `null`.
          type: string
    Data.Conditions:
      title: Data.Conditions
      type: object
      properties:
        or:
          type: array
          items:
            type: object
            properties:
              and:
                type: array
                items:
                  oneOf:
                  - $ref: '#/components/schemas/Data.AttributeObject'
                  - $ref: '#/components/schemas/Data.NodesObject'
    Data.Promotions.Schema.TargetCatalogs:
      title: Data.Promotions.Schema.TargetCatalogs
      type: object
      properties:
        target_catalogs:
          description: Specifies the unique identifiers of the catalogs to be applied for this promotion. If you do not set this parameter, promotion will be applied to all catalogs.
          type: array
          items:
            type: string
            examples:
            - baff37e6-1c9b-449d-852c-80ec4d0e39c6
    Data.XForYDiscountPromotion:
      title: Data.XForYDiscountPromotion
      allOf:
      - $ref: '#/components/schemas/Data.BasePromotions'
      - type: object
        properties:
          schema:
            allOf:
            - $ref: '#/components/schemas/Data.Promotions.Schema.TargetCatalogs'
            - $ref: '#/components/schemas/Data.Promotions.Schema.Targets'
            - $ref: '#/components/schemas/Data.Promotions.Schema.TargetNodes'
            - $ref: '#/components/schemas/Data.Promotions.Schema.TargetAttributes'
            - $ref: '#/components/schemas/Data.Promotions.Schema.Exclude'
            - $ref: '#/components/schemas/Data.Promotions.Schema.XValue'
            - $ref: '#/components/schemas/Data.Promotions.Schema.YValue'
    Data.Promotions.Schema.Targets:
      title: Data.Promotions.Schema.Targets
      type: object
      properties:
        targets:
          description: Specifies the product SKUs or unique identifiers of the products included in the promotion. Set "targets:all" if you want to apply the promotion to all SKUs. Leaving this field empty might cause errors. You need to define `schema.targets`, `schema.target_nodes` or `schema.target_attributes`, or all three of them to qualify for this promotion.
          type: array
          items:
            type: string
          examples:
          - sku1
    Data.PromotionObject:
      type: object
      oneOf:
      - $ref: '#/components/schemas/Data.CartFixedDiscountPromotion'
      - $ref: '#/components/schemas

# --- truncated at 32 KB (35 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/elastic-path/refs/heads/main/openapi/elastic-path-promotion-codes-api-openapi.yml