Elastic Path Rule Promotion Codes API
The Rule Promotion Codes API from Elastic Path — 2 operation(s) for rule promotion codes.
The Rule Promotion Codes API from Elastic Path — 2 operation(s) for rule promotion codes.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
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.curl "https://apis.io/api/v1/apis/elastic-path-rule-promotion-codes-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
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: 3.2.0
info:
title: Rule Promotions Rule Promotion Codes API
description: "Rule Promotions provide the flexibility to offer diverse discounts to shoppers. This functionality supports discounts of varying complexities, from code-based customer discounts, to \"Buy X Get Y\" scenarios, fixed price promotions, and more based on your business needs.\n\nYou can create a Rule Promotion using the Rule Promotions API or through the Promotions Builder in Commerce Manager.\n\nTo apply Rule Promotions in carts and orders across an entire store, please enable the `use_rule_promotions` configuration in Cart Settings. You can also update a specific cart to use Rule Promotions by updating the cart's specific discount settings. Please see [Update A Cart](/docs/api/carts/update-a-cart) for more details. \n\nEnabling Rule Promotions enacts Hybrid Mode, allowing simultaneous use of both Promotions Standard and Rule Promotions discounts.\n\nFor example, let's say a store provides the following promotions:\n- A Promotions Standard discount for 10% off the shopping cart\n- A Rule Promotion offering for a 20% discount on the shopping cart\n\nIf a cart qualifies for both discounts based on the respective eligibility criteria, the system applies both types of discounts to the shopping cart, starting with Promotions Standard definitions before applying Rule Promotions. In this case, the application results in a 10% discount from the Promotions Standard definition and a 20% discount from the Rule Promotion. \n\n### Rule Set\nA rule set is the criteria that determine when and how promotions get applied. Rule Sets consist of rule conditions and corresponding actions, which define eligibility and application details, respectively. Rule Sets may also contain targeted catalogs and currencies for further application granularity.\n\n**Example**\nBuy an apple, get an orange 50% off.\n\nHere, buying an apple is the rule and the 50% discount on an orange is the action.\n\n#### Rules\nRules describe the conditions necessary for promotion eligibility. \n\nIn our apple-orange example above, the rule indicates the shopper must buy an apple to get the discount on an orange. In other words, the buying of an apple is the condition which determines eligibility for the corresponding discount.\n\n**Condition Architecture:**\nAll conditions follow a consistent structure with three primary components: - **`strategy`**: Defines the type of condition (e.g., `cart_total`, `item_category`) - **`operator`**: Specifies how the condition is evaluated (e.g., `gte`, `in`, `contains_all`) - **`args`**: Contains the values to evaluate against\nSome conditions support additional components for complex scenarios: - **`children`**: Sub-conditions that provide additional specificity - **`condition`**: Used in actions to define item-specific restrictions\n\n**Condition Categories:** - **Cart-level**: Evaluate entire cart properties (total, custom attributes) - **Account-level**: Consider customer account characteristics (tags, segments) - **Item-level**: Target specific products, categories, or attributes - **Bundle conditions**: Complex multi-item requirements for \"Buy X, Get Y\" scenarios - **Logical operators**: AND/OR logic for sophisticated eligibility rules\n\n**Key Design Considerations:** - **Performance**: Order conditions from most to least restrictive for optimal evaluation - **Maintainability**: Use `item_identifier` instead of legacy `item_sku`/`item_product_id` strategies - **Complexity**: Limit nesting depth and consider evaluation costs for complex bundle conditions - **Business Logic**: Ensure condition combinations align with promotion goals and margin requirements\n\n#### Actions\nActions describe how discounts apply to eligible carts and orders. These signify the discount type, level, configurations, and any limitations or restrictions when applying.\n\nActions can also include:\n- Action conditions: specify which items should be included or excluded when applying the discounts. These can be based on factors such as item SKUs, product attributes, quantities, or categories.\n- Action limitations: impose restrictions on the number of products eligible for discounts, maximum discount amounts, and/or total applications for discounts.\n\nIn the apple-orange example, the action denotes the system applies a 50% discount to an orange, assuming the eligibility rules are met. For more complex scenarios, the action might say to provide a 50% discount on up to three oranges or might provide a fixed $1 discount on the two most expensive items from the \"fruit\" category.\n\n:::note\n\nFor promotions that include a mix of item and cart rules or actions, we recommend including the specific item conditions in all item strategies to ensure desired discount applications.\n\nFor complex promotions in general, we recommend including specific item conditions on all item strategies to ensure the appropriate items receive discounts. Please see the [Create a Rule Promotion API Request Examples](/docs/api/promotions-builder/create-rule-promotion) for more details on specifying conditions, restrictions, and inclusions.\n\n:::\n\n#### Action Limitations\nAction limitations define constraints or rules that govern how a promotion's action is applied. While actions specify what discount is given (e.g., 10% off the cart), limitations control how much, to which items, and under what circumstances that action is applied.\nLimitations include:\n - **`max_discount`**: Caps the total value of the discount.\n - **`max_quantity`**: Limits the number of discounted units per item.\n - **`items`**: Restricts how many and which items are eligible, and in what order (e.g., max_items, price_strategy).\n - **`max_items`**: Specifies the maximum number of items eligible for the discount.\n - **`price_strategy`**: Determines how eligible items are selected based on price:\n - **Cheapest (default)**: The discount is applied to the cheapest item(s) in the cart.\n - **Expensive**: The discount applies to the most expensive item(s) in the cart.\n Some limitations, like auto_add, influence the application behavior of the action rather than its scope.\n - **`auto_add`**: Automatically adds items to the cart once conditions are met, \n providing additional configuration for the promotion’s application mode.\n - **`show_suggestions`**: A flag indicating whether to show suggestions for eligible items in the cart \n if the item is not in the cart. \n\nIn this way, limitations can affect either the scope of the discount or the manner in which it is applied, providing both technical and user-facing boundaries around a promotion’s behavior.\nFor example, consider a **50% discount on items from a category**, with the following limitations:\n - **Applies to a maximum of two items (`max_items: 2`)**\n - **Only applies to the two cheapest eligible items (`price_strategy: cheapest`)**\n - **Limits the total discount to $10 (`max_discount: 1000`)**\n - **Ensures a maximum of two units per eligible item receive the discount (`max_quantity: 2`)**\n\n#### Catalogs and Currencies\nAs part of the Rule Set, you can also specify the catalogs and currencies for a given Rule Promotion. \n\nWith catalogs defined, the promotion only considers items from the identified catalogs and therefore will not consider custom items or items from other catalogs. With no catalogs defined, the promotion considers all items, including custom items.\n\nSpecifying a currency for a Rule Promotion restricts it to carts using that currency. Rule Promotions support multiple currencies when using a percent discount. If no currencies are defined, the discount applies to carts in any currency.\n\n### Building Blocks\n\n#### Strategies\nStrategies describe the types of condition criteria or application actions used to build a promotion. A given promotion can be comprised of several strategies in its rules and actions. These might include several instances of similar strategies, different strategies, or some combination thereof. Think of these as building blocks that can be applied together to provide a functional discount.\n\n- Rule strategies define the types of conditions that need to be met for eligibility. These might include cart total amount, item prices, cart custom attributes, and more.\n- Action strategies refer to the type of action execution run when the eligibility criteria are met. For actions, the possible strategies are `cart_discount`, `item_discount`, `item_bundle_discount` and `shipping_discount`. For more information, please see [Promotions Builder API Overview](/docs/promotions-builder/promotions-builder-api/promotions-builder-api-overview).\n#### Operators and Args\nOperators determine how to evaluate a given strategy, while `args` define the value threshold to measure against. For example, please consider the following condition strategy:\n\n```\n{\n \"strategy\": \"cart_total\",\n \"operator\": \"gte\",\n \"args\": [ 10000 ]\n}\n```\n\nIn this example, the strategy is `cart_total`, telling the system to assess eligibility based on the total cart value. The operator is a greater-than-or-equal-to (`gte`) evaluation, indicating the candidate value (in this case, cart total) becomes eligible once it reaches or exceeds the threshold. Finally, the `args` value provides the threshold value to compare against, 10000. Taken together, then, this strategy looks for cart totals greater than or equal to 10000.\n\n::: note Different strategies support different operators. For more information, please see [Rule Promotions API Overview](/docs/promotions-builder/promotions-builder-api/promotions-builder-api-overview). :::\n#### Children and Sub-Conditions\nFor additional promotion granularity, some strategies support additional specifications via `children` and `condition` fields. \nThese fields contain strategies, which provide further specifications around their parent strategy evaluations. \nIn other words, sub-conditions refer to additional criteria or conditions that must be met for a particular promotion to be applied.\n\nThe following strategies support children/sub-conditions:\n- `item_price`\n- `item_quantity`\n- `item_category`\n- `item_attribute`\n- `and`\n- `or`\n\nNotably, when multiple sub-condition siblings exist, they are combined together, such that all sub-conditions must be met to fulfill eligibility.\n\n### Stacking\nPromotion stacking and priority are key elements in managing discounts, ensuring promotions are applied as intended. Stacking allows multiple promotions to be applied to a single cart, either targeting the same items or different ones. The `stackable` flag determines whether a promotion can stack with others, defaulting to `true`. If set to `false`, no other promotion can stack on top, and the highest-priority promotion takes precedence. \n\nPriority settings dictate the order in which promotions are applied, with higher numbers indicating higher priorities. By default, promotions without assigned priorities are applied in reverse order of creation, with newer promotions applied first and calculated against any existing discounted prices.\n\nHybrid Mode enables the coexistence of Standard Promotions and those configured in the Promotions Builder, with each functioning independently. This means Standard Promotions can stack alongside non-stackable Builder promotions, and their stackability and priority settings remain unaffected by Standard Promotions.\n\nOverride stacking, set using the `override_stacking` flag, provides an additional layer of control over how promotions interact. This flag determines whether the promotion can stack with other promotions that are typically non-stackable and defaults to `false` when not set. When set to `true`, the promotion can stack with promotions configured as non-stackable, unless those non-stackable promotions also override stacking.\n\n### Shipping\nRule Promotions support shipping discounts, identified by the corresponding strategies during promotion creation. Shipping discounts apply to shipping group base prices and do not impact shipping taxes or configured shipping fees. Please see [Shipping Groups](/docs/ship-groups/shipping-groups/index) for more information on creating and interacting with shipping groups.\n\n### Items Bundle\nYou can promote and discount groups of items together using the `items_bundle` rule strategy and the `items_bundle_discount` action strategy. When these strategies are applied, the cart must contain items that meet all specified criteria to qualify for the discount.\n- The `items_bundle` rule strategy defines the required group of items for discount eligibility.\n- The `items_bundle_discount` action strategy specifies how the discount is applied to the qualifying group.\n- The `items_bundle` strategy requires **at least one** requirement that defines which items are eligible. Bundle items can be mixed across categories or attributes to form a valid bundle.\n- The `item_quantity` can be used with any of the bundling strategies, including `item_category`, `item_identifier`, `item_attribute`, etc.\n - `item_quantity` only support `eq` operator when configuring `items_bundle` strategy.\n - For instance, targeting a category with `item_quantity` with operator `eq` 2 means any two items from that category can form a bundle. The system will prioritize individual line items with sufficient quantity first before combining quantities of separate line items.\n```\n{\n \"strategy\": \"items_bundle\",\n \"children\": [\n {\n \"strategy\": \"and\",\n \"children\": [\n {\n \"strategy\": \"item_category\",\n \"operator\": \"in\",\n \"args\": [\n \"667d9fae-d8c7-4941-b556-70cb4b8612f1\"\n ]\n },\n {\n \"strategy\": \"item_quantity\",\n \"operator\": \"gte\",\n \"args\": [\n 2\n ]\n }\n ]\n }\n ]\n}\n```\n- When using `item_quantity` to target specific items or categories, the required quantity can be fulfilled by a combination of eligible items.\n - For example, if the rule is `item_quantity` with operator `eq` 3 for products in the \"Office Supplies\" category, the discount will apply when the cart includes any of the following combinations:\n - 2 packs of printer paper + 1 box of pens\n - 1 stapler + 2 notepad\n - 1 box of pens + 1 notepad + 1 pack of printer paper\n - 3 identical items, such as 3 boxes of pens\n\n - **Please Note**: the system considers line items sequentially based on their quantities, using the order of addition to the cart as a fallback tie-breaker. If the first eligible item has sufficient quantity to fulfill the bundle criteria, it will consume the required quantity and complete the evaluation for that criteria. The system does not re-evaluate these processed items to share any remaining quantities with other items. This behaviour may result in differing total discount amounts for two shopping carts with the same items added in a different order if those items have the same quantity values.\n\nAvailable discount types:\n - `fixed_price` – Sets a fixed total price for the group (e.g., If the fixed price is set at $100, then the group's subtotal is exactly $100)\n - `percent` – Applies a percentage-based discount to the group.\n - `fixed` – Deducts a fixed amount from the group's total price.\n"
version: 26.0504.7552059
x-version-timestamp: 2026-05-04 17:39:21+00:00
contact:
name: Elastic Path
url: https://elasticpath.com
license:
name: MIT
url: assets/LICENSE
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: {}
tags:
- name: Rule Promotion Codes
paths:
/v2/rule-promotions/{promotionID}/codes:
post:
tags:
- Rule Promotion Codes
summary: Create Rule Promotion Codes
description: "Creates new promotion codes for a specific rule promotion, allowing customers to redeem discounts based on predefined conditions.\n\n- Supports bulk creation of multiple promotion codes in a single request.\n- Each code can have individual usage limits.\n- Can optionally assign codes to specific users to enforce targeted promotions.\n- The promotion codes are case-insensitive.\n\n:::note\n\nRegarding first time shopper limitations:\n- Orders without payment transactions do not count as completed purchases.\n- Canceling or refunding an order does not reinstate first-time shopper status.\n- A first-time shopper coupon code cannot have limited uses or be assigned to specific users, meaning the code cannot be restricted by the number of times it can be used or tied to a specific customer ID.\n\n:::\n\nA successful request returns a `201 Created` response with details of the generated promotion codes.\n\n### Duplicate Codes\nDuplicate promotion codes **are supported across different promotions** in the store, regardless of their statuses and validity dates. However, **duplicate codes cannot be created within the same promotion**.\nThis means that shoppers can apply a single coupon code to trigger multiple promotions if those promotions share common coupon codes. \n\nCodes that share the same name can serve different purposes. For example, one code may have `per_application` with a limited number of uses, while another identical code can have `per_checkout` with unlimited use.\n\n**Duplicate Code Handling:**\n- If a duplicate code is detected **within the same promotion**, the request will return a `422 Duplicate code` error.\n- When creating duplicate codes, a message appears with the successful response indicating the duplication.\n\n\nPlease refer to the **OpenAPI examples** section on this page for sample request structures.\n"
operationId: createRulePromotionCodes
security:
- bearerAuth: []
parameters:
- $ref: '#/components/parameters/Authorization'
- name: promotionID
in: path
required: true
schema:
type: string
description: The unique identifier of the rule promotion.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PromotionCodesRequest'
examples:
CreateCodes:
summary: Create Rule Promotion Codes
value:
data:
type: promotion_codes
codes:
- code: spring2024
- code: summer2024
consume_unit: per_checkout
- code: summer2024_limited
consume_unit: per_application
uses: 5
- code: summer2024_memberOnly
consume_unit: per_application
uses: 1
user: vip_shopper@email.com
SingleUsePerShopperIncludingGuests:
summary: Create a Promotion Code Usable Once Per Shopper, Including Guest Shoppers with Emails Associated with their Carts
value:
data:
type: promotion_codes
codes:
- code: one_per_shopper
consume_unit: per_checkout
max_uses_per_shopper:
includes_guests: true
max_uses: 1
MaxUsesLimitWithPerShopperRestriction:
summary: Create a Promotion Code with a Total Usage Limit and Per Shopper Restriction
description: 'Create a promotion code that allows up to **10 total uses** and allows each individual shopper to use the code **once**.
- The `uses` field is set to `10`, meaning the promotion code can be redeemed a maximum of **10 times across all shoppers**.
- The `max_uses_per_shopper` field sets `max_uses: 1`, ensuring **each shopper can only redeem the code once**.
- The `includes_guests` field is set to `true`, allowing **both registered and guest shoppers** to use the promotion code.
- The `consume_unit` is set to `per_checkout`, meaning the code is **consumed once per successful checkout**.
This setup is useful for **one-time promotions** where a **limited number of shoppers can redeem the code** but prevents any single shopper from claiming multiple redemptions.
'
value:
data:
type: promotion_codes
codes:
- code: one_time_use
consume_unit: per_checkout
uses: 10
max_uses_per_shopper:
includes_guests: true
max_uses: 1
MaxUsesForSpecificShopper:
summary: Limit Promotion Code Usage to a Specific Shopper
description: 'Create a promotion which **limits the maximum usage of a promotion code to a specific shopper** based on their `customerID`.
- The `uses` field is set to `1`, meaning **this promotion code can only be used once by the identified shopper**.
- The `user` field is set to `customer-id-123`, ensuring the **code is only valid when the cart is checked out by the specified customer**.
- The `consume_unit` is set to `per_checkout`, meaning the code is **redeemed upon a successful checkout**.
**Important Notes:**
- This method is useful for **targeted, personalized promotions** where only a specific shopper should receive the discount.
- The promotion code **cannot be used by any other shopper**.
- **Account user IDs are currently not supported**.
This setup is ideal for **single-use, customer-specific promotions**, such as loyalty rewards or personalized discount offers.
'
value:
data:
type: promotion_codes
codes:
- code: one_per_shopper
consume_unit: per_checkout
uses: 1
user: customer-id-123
MaxUsesForSpecificRegisteredShopper:
summary: Limit Promotion Code Usage to a Specific Registered Shopper
description: 'This example demonstrates how to **restrict a promotion code to a specific registered shopper** using their `customerID`, with a limit on how many times they can redeem the code.
- The `user` field is set to `customer-id-123`, ensuring **only the specified shopper can use the promotion code**.
- The `max_uses_per_shopper.max_uses` field is set to `1`, meaning **this shopper can only redeem the code once**.
- The `max_uses_per_shopper.includes_guests` field is set to `false`, meaning **guest shoppers cannot use this code**.
- The `consume_unit` is set to `per_checkout`, meaning **the code is consumed once per successful checkout**.
**Key Differences from Other Shopper-Specific Limits:**
- Unlike a `uses: 1` setup, which sets a global limit for the code, this method **explicitly enforces per-shopper usage limits**.
- This approach is ideal for **exclusive promotions targeting specific registered shoppers**, ensuring that only they can redeem the discount and preventing usage by guest shoppers.
- **Account user IDs are currently not supported**.
This setup is useful for **member-only discounts, personalized promotional offers, or exclusive VIP rewards**.
'
value:
data:
type: promotion_codes
codes:
- code: one_per_shopper
consume_unit: per_checkout
user: customer-id-123
max_uses_per_shopper:
includes_guests: false
max_uses: 1
FirstTimeShopperCodeRequest:
summary: Create a Promotion Code for First-Time Shoppers
description: 'Create a **promotion code that is only applicable to first-time shoppers**. Here, the `is_for_new_shopper` field is set to `true`, indicating that **only first-time shoppers can use this code**.
**Important Notes:**
- Promotion codes with `is_for_new_shopper: true` **cannot have usage limits** (`uses`) or be assigned to specific users.
- If usage limits or shopper assignments are included, a **400 Invalid Code error** will be returned.
'
value:
data:
type: promotion_codes
codes:
- code: first_time
is_for_new_shopper: true
responses:
'201':
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/CreatePromotionCodesResponse'
examples:
PromotionCodeCreatedResponse:
summary: Response When a Promotion Code is Successfully Created
value:
data:
- id: 8a1c73bc-7c15-41c3-a3ed-a0aa398c3984
code: one_per_shopper
user: 5abb8d4e-57c0-459b-91d5-c4e6f77e9c5e
max_uses_per_shopper:
max_uses: 1
includes_guests: false
consume_unit: per_checkout
FullyConsumedPromotionCodeResponse:
summary: Response When a Promotion Code Has Been Fully Used
description: 'Response indicating that a **promotion code has already been fully consumed** by the shopper and is no longer valid for use.
- The `source.id` field provides the unique identifier of the promotion.
- The `source.code` field specifies the exact promotion code that has been fully consumed.
- The `title` field (`"Fully Consumed"`) serves as a user-friendly summary of the issue.
- The `description` field provides a clear explanation: `"You''ve already fully consumed this promotion code"`.
This response is useful for handling **errors when applying promotion codes**, ensuring that customers receive **clear feedback** if they attempt to reuse a code that has reached its usage limit.
'
value:
messages:
- source:
type: promotion_codes
id: 38861a5c-81bb-43bc-8934-e30cde108579
code: one_per_shopper
title: Fully Consumed
description: You've already fully consumed this promotion code
DuplicateCodeNameResponse:
summary: Message Response When Creating a Duplicate Promotion Code Name
value:
messages:
- source:
type: promotion_codes
codes:
- duplicate-code
title: Duplicate code names
description: Code names duplicated in other promotions
'400':
description: Bad Request
content:
application/json:
schema:
type: object
properties:
errors:
type: array
items:
type: object
properties:
status:
type: integer
example: 400
source:
type: string
example: data.codes.0.max_uses_per_shopper
title:
type: string
example: missing_dependency
detail:
type: string
example: Has a dependency on max_uses
examples:
MissingMaxUsesDependencyError:
summary: Error When `max_uses_per_shopper.includes_guests` is Provided Without `max_uses`
description: 'This error occurs when `max_uses_per_shopper.includes_guests` is provided **without specifying** `max_uses`.
'
value:
errors:
- status: 400
source: data.codes.0.max_uses_per_shopper
title: missing_dependency
detail: Has a dependency on max_uses
FirstTimeShopperCodeError:
summary: Error When Setting Usage Limits While Assigning First-Time Shopper Codes
description: 'This error occurs when a **first-time shopper promotion code** is created **with restricted uses (`uses`) or assigned to specific users (`user`)**.
'
value:
errors:
- status: 400
source: ''
title: Invalid Code
detail: Code - first_time_uses can't have limited uses or assigned to users since it's for first-time shoppers.
'422':
description: Unprocessable Entity
content:
application/json:
schema:
type: object
properties:
errors:
type: array
items:
type: object
properties:
status:
type: string
example: '422'
source:
type: string
example: ''
title:
type: string
example: Unsupported consume unit
detail:
type: string
example: Consume unit 'per_application' is not supported when using 'max_uses_per_shopper' features.
examples:
UnsupportedConsumeUnitError:
summary: Error When `max_uses_per_shopper.max_uses` is Used with `per_application`
description: 'This error occurs when `max_uses_per_shopper.max_uses` is set while using `consume_unit: per_application`, which is not supported.
'
value:
errors:
- status: '422'
source: ''
title: Unsupported consume unit
detail: Consume unit 'per_application' is not supported when using 'max_uses_per_shopper' features.
NoCodesAllowedForAutomaticPromotion:
summary: Error When Attempting to Create Promotion Codes for Automatic Promotions
value:
errors:
- status: '422'
title: No codes allowed
detail: Cannot add codes to automatic promotion
DuplicatePromotionCodeError:
summary: Error When Creating a Promotion Code That Already Exists
description: 'This error occurs when attempting to create a promotion code that already exists within the same Rule Promotion.
'
value:
errors:
- status: '422'
title: Duplicate code
detail: Promotion code already in use
get:
tags:
- Rule Promotion Codes
summary: Get Rule Promotion Codes
description: 'Retriev
# --- truncated at 32 KB (47 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/elastic-path/refs/heads/main/openapi/elastic-path-rule-promotion-codes-api-openapi.yml