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.

Operations 4

GET /v2/promotions/{promotionID}/codes Get Promotion Codes #
POST /v2/promotions/{promotionID}/codes Create Promotion Codes #
DELETE /v2/promotions/{promotionID}/codes Delete Multiple Promotion Codes #
DELETE /v2/promotions/{promotionID}/codes/{code} Delete a Promotion Code #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/elastic-path-promotion-codes-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

elastic-path-promotion-codes-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Promotions Standard Introduction Promotion Codes API
  description: "Promotions Standard offer the flexibility to provide different types of discounts to all your customers or specific customers. You can apply promotions automatically to all purchases, or alternatively, create promotion codes that customers must enter to receive a discount.\n\nYou can have multiple promotions active at the same time. Promotions are active in a fixed duration, with defined start and end dates. However, you can manually stop a promotion at any time.\n\nFor testing your promotions when scheduling a future date for your shopping cart, you can use the [Preview Cart API](/docs/api/carts/create-a-cart#preview-cart).\n\nWhen [Creating a Free Gift Promotion](/docs/api/promotions/create-a-promotion), set the promotion to automatic and enable the `auto_add_free_gift` feature. This way, the shopper will see the free gift in their shopping cart when the target product is added to the cart, and the discount will be applied. This eliminates the need for an additional step to apply the code for the gift discount. However, if you desire more control over when or how the free gift is added, you can choose to use a promotion code and disable the **Automatically add free gift items to the cart** toggle in Commerce Manager. See [Creating Free Gift Promotions](/docs/commerce-manager/promotions-standard/item-level-promotions/free-gift-promotions). For a seamless process, ensure that the currencies of automatically added gift items match with those of the items that initiate free gifts. Additionally, ensure that the free gift item is within the same catalog as the eligible items.\n\nFor inventory-managed products, ensure that you have sufficient inventory available to run the promotion. If there is insufficient stock of free gift items for all eligible free products, the free gifts won't be added to the cart.\n\nPromotions Standard can be:\n\n- [Cart-level promotions](#cart-level-promotions): The promotion applies to the entire cart.\n- [Item-level promotions](#item-level-promotions): The promotion applies to individual items in a cart.\n\n:::note\n\nThe shipping prices do not impact eligibility for item-level and cart-level promotions.\n\n:::\n\nAll items in the cart are eligible for cart-level promotions, even if they already have item-level promotions applied. You can select a few products and exclude them from a cart-level promotion. However, the store that uses a simple calculation method does not support promotions with the exclude setting.\n\n### Cart-level Promotions\n\nCart-level promotions are applied to all items in the cart. Cart-level promotions include:\n\n- Fixed discount: Reduces the cart total by a fixed amount, such as $5.00 off.\n- Percentage discount: Reduces the cart total e by a specific percentage, such as 10% off.\n\nThe following image shows a cart before and after applying a 10% Off promotion. With the discount applied, the price for each item is reduced by 10% and the cart total reflects the reduction.\n\n![Each item in the cart shows a price that is 10% less than the catalog price.](/assets/promotions-cart-10-percent-off.png)\n\nAll items in the cart are eligible for cart-level promotions, even if they already have item-level promotions applied. You can select a few products and exclude them from a cart-level promotion. However, the store that uses a [simple calculation method](https://elasticpath.dev/guides/How-To/Carts/calculate-totals#simple-calculation-method) does not support promotions with the `exclude` setting.\n\n### Item-level Promotions\n\nItem-level promotions are applied to each item that qualifies for the promotion. In a shopping cart, the price of each item reflects the discount applied to each item. With the `max_applications_per_cart` setting, you can limit the number of purchases of an item at the sale price in a cart. For more information, see the Promotions API section.\n\nItem-level promotions include the following promotion types:\n\n- X for Y: Offers bulk discount based on unit price, such as 2-for-1 sales.\n- X for amount: Offers a bulk discount based on a fixed price, such as 3-for-$20 sales.\n- Bundle: Offers bulk discount when selected products are purchased together. For example, Buy any two items from the list for $100.\n- Item fixed discount: Reduces the price of multiple items by a fixed amount, such as $5.00 off.\n- Percentage item discount: Reduces the product price for multiple items by a specific percentage, such as 10% off. You can also count the number of usages of the promotion per SKU item and limit the usage of the promotion per item. For example, if the usage of the promotion is limited to ten and the shopper purchases two of the same item and three of the another item, five uses of the promotion is deducted from the total usage limit.\n- Free Gift: Offers a free item when a specific product or a group of products are purchased.\n\n  :::caution\n\n  - Item-level promotions are only supported by the line calculation method. For more information about this method, see the [Calculation Method](/docs/api/settings/settings-introduction#calculation-method) section.\n  - The `max_discount_value` setting specifies the maximum possible discount for the cart. To avoid the conflict with the promotions and the promotion to work, we recommend not to use this setting for the following promotions:\n\n    - Cart-level fixed discount\n    - Item fixed discount\n    - X for Y discount\n    - X for amount discount\n    - Bundle\n    - Free gift\n\n  - The `max_applications_per_cart` setting, which specifies the maximum number of applications of a promotion per cart, is applicable to line-item promotions only. For example, in a store that offers *buy SKU1 get a free gift* promotion with maximum application per cart set to one, the buyer can only use the free gift promotion once per cart. If maximum application per cart is not set, the buyer can use the promotion multiple times. You can also set maximum application per cart to zero to remove any usage limit.\n  - The `exclude` array consists of productIDs or SKUs of products to be excluded from the cart-level promotions, such as `fixed_discount` and `percent_discount`. However, the stores that use simple calculation method do not support excluding products from promotions.\n  - Already existing promotions created before September 28, 2022 will not have `created_by` and `updated_by` attributes in their response body.\n\n  :::\n\nYou can create codes for a promotion so that customers receive the discount only when the code is provided.\n\n### Multiple promotions for the same SKU\n\nYou can have multiple promotions for the same SKU. However, each instance of the SKU in the cart is eligible for only one item-level promotion.\n\n:::note\n\nThe promotions are applied in the order of date of creation of the promotions. The oldest promotion is applied first and the newest promotion is applied last. For each instance of a SKU that matches the criteria in the oldest promotion, the promotion is applied. For the remaining instances of the SKU, each instance is compared to the criteria for the next oldest promotion.\n\n:::\n\nFor example, a cart consists of 1 *BestEver Coffee Maker* and 2 *BestEver Coffee Grinders*. The following promotions are available and applied automatically without a code:\n\n- An existing *BestEver Coffee Maker* + *Grinder* bundle promotion for $200.00. The bundle discount is distributed among the items in the bundle depending on the price of each item.\n- A newly added *BestEver Coffee Grinders* 10% Off percentage item discount promotion.\n\nIn this example, *BestEver Coffee Maker* costs $150 and *BestEver Coffee Grinder* costs $100. The promotions work in the following order:\n\n1. The $50 bundle discount is distributed among the items depending on the cost. In this example, the cost proportion of products is 3:2 and the *BestEver Coffee Maker* gets $30 discount and *BestEver Coffee Grinder* gets $20 discount.\n2. The second promotion is applied to the remaining *BestEver Coffee Grinders* item, and the price is reduced to $90.\n3. The cart total after both discounts is $290 instead of $350.\n\n### Understanding how Promotions work with Bundles\n\n#### Discounting Promotion Bundles\n\nBundles offer a bulk discount when selected products are purchased together. For example, for a bundle promotion, (SKU1 or SKU2 ) + SKU3, the promotion is applied if the bundle includes either SKU1 and SKU3 or SKU2 and SKU3. This setup encourages the purchase of multiple items together at a discounted rate.\n\n#### Discounting Product Bundles via promotions\n\nFor both Cart-level promotions and Item-level promotions, discounts are applied at the bundle level that can have fixed bundle price or automatic/cumulative pricing.\n\nIt is important to note that promotions do not apply to components within a bundle even if the individual item within the components qualifies for promotion. See the following examples:\n\n  - **Example 1**: Consider that Playtend Games offers a bundle that includes a game console, the Playtend Invaders Game, and the Invaders Controller. If there is an existing Item Percent Discount for the Playtend Invaders Game when sold separately, this discount will not apply when the game is part of the bundle. This ensures that the bundle pricing strategy is maintained.\n  - **Example 2**: In the case of Attribute-based promotions, consider a bundle that consists of *Item A* with attribute *Brand A* and *Item B* with attribute *Brand B*. If *Item A* with attribute *Brand A* qualifies for Item Percent Discount promotion, this discount is not applied to the bundle since the *Item A* is a component item within the bundle.\n\nTo learn how to create a bundle, see [Create a Bundle](/docs/api/pxm/products/create-product).\n\n### Condensed Promotion\n\nA condensed promotion is essentially an object that contains specific meta information about a promotion applied to the cart or order.\n\nCondensed promotions can be retrieved from the following endpoints:\n\n- [Get a Cart](/docs/carts-orders/Includes#get-retrieve-promotions-from-a-cart): This endpoint displays cart-level condensed promotions within the included object. If `?include=items` is specified, the included object also contains cart item-level promotions. The relationships field at the cart level has a promotions section only when `?include=promotions` is specified.\n- [Get Cart Items](/docs/carts-orders/Includes#get-retrieve-promotions-from-cart-items): This endpoint shows both cart-level and item-level discounts in a condensed format within the included object.\n- [Get an Order](/docs/carts-orders/Includes#get-retrieve-promotions-from-an-order): This endpoint displays order-level condensed promotions within the included object.\n- [Get Order items](/docs/carts-orders/Includes#get-retrieve-promotions-from-order-items): This endpoint displays both order-level and item-level promotions in the included object.\n\nThis applies to both Promotions Standard and [Rule Promotions](/docs/promotions-builder/overview).\n"
  contact:
    name: Elastic Path
    url: https://elasticpath.com
  license:
    name: MIT
    url: assets/LICENSE
  version: 26.0504.7552059
  x-version-timestamp: 2026-05-04 17:39:21+00:00
servers:
- url: https://useast.api.elasticpath.com
  description: US East Production Server
  variables: {}
- url: https://euwest.api.elasticpath.com
  description: EU West Production Server
  variables: {}
security:
- bearerAuth: []
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.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
    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.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.PromotionObject:
      type: object
      oneOf:
      - $ref: '#/components/schemas/Data.CartFixedDiscountPromotion'
      - $ref: '#/components/schemas/Data.CartPercentDiscountPromotion'
      - $ref: '#/components/schemas/Data.ItemFixedDiscountPromotion'
      - $ref: '#/components/schemas/Data.ItemPercentDiscountPromotion'
      - $ref: '#/components/schemas/Data.XForYDiscountPromotion'
      - $ref: '#/components/schemas/Data.XForAmountDiscountPromotion'
      - $ref: '#/components/schemas/Data.FixedBundleDiscountPromotion'
      - $ref: '#/components/schemas/Data.FreeGiftPromotion'
      discriminator:
        propertyName: promotion_type
        mapping:
          fixed_discount: '#/components/schemas/Data.CartFixedDiscountPromotion'
          percent_discount: '#/components/schemas/Data.CartPercentDiscountPromotion'
          item_fixed_discount: '#/components/schemas/Data.ItemFixedDiscountPromotion'
          item_percent_discount: '#/components/schemas/Data.ItemPercentDiscountPromotion'
          x_for_y: '#/components/schemas/Data.XForYDiscountPromotion'
          x_for_amount: '#/components/schemas/Data.XForAmountDiscountPromotion'
          bundle_fixed_discount: '#/components/schemas/Data.FixedBundleDiscountPromotion'
          bundle_gift: '#/components/schemas/Data.FreeGiftPromotion'
      required:
      - promotion_type
      properties:
        promotion_type:
          type: string
          enum:
          - fixed_discount
          - percent_discount
          - item_fixed_discount
          - item_percent_discount
          - x_for_y
          - x_for_amount
          - bundle_fixed_discount
          - bundle_gift
    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
    Response.PaginationResults:
      type: object
      properties:
        total:
          description: The total number of results.
          type: integer
    Data.PromotionsCodesObject:
      title: Data.PromotionsCodesObject
      type: object
      properties:
        data:
          $ref: '#/components/schemas/Data.PromotionsCodes'
    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.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.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.AmountAndCurrencyArray:
      title: Data.Promotions.Schema.AmountAndCurrencyArray
      type: object
      required:
      - currencies
      properties:
        currencies:
          type: array
          items:
            $ref: '#/components/schemas/Data.Promotions.Schema.Currencies.AmountAndCurrency'
    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.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.PromotionsCodes:
      title: Data.PromotionsCodes
      type: object
      properties:
        codes:
          type: array
          items:
            $ref: '#/components/schemas/Data.CodeResponse'
          description: ''
    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.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.

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