/** * This file was auto-generated by openapi-typescript and ts-morph. * Do not make direct changes to the file. */ export interface paths { readonly "/promotions": { readonly parameters: { readonly query?: never; readonly header: { /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */ readonly Accept: components["parameters"]["Accept"]; }; readonly path?: never; readonly cookie?: never; }; /** * Get All Promotions * @description Returns a list of *promotions*. * * The response includes the display name and other details about each promotion, and lists the promotions ordered by ID by default. * * **Note:** * The default rate limit for this endpoint is 40 concurrent requests. */ readonly get: operations["getPromotions"]; /** * Create Promotion * @description Creates a *promotion*. * To learn more about how to create a *promotion*, read the [Promotions Overview](/docs/store-operations/promotions). * For examples grouped by use case, see the [promotions examples](/docs/store-operations/promotions/examples/brand). * * **Note:** * The default rate limit for this endpoint is 40 concurrent requests. */ readonly post: operations["createPromotion"]; /** * Delete Multiple Promotions * @description Deletes multiple promotions. Currently, batches are limited to 50 promotions. * * **Notes** * * "id:in" query param is required to delete promotions. If this parameter is not provided, or provided with the wrong data format, a 422 error code is returned. * * You cannot delete promotions that still have coupon codes attached. * * The default rate limit for this endpoint is 40 concurrent requests. */ readonly delete: operations["deletePromotions"]; }; readonly "/promotions/{id}": { readonly parameters: { readonly query?: never; readonly header: { /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */ readonly Accept: components["parameters"]["Accept"]; }; readonly path?: never; readonly cookie?: never; }; /** * Get Promotion * @description Returns a single *promotion*. * * **Note:** * The default rate limit for this endpoint is 40 concurrent requests */ readonly get: operations["getPromotion"]; /** * Update Promotion * @description Update a promotion. * * **Note:** * The default rate limit for this request is 40 concurrent requests. */ readonly put: operations["updatePromotion"]; /** * Delete Promotion * @description Deletes a promotion. * * **Note:** * The default rate limit for this endpoint is 40 concurrent requests. */ readonly delete: operations["deletePromotion"]; }; readonly "/promotions/{promotion_id}/codes": { readonly parameters: { readonly query?: never; readonly header: { /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */ readonly Accept: components["parameters"]["Accept"]; }; readonly path?: never; readonly cookie?: never; }; /** * Get Coupon Codes * @description Get codes for a particular promotion. * * **Note:** * The default rate limit for this endpoint is 10 concurrent requests. */ readonly get: operations["getPromotionCodes"]; /** * Create A Coupon Code * @description Create a new code for the promotion. * * **Note:** * The default rate limit for this endpoint is 40 concurrent requests. */ readonly post: operations["createPromotionCode"]; /** * Delete Multiple Coupon Codes * @description Deletes multiple coupon codes relating to the given promotion. Currently, batches are limited to 50 coupon codes. * * **Notes** * * "id:in" query param is required to delete coupon codes. If not provided, or provided with the wrong data format, a 422 error code is returned. * * The default rate limit for this endpoint is 40 concurrent requests. */ readonly delete: operations["deleteCouponCodes"]; }; readonly "/promotions/{promotion_id}/codegen": { readonly parameters: { readonly query?: never; readonly path?: never; readonly cookie?: never; }; /** * Generate Multiple Coupon Codes * @description Generate a batch of coupon codes for a particular bulk coupon promotion. * * **Note:** * * batch_size (number of codes generated per request) is limited to 250. If batch_size is not an integer or larger than 250, it will return a 422 error code. * * The default rate limit for this endpoint is 10 concurrent requests. */ readonly post: operations["generatePromotionCodesBatch"]; }; readonly "/promotions/{promotion_id}/codes/{code_id}": { readonly parameters: { readonly query?: never; readonly header: { /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */ readonly Accept: components["parameters"]["Accept"]; }; readonly path?: never; readonly cookie?: never; }; /** * Delete A Coupon Code * @description Deletes a coupon code. * * **Note:** * The default rate limit for this endpoint is 40 concurrent requests. */ readonly delete: operations["deleteCouponCode"]; }; } export type webhooks = Record; export interface components { schemas: { /** * @description Describes which client originally created the promotion * @enum {unknown} */ readonly CreatedFrom: "react_ui" | "legacy_ui" | "api"; /** * PromotionBase * @description **Promotion** * A *promotion* is composed of a condition that a customer can satisfy (such as increasing their cart value above a certain amount or adding an item to their cart) and an action will take place (such as a discount on the customer’s order total, or a free item being added to their cart). */ readonly PromotionBase: { /** * @description An auto-generated unique identifier for the discount rule. * @example 1 */ readonly id?: number; /** * @description A read-only field indicating the type of promotion. Promotions applied automatically have a value of `AUTOMATIC` whereas promotions requiring a coupon have a value of `COUPON`. * @enum {string} */ readonly redemption_type?: "AUTOMATIC" | "COUPON"; /** * @description An internal name for this rule that the merchant can refer to. * @example Buy Product X Get Free Shipping */ readonly name?: string; /** * @description Customer-facing name for this rule, that the merchant want to display to customers. * @example WOW!!! FREE SHIPPING for Product X */ readonly display_name?: string; /** @description Channels that the promotion targets. Empty array [] means targeting all the channels. In POST request, if omitted, this field defaults to an empty array [] value. */ readonly channels?: readonly components["schemas"]["Channel"][]; readonly customer?: components["schemas"]["Customer"]; /** @description An ordered list of rules to be executed until the first applicable one applies a discount successfully and the rest will be skipped. */ readonly rules?: readonly components["schemas"]["Rule"][]; /** * @description A read-only count of the times this rule has been used by customers. A rule is considered to be used when a customer successfully checks out with a rule that has applied a discount to their cart. * @example 2 */ readonly current_uses?: number; /** * @description The maximum number of times this discount can be used by customers. * @example 10 */ readonly max_uses?: number; /** * @description Controls whether or not a discount rule can be used by customers. `INVALID` is a read-only status into which enabled discount rules may transition when they become invalid. * @enum {string} */ readonly status?: "ENABLED" | "DISABLED" | "INVALID"; /** * @description The date and time when this rule will become active. * @example 2005-12-30T01:02:03+00:00 */ readonly start_date?: string; /** * @description The date and time when this rule will expire. If this property is left null, the promotion never expires. * @example 2025-12-30T01:02:03+00:00 */ readonly end_date?: string; /** * @description Boolean value that specifies whether to stop evaluating promotions down the priority list when the promotion is applied successfully. * @example false */ readonly stop?: boolean; /** * @description Boolean value that specifies whether this promotion can be used with other promotions. When set to false, only apply this promotion if there are no discounts applied already, and stop executing other promotions if this promotion applies successfully. * @default true * @example false */ readonly can_be_used_with_other_promotions: boolean; /** * @description The ISO-4217-based transactional currency code to which the promotion applies OR * for all currencies. * @example USD */ readonly currency_code?: string; /** @description Notifications to display on the storefront based on the result of the evaluation for promotion eligibility. */ readonly notifications?: readonly components["schemas"]["Notification"][]; readonly shipping_address?: components["schemas"]["AddressMatcher"]; readonly schedule?: components["schemas"]["AvailabilityByWeekDay"]; }; /** * Patch Coupon Promotion * @description A Partial **Coupon Promotion** that contains properties to patch. */ readonly PatchCouponPromotion: components["schemas"]["PromotionBase"] & { readonly codes?: components["schemas"]["CouponCode"]; /** * @description This field only has effect when `can_be_used_with_other_promotions` is `false`: * - When the property is set to `true`, the coupon will override the applied automatic promotions if it provides a greater discount. * - When the property is set to `fasle`, the coupon will not be applied if automatic promotions are already applied. * Trying to set the value of this field to `true` when `can_be_used_with_other_promotions` is `true` will yield a 422 error response. * @default false * @example false */ readonly coupon_overrides_automatic_when_offering_higher_discounts: boolean; }; /** * Draft Coupon Promotion * @description A draft **Coupon Promotion** to be created. A shopper must manually apply a *coupon promotion* to their cart. */ readonly DraftCouponPromotion: components["schemas"]["PromotionBase"] & { readonly codes?: components["schemas"]["CouponCode"]; /** * @description This field only has effect when `can_be_used_with_other_promotions` is `false`: * - When the property is set to `true`, the coupon will override the applied automatic promotions if it provides a greater discount. * - When the property is set to `fasle`, the coupon will not be applied if automatic promotions are already applied. * Trying to set the value of this field when `can_be_used_with_other_promotions` is `true` will yield a 422 error response. * @default false * @example false */ readonly coupon_overrides_automatic_when_offering_higher_discounts: boolean; /** * @description The type of the promotion. Promotions applied automatically have a value of `AUTOMATIC` whereas promotions requiring a coupon have a value of `COUPON`. * @enum {string} */ readonly redemption_type: "COUPON"; }; /** * Saved Coupon Promotion * @description **Coupon Promotion** A shopper must manually apply a *coupon promotion* to their cart. */ readonly SavedCouponPromotion: WithRequired & { /** * @description An auto-generated unique identifier for the discount rule. * @example 1 */ readonly id: number; readonly created_from: components["schemas"]["CreatedFrom"]; readonly codes?: components["schemas"]["CouponCode"]; /** * @description This field only has effect when the `redemption_type` is `COUPON` and `can_be_used_with_other_promotions` is `false`: * - When the property is set to `true`, the coupon will override the applied automatic promotions if it provides a greater discount. * - When the property is set to `fasle`, the coupon will not be applied if automatic promotions are already applied. * * Trying to set the value of this field to `true` when the `redemption_type` is not `COUPON`, or when `can_be_used_with_other_promotions` is `true` will yield a 422 error response. * @default false * @example false */ readonly coupon_overrides_automatic_when_offering_higher_discounts: boolean; /** * @description The type of the promotion. Promotions applied automatically have a value of `AUTOMATIC` whereas promotions requiring a coupon have a value of `COUPON`. * @enum {string} */ readonly redemption_type: "COUPON"; readonly multiple_codes?: { /** * @default false * @example false */ readonly has_multiple_codes: boolean; }; }; /** * Patch Automatic Promotion * @description A Partial **Automatic Promotion** that contains properties to patch. */ readonly PatchAutomaticPromotion: components["schemas"]["PromotionBase"]; /** * Draft Automatic Promotion * @description A draft **Automatic Promotion** to be created. The store applies *automatic promotions* to a shopper’s cart once the promotion criteria are satisfied. The shopper cannot manually apply an *automatic promotion*. */ readonly DraftAutomaticPromotion: WithRequired & { /** * @description The type of the promotion. Promotions applied automatically have a value of `AUTOMATIC` whereas promotions requiring a coupon have a value of `COUPON`. * @enum {string} */ readonly redemption_type: "AUTOMATIC"; }; /** * Saved Automatic Promotion * @description The store applies *Automatic promotions* to a shopper’s cart once the promotion criteria are satisfied. The shopper cannot manually apply an *automatic promotion*. */ readonly SavedAutomaticPromotion: WithRequired & { /** * @description The type of the promotion. Promotions applied automatically have a value of `AUTOMATIC` whereas promotions requiring a coupon have a value of `COUPON`. * @enum {string} */ readonly redemption_type: "AUTOMATIC"; /** * @description An auto-generated unique identifier for the discount rule. * @example 1 */ readonly id: number; readonly created_from: components["schemas"]["CreatedFrom"]; }; /** @description Specifies the requirements which make the customer eligible for the promotion. * * Note: * - Only "group_ids" or "excluded_group_ids" should be specified (have non-empty array data), but not both. * - group_id zero (0) signifies guest customers or registered customers who are not assigned to any groups. */ readonly Customer: { /** * @description A list of customer group IDs that the promotion targets. Only customers in those groups are eligible for this promotion. When unspecified, or set to an empty array, this requirement is not effective, and all customers who satisfy the other requirements (minimum_order_count, excluded_group_ids) are eligible for the promotion. * @example [ * 1, * 2, * 3 * ] */ readonly group_ids?: readonly number[]; /** @description The minimum number of completed orders required of the customer. */ readonly minimum_order_count?: number; /** * @description A list of customer group IDs that the promotion will exclude. Only customers who are NOT in those groups are eligible for this promotion. When unspecified, or set to an empty array, this requirement will not have any effects, and all customers who satisfy the other requirements (group_ids, minimum_order_count) are eligible for the promotion. * @example [ * 1, * 2, * 3 * ] */ readonly excluded_group_ids?: readonly number[]; readonly segments?: components["schemas"]["CustomerSegmentLimitation"]; }; /** * Rule * @description **Rule** * A Rule is the executable unit of the promotion. When a ruleʼs condition is met, the API applies the discount defined in the specified action. */ readonly Rule: { readonly action: components["schemas"]["Action"]; /** * @description Setting this property to false enables the rule to run repeatedly (for example: 1 free product X for every product Y you purchase) * @default true */ readonly apply_once: boolean; /** @description Boolean value that specifies whether to stop executing all the remaining rules down the priority list when the current rule is applied successfully. */ readonly stop?: boolean; readonly condition?: components["schemas"]["Condition"]; }; /** @description **Condition** */ readonly Condition: components["schemas"]["CartCondition"] | components["schemas"]["AndCondition"]; /** * AndCondition * @description **AndCondition** * Evaluates to true when all children are evaluated to true. */ readonly AndCondition: { /** @description Array of [Conditions](/docs/rest-management/promotions). */ readonly and?: readonly components["schemas"]["CartCondition"][]; }; /** * Cart Condition * @description **Cart Condition** * Condition based on the content of the current cart. */ readonly CartCondition: { readonly cart?: { readonly items?: components["schemas"]["ItemMatcher"]; readonly minimum_spend?: components["schemas"]["Money"]; /** * @description Minimum required quantity of the item in the cart for the condition to match. This field is *mandatory* when `items` are specified, but has *no effect* if `items` are not specified. * @example 1 */ readonly minimum_quantity?: number; }; }; /** * Item Matcher * @description **ItemMatcher** * Lists which items to consider in the condition or action. If this is specified, you will need to also specify at least one of minimum_quantity or minimum_spend. */ readonly ItemMatcher: components["schemas"]["SimpleItemMatcher"] | components["schemas"]["NotItemMatcher"] | components["schemas"]["AndItemMatcher"] | components["schemas"]["OrItemMatcher"]; /** * AndItemMatcher * @description **AndItemMatcher** * Evaluates to true when all children are evaluated to true. */ readonly AndItemMatcher: { /** @description Array of Item Matcher. */ readonly and?: readonly components["schemas"]["ItemMatcher2"][]; }; /** * OrItemMatcher * @description **OrItemMatcher** * Evaluates to true when one of its children are evaluated to true. */ readonly OrItemMatcher: { /** @description Array of Item Matcher. */ readonly or?: readonly components["schemas"]["ItemMatcher2"][]; }; /** * NotItemMatcher * @description **NotItemMatcher** * Evaluates to true when the child is evaluated to false. */ readonly NotItemMatcher: { readonly not?: components["schemas"]["ItemMatcher2"]; }; /** * Item Matcher * @description **ItemMatcher** * Lists which items to consider in the condition or action. If this is specified, you will need to also specify at least one of minimum_quantity or minimum_spend. */ readonly ItemMatcher2: components["schemas"]["SimpleItemMatcher"] | components["schemas"]["NotItemMatcher2"] | components["schemas"]["AndItemMatcher2"] | components["schemas"]["OrItemMatcher2"]; /** * AndItemMatcher * @description **AndItemMatcher** * Evaluates to true when all children are evaluated to true. */ readonly AndItemMatcher2: { /** @description Array of Item Matcher. */ readonly and?: readonly components["schemas"]["ItemMatcher3"][]; }; /** * OrItemMatcher * @description **OrItemMatcher** * Evaluates to true when one of its children are evaluated to true. */ readonly OrItemMatcher2: { /** @description Array of Item Matcher. */ readonly or?: readonly components["schemas"]["ItemMatcher3"][]; }; /** * NotItemMatcher * @description **NotItemMatcher** * Evaluates to true when the child is evaluated to false. */ readonly NotItemMatcher2: { readonly not?: components["schemas"]["ItemMatcher3"]; }; /** * Item Matcher * @description **ItemMatcher** * Lists which items to consider in the condition or action. If this is specified, you will need to also specify at least one of minimum_quantity or minimum_spend. */ readonly ItemMatcher3: components["schemas"]["SimpleItemMatcher"] | components["schemas"]["NotItemMatcher3"] | components["schemas"]["AndItemMatcher3"] | components["schemas"]["OrItemMatcher3"]; /** * AndItemMatcher * @description **AndItemMatcher** * Evaluates to true when all children are evaluated to true. */ readonly AndItemMatcher3: { /** @description Array of Item Matcher. */ readonly and?: readonly components["schemas"]["SimpleItemMatcher"][]; }; /** * OrItemMatcher * @description **OrItemMatcher** * Evaluates to true when one of its children are evaluated to true. */ readonly OrItemMatcher3: { /** @description Array of Item Matcher. */ readonly or?: readonly components["schemas"]["SimpleItemMatcher"][]; }; /** * NotItemMatcher * @description **NotItemMatcher** * Evaluates to true when the child is evaluated to false. */ readonly NotItemMatcher3: { readonly not?: components["schemas"]["SimpleItemMatcher"]; }; /** * Simple Item Matcher * @description **Simple Item Matcher** */ readonly SimpleItemMatcher: components["schemas"]["BrandsItemMatcher"] | components["schemas"]["CategoriesItemMatcher"] | components["schemas"]["ProductsItemMatcher"] | components["schemas"]["VariantsItemMatcher"] | components["schemas"]["ProductOptionsItemMatcher"] | components["schemas"]["ProductCustomFieldMatcher"]; /** * Brands Item Matcher * @description **BrandsItemMatcher** * Brands to which the items should belong. */ readonly BrandsItemMatcher: { /** * @description List of brand IDs. * @example [ * 1, * 2, * 3 * ] */ readonly brands?: readonly number[]; }; /** * Categories Item Matcher * @description **CategoriesItemMatcher** * Categories to which the items should belong. */ readonly CategoriesItemMatcher: { /** * @description List of category IDs. * @example [ * 1, * 2, * 3 * ] */ readonly categories?: readonly number[]; }; /** * Products Item Matcher * @description **Products Item Matcher** * Specific products which items should be from. */ readonly ProductsItemMatcher: { /** * @description List of product IDs. * @example [ * 1, * 2, * 3 * ] */ readonly products?: readonly number[]; }; /** * Variants Item Matcher * @description **Variants Item Matcher** * Product variants which items should be from. */ readonly VariantsItemMatcher: { /** * @description List of variant IDs. * @example [ * 1, * 2, * 3 * ] */ readonly variants?: readonly number[]; }; /** * Cart Value Action * @description **Cart Value Action** * Applies discount on the entire cart. */ readonly CartValueAction: { readonly cart_value?: { readonly discount: components["schemas"]["Discount"]; }; }; /** @description **Gift Item Action** * Give a gift item for free. */ readonly GiftItemAction: { readonly gift_item?: { /** @description Quantity of gift item to give. */ readonly quantity: number; /** @description Product ID of the gift item. */ readonly product_id?: number; /** @description Variant ID of the gift item. */ readonly variant_id?: number; }; }; /** * Fixed Price Set Action * @description **Fixed Price Set Action** * Sets a fixed price for a list of items. */ readonly FixedPriceSetAction: { readonly fixed_price_set?: { /** @description Quantity of items in the set that would receive the discount. */ readonly quantity: number; readonly fixed_price: components["schemas"]["Money"]; readonly items?: components["schemas"]["ItemMatcher"]; /** * @description If the shopper has multiple items in their cart that could be discounted by this action, strategy will determine which items are discounted, for example LEAST_EXPENSIVE will sort items in price ascending order and discount the cheapest item first. * @enum {string} */ readonly strategy?: "LEAST_EXPENSIVE" | "LEAST_EXPENSIVE_ONLY" | "MOST_EXPENSIVE" | "MOST_EXPENSIVE_ONLY"; /** @description Enable this option to prevent items already on sale from being further discounted. */ readonly exclude_items_on_sale?: boolean; /** * @description Setting this value to false enables you to exclude items used to satisfy the condition to be discounted. By default, items that are used to satisfy the condition are eligible to receive the discount. * @default true */ readonly include_items_considered_by_condition: boolean; }; }; /** * Cart Items Action * @description **Cart Items Action** * Applies discount on matching products in the cart. */ readonly CartItemsAction: { readonly cart_items?: { readonly discount: components["schemas"]["Discount"]; /** @description Set this value to true to distribute the discount as a total among matching items. By default, the discount applies to each item. * Example: If set to false, the discount is $10 and you have 2 eligible items for this discount in the cart, both items will be discounted by $10, with a total of $20 off the order. * If set to true, $10 will be distributed among the 2 items, weighted by their respective price. In a case where there are 2 of the same items, each item will be discounted by $5. */ readonly as_total?: boolean; readonly items?: components["schemas"]["ItemMatcher"]; /** @description Setting this value to true enables you to discount items that are used to satisfy the condition. By default items that are used to satisfy the condition are excluded from receiving the discount. For example, "Buy 1 Get 1 20% off." When the cart only contains 1 item, the discount won’t apply. */ readonly include_items_considered_by_condition?: boolean; /** @description Setting this value to true enables the option to prevent items already on sale from being further discounted. */ readonly exclude_items_on_sale?: boolean; /** * @description If the shopper has multiple items in their cart that could be discounted by this action, strategy will determine which items are discounted, for example LEAST_EXPENSIVE will sort items by their price in ascending order and discount the cheapest item first. * @enum {string} */ readonly strategy?: "LEAST_EXPENSIVE" | "LEAST_EXPENSIVE_ONLY" | "MOST_EXPENSIVE" | "MOST_EXPENSIVE_ONLY"; /** * @description Specifies a quantity of matching items to discount. If no quantity is specified, an infinite number of items can be discounted. * @example 2 */ readonly quantity?: number; /** @description The promotion will try to add a free item to the cart automatically, but if it cannot, it will discount a matching existing cart item by 100%. */ readonly add_free_item?: boolean; }; }; /** * Shipping Action * @description **Shipping Action** * Applies discount on shipping, optionally restricted to specific shipping zones. */ readonly ShippingAction: { readonly shipping?: { /** @description Set this property to true to provide a separate free shipping method. Read-Only. */ readonly free_shipping?: boolean; readonly zone_ids: "*" | readonly number[]; }; }; /** * Discount * @description **Discount** */ readonly Discount: components["schemas"]["FixedDiscount"] | components["schemas"]["PercentageDiscount"]; /** * Percentage Discount * @description **Percentage Discount** */ readonly PercentageDiscount: { /** @description The amount of discount (percentage off) to apply. */ readonly percentage_amount?: string; }; /** * Fixed Discount * @description **Fixed Discount** */ readonly FixedDiscount: { readonly fixed_amount?: components["schemas"]["Money"]; }; /** * Money * @description **Money** * Represents a monetary value in the store’s default currency. * @example 12.95 */ readonly Money: string; /** * Collection Meta * @description Contains data about paginating the response via cursors. If no pagination details are specified, then both properties will be present. When a 'before' or 'after' cursor is provided, only the 'cursor_pagination' property will be present. When a 'page' parameter is provided, only the offset based 'pagination' property will be present. * */ readonly OptionalCursorCollectionMeta: { readonly pagination?: components["schemas"]["DeprecatedPagination"]; readonly cursor_pagination?: components["schemas"]["CursorPagination"]; }; /** * Collection Meta * @description Contains data about the response including pagination and collection totals. */ readonly CollectionMeta: { readonly pagination: components["schemas"]["Pagination"]; }; /** * Pagination * @description Data about the response, including pagination and collection totals. */ readonly Pagination: { /** @description Total number of items in the result set. */ readonly total: number; /** @description Total number of items in the collection response. */ readonly count: number; /** @description The amount of items returned in the collection per page, controlled by the limit of items per page parameter. */ readonly per_page: number; /** @description The page you are currently on within the collection. */ readonly current_page: number; /** @description The total number of pages in the collection. */ readonly total_pages: number; /** @description Pagination links for the previous and next parts of the whole collection. */ readonly links: { /** @description Link to the previous page returned in the response. */ readonly previous?: string; /** @description Link to the current page returned in the response. */ readonly current?: string; /** @description Link to the next page returned in the response. */ readonly next?: string; }; }; /** * Pagination * @deprecated * @description Data about the response, including pagination and collection totals. This property has been deprecated and cursor_pagination should be used instead. * */ readonly DeprecatedPagination: { /** @description Total number of items in the result set. */ readonly total?: number; /** @description Total number of items in the collection response. */ readonly count?: number; /** @description The amount of items returned in the collection per page, controlled by the limit of items per page parameter. */ readonly per_page?: number; /** @description The page you are currently on within the collection. */ readonly current_page?: number; /** @description The total number of pages in the collection. */ readonly total_pages?: number; /** @description Pagination links for the previous and next parts of the whole collection. */ readonly links?: { /** @description Link to the previous page returned in the response. */ readonly previous?: string; /** @description Link to the current page returned in the response. */ readonly current?: string; /** @description Link to the next page returned in the response. */ readonly next?: string; }; }; /** * Cursor Pagination * @description Contains data about paginating the response via cursors. */ readonly CursorPagination: { /** * @description Total number of items in the result set. * @example 12 */ readonly count: number; /** * @description The amount of items returned in the collection per page, controlled by the limit of items per page parameter. * @example 12 */ readonly per_page: number; /** * @description The cursor to the first item in the result set. Can be used with the "before" query parameter to paginate backwards. This property is omitted when the result set is empty. * * @example eyJpZCI6IjIzNzU1NyJ9 */ readonly start_cursor?: string; /** * @description The cursor to the last item in the result set. Can be used with the "after" query parameter to paginate forwards. This property is omitted when the result set is empty. * * @example eyJpZCI6IjIzNzU1NyJ9 */ readonly end_cursor?: string; readonly links: { /** * @description Link to the previous page returned in the response. This property is omitted when the result set is empty or on the first page. * * @example ?limit=5&before=eyJpZCI6IjIzNzU1NyJ9 */ readonly previous?: string; /** * @description Link to the next page returned in the response. This property is omitted when the result set is empty. * * @example ?limit=5&after=eyJpZCI6IjIzNzU1NyJ9 */ readonly next?: string; }; }; /** Error Response */ readonly ErrorResponse: { readonly errors?: readonly components["schemas"]["Error"][]; }; /** Error */ readonly Error: { readonly status?: number; readonly title?: string; }; /** * 400 Error Response * @description The server cannot process the request because the syntax or data is invalid. */ readonly ErrorResponse400: { /** @description Bad request. */ readonly status?: string; /** @description The error title describing the particular error. */ readonly title?: string; /** @description Error payload for the BigCommerce API. */ readonly type?: string; /** @description Detailed summary describing the particular error. */ readonly detail?: string; }; /** * 403 Error Response * @description The client is authenticated but does not have the necessary permissions to perform the requested action. */ readonly ErrorResponse403: { /** @description Forbidden. */ readonly status?: string; /** @description The error title describing the particular error. */ readonly title?: string; /** @description Error payload for the BigCommerce API. */ readonly error?: string; }; /** * Notification * @description **Notification** * A notification displayed to the user based on the result of executing a promotion, for example, a "Congratulations! Youʼve received free shipping!" message when the shopper receives free shipping. */ readonly Notification: { /** * @description The notification content to be displayed to the user. * Data from the condition and action are available allowing the message to be customized. * @example Congratulations! Youʼve received a free %ACTION.FREE_PRODUCT%! */ readonly content: string; /** @enum {string} */ readonly type: "UPSELL" | "ELIGIBLE" | "APPLIED"; /** * @description Specifies where the notification message will be displayed. * @example [ * "HOME_PAGE", * "PRODUCT_PAGE", * "CART_PAGE", * "CHECKOUT_PAGE" * ] */ readonly locations: readonly string[]; }; /** * Action * @description **Action** */ readonly Action: components["schemas"]["CartValueAction"] | components["schemas"]["CartItemsAction"] | components["schemas"]["GiftItemAction"] | components["schemas"]["FixedPriceSetAction"] | components["schemas"]["ShippingAction"]; /** * Product Options Item Matcher * @description Match a product by product options. * * Currently the only supported type is `string_match` which performs a string comparison on the name and values. */ readonly ProductOptionsItemMatcher: { readonly product_option?: { /** @example string_match */ readonly type: string; /** @example Color */ readonly name: string; readonly values: readonly string[]; }; }; /** * Product Custom Field Item Matcher * @description Match a product with a custom field. * * You can define a maximum of 10 Product Custom Field Item Matchers within an Item Matcher. */ readonly ProductCustomFieldMatcher: { readonly product_custom_field?: { /** @example ISBN-10 */ readonly name: string; readonly values: readonly string[]; }; }; /** @description A `CouponCode` object encapsulates attributes of a coupon code. */ readonly CouponCode: { /** * @description An auto-generated unique identifier for the coupon code. * @example 1 */ readonly id: number; /** * @description A unique code that can be used to manually apply a discount. Only letters, numbers, white spaces, underscores and hyphens are allowed. * @example TEST-COUPON-CODE */ readonly code: string; /** * @description A read-only count of the times this coupon code has been used. * @example 2 */ readonly current_uses: number; /** * @description The maximum number of times you can use this coupon code. The default value is 0, which represents unlimited uses. * @example 10 */ readonly max_uses?: number; /** * @description The maximum number of times a specific customer can use this coupon code. The default value is 0, which represents unlimited uses. * @example 5 */ readonly max_uses_per_customer?: number; /** * Format: date-time * @description The date and time when this coupon code was created. * @example 2019-01-20T22:00:00.000Z */ readonly created: string; }; readonly BulkCouponCode: { /** * @description A unique, 16-character code that can be used to manually apply a discount. The code consists of randomly generated capital letters and numbers. * @example OMHYFQ4S26EY63UW */ readonly code?: string; }; /** * Bulk Action Response Meta * @description Contains data about the bulk action response including the number of total, failed and success. */ readonly BulkActionResponseMeta: { /** @description Total number of items in the bulk action. */ readonly total?: number; /** @description Number of items that processed successfully. */ readonly success?: number; /** @description Number of items that failed to process. */ readonly failed?: number; }; /** * Bulk Action Response Error * @description Contains data about the error of the bulk action. */ readonly BulkActionResponseError: { /** * @description HTTP Response status. * @example 422 */ readonly status?: number; /** * @description Title of the status * @example Some promotions failed to delete. */ readonly title?: string; /** * @description Explanation of the error type. * @example https://developer.bigcommerce.com/api-docs/getting-started/api-status-codes */ readonly type?: string; /** * @description List all per-item errors. Use an index of an item on a request to reference an error. The example shows the first and second item on a request that has caused an error. * @example { * "0.id": "Invalid ID", * "1.error": "Promotion cannot be deleted" * } */ readonly errors?: { readonly [key: string]: unknown; }; }; /** * CountryAddressMatcher * @description Specifies the countries which the promotion targets. */ readonly CountryAddressMatcher: { /** @description List of Country Rules */ readonly countries: readonly components["schemas"]["CountryRuleInfo"][]; }; /** * AddressMatcher * @description Specifies which addresses to consider. */ readonly AddressMatcher: components["schemas"]["CountryAddressMatcher"] | components["schemas"]["NotAddressMatcher"]; /** * NotAddressMatcher * @description Evaluates to `true` when the child is evaluated to `false`. */ readonly NotAddressMatcher: { readonly not: components["schemas"]["CountryAddressMatcher"]; }; /** * CountryRuleInfo * @description Country Rule */ readonly CountryRuleInfo: { /** * @description Specifies the country code, in ISO 3166-1 alpha-2 format. * @example US */ readonly iso2_country_code: string; }; /** * AvailabilityByWeekDay * @description Specifies the availability by weekdays. */ readonly AvailabilityByWeekDay: { /** * @description Specifies the recurrence, in number of weeks, during which the promotion is available (every "x" weeks). * @example 2 */ readonly week_frequency: number; /** @description Specifies the weekdays during which the promotion is available. */ readonly week_days: readonly ("Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday")[]; /** * Format: time * @description Specifies the time of day from which the promotion is available. * @example 01:20:00 */ readonly daily_start_time: string; /** * Format: time * @description Specifies the time of day until which the promotion is available. * @example 23:59:00 */ readonly daily_end_time: string; }; /** CustomerSegmentLimitation */ readonly CustomerSegmentLimitation: components["schemas"]["CustomerSegmentIdLimitation"] | components["schemas"]["NotCustomerSegmentLimitation"] | components["schemas"]["AndCustomerSegmentLimitation"] | components["schemas"]["OrCustomerSegmentLimitation"]; /** CustomerSegmentIdLimitation */ readonly CustomerSegmentIdLimitation: { /** @description An array of segment IDs. */ readonly id: readonly string[]; }; /** AndCustomerSegmentLimitation */ readonly AndCustomerSegmentLimitation: { readonly and: readonly components["schemas"]["CustomerSegmentLimitation2"][]; }; /** OrCustomerSegmentLimitation */ readonly OrCustomerSegmentLimitation: { readonly or: readonly components["schemas"]["CustomerSegmentLimitation2"][]; }; /** NotCustomerSegmentLimitation */ readonly NotCustomerSegmentLimitation: { readonly not: components["schemas"]["CustomerSegmentLimitation2"]; }; /** CustomerSegmentLimitation */ readonly CustomerSegmentLimitation2: components["schemas"]["CustomerSegmentIdLimitation"] | components["schemas"]["NotCustomerSegmentLimitation2"] | components["schemas"]["AndCustomerSegmentLimitation2"] | components["schemas"]["OrCustomerSegmentLimitation2"]; /** AndCustomerSegmentLimitation */ readonly AndCustomerSegmentLimitation2: { readonly and: readonly components["schemas"]["CustomerSegmentLimitation3"][]; }; /** OrCustomerSegmentLimitation */ readonly OrCustomerSegmentLimitation2: { readonly or: readonly components["schemas"]["CustomerSegmentLimitation3"][]; }; /** NotCustomerSegmentLimitation */ readonly NotCustomerSegmentLimitation2: { readonly not: components["schemas"]["CustomerSegmentLimitation3"]; }; /** CustomerSegmentLimitation */ readonly CustomerSegmentLimitation3: components["schemas"]["CustomerSegmentIdLimitation"] | components["schemas"]["NotCustomerSegmentLimitation3"] | components["schemas"]["AndCustomerSegmentLimitation3"] | components["schemas"]["OrCustomerSegmentLimitation3"]; /** AndCustomerSegmentLimitation */ readonly AndCustomerSegmentLimitation3: { readonly and: readonly components["schemas"]["CustomerSegmentIdLimitation"][]; }; /** OrCustomerSegmentLimitation */ readonly OrCustomerSegmentLimitation3: { readonly or: readonly components["schemas"]["CustomerSegmentIdLimitation"][]; }; /** NotCustomerSegmentLimitation */ readonly NotCustomerSegmentLimitation3: { readonly not: components["schemas"]["CustomerSegmentIdLimitation"]; }; /** Channel */ readonly Channel: { /** @example 1 */ readonly id: number; }; }; responses: { readonly BulkDeleteResponse: { headers: { readonly [name: string]: unknown; }; content: { readonly "application/json": { readonly errors?: readonly components["schemas"]["BulkActionResponseError"][]; readonly meta?: components["schemas"]["BulkActionResponseMeta"]; }; /** @example { * "errors": [ * { * "status": 422, * "title": "Parameter id:in is required", * "type": "https://developer.bigcommerce.com/api-docs/getting-started/api-status-codes" * } * ], * "meta": { * "total": 0, * "success": 0, * "failed": 0 * } * } */ readonly "422 - Missing Parameter": unknown; /** @example { * "errors": [ * { * "status": 422, * "title": "Errors occurred in bulk delete action.", * "type": "https://developer.bigcommerce.com/api-docs/getting-started/api-status-codes", * "errors": { * "0.constraint": "Failed for id=12. Error: constraint reference error.", * "2.code": "Failed for id=14. Error: some relating codes are still present." * } * } * ], * "meta": { * "total": 5, * "success": 3, * "failed": 2 * } * } */ readonly "422 - Error Deleting": unknown; }; }; readonly BulkCouponCodesResponse: { headers: { readonly [name: string]: unknown; }; content: { readonly "application/json": { readonly data?: { /** * Format: date-time * @description The date and time when the codes were created. * @example 2019-01-20T22:00:00+00:00 */ readonly created?: string; /** @description The maximum number of times each code can be used. */ readonly max_uses?: number; /** @description The maximum number of times each customer can use a code. */ readonly max_uses_per_customer?: number; /** @description The number of codes generated in the batch. */ readonly batch_size?: number; readonly codes?: readonly components["schemas"]["BulkCouponCode"][]; }; /** @description Empty meta object, which may be used at a later time. */ readonly meta?: Record; }; }; }; readonly PromotionCodeResponse: { headers: { readonly [name: string]: unknown; }; content: { readonly "application/json": { readonly data?: components["schemas"]["CouponCode"]; /** @description Empty meta object, which may be used at a later time. */ readonly meta?: Record; }; }; }; readonly PromotionCodesCollectionResponse: { headers: { readonly [name: string]: unknown; }; content: { readonly "application/json": { readonly data?: readonly components["schemas"]["CouponCode"][]; readonly meta?: components["schemas"]["OptionalCursorCollectionMeta"]; }; }; }; readonly PromotionsCollectionResponse: { headers: { readonly [name: string]: unknown; }; content: { readonly "application/json": { readonly data: readonly (components["schemas"]["SavedAutomaticPromotion"] | components["schemas"]["SavedCouponPromotion"])[]; readonly meta: components["schemas"]["CollectionMeta"]; }; }; }; readonly PromotionsResponse: { headers: { readonly [name: string]: unknown; }; content: { readonly "application/json": { readonly data?: components["schemas"]["SavedCouponPromotion"] | components["schemas"]["SavedAutomaticPromotion"]; /** @description Empty meta object, which may be used at a later time. */ readonly meta?: { readonly [key: string]: unknown; }; }; }; }; }; parameters: { /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */ readonly Accept: string; /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the request body. */ readonly ContentType: string; /** @description The ID of the promotion in question. */ readonly IdPath: string; /** @description The ID of the coupon code to delete. */ readonly CodeIdPath: string; /** @description Filter items by `id`. */ readonly IdQuery: number; /** @description A comma-separated list of promotions to filter or target with this operation. * * Example: **?id:in=11,12,13,14** */ readonly IdInQuery: readonly number[]; /** @description Query parameter that specifies the page number in a paginated list of resources. */ readonly PageQuery: number; /** * @deprecated * @description Query parameter that specifies the page number in a paginated list of resources. This field is deprecated and the 'before' and 'after' cursor parameters should be used instead. * */ readonly DeprecatedPageQuery: number; /** @description Query parameter that limits the number of items displayed per page in a paginated list of resources. When none is specified a default value of 50 is used. * */ readonly LimitQuery: number; /** @description Filter items by `name`. */ readonly NameQuery: string; /** @description Filter items by both name or code. */ readonly Query: string; /** @description Filter items by `code`. */ readonly CodeQuery: string; /** @description Filter items by `currency_code`. */ readonly CurrencyCodeQuery: string; /** @description Filter items by `redemption type` */ readonly RedemptionTypeQuery: "automatic" | "coupon"; /** @description Filter items by `status`. */ readonly StatusQuery: string; /** @description Query parameter that specifies the field name to sort by. The default value is *id*. */ readonly SortQuery: "id" | "name" | "priority" | "start_date"; /** @description Query parameter that specifies the sorting direction. The default value is *asc*. */ readonly DirectionQuery: "asc" | "desc"; /** @description The ID of the associated promotion. */ readonly PromotionIdPath: string; /** @description A cursor that can be used for backwards pagination. Will fetch results before the position corresponding to the cursor. Cannot be used with the 'page' query parameter. Cannot be used with the 'after' query parameter. * */ readonly BeforeCursorQuery: string; /** @description A cursor that can be used for forwards pagination. Will fetch results after the position corresponding to the cursor. Cannot be used with the 'page' query parameter. Cannot be used with the 'before' query parameter. * */ readonly AfterCursorQuery: string; /** @description Filter promotions that target those `channel IDs`. Example: **?channels=1,2**. Note: promotions that target all the channels are included in the filtering result. */ readonly ChannelQuery: readonly number[]; }; requestBodies: never; headers: never; pathItems: never; } export type $defs = Record; export interface operations { readonly getPromotions: { readonly parameters: { readonly query?: { /** @description Filter items by `id`. */ readonly id?: components["parameters"]["IdQuery"]; /** @description Filter items by `name`. */ readonly name?: components["parameters"]["NameQuery"]; /** @description Filter items by `code`. */ readonly code?: components["parameters"]["CodeQuery"]; /** @description Filter items by `currency_code`. */ readonly currency_code?: components["parameters"]["CurrencyCodeQuery"]; /** @description Filter items by `redemption type` */ readonly redemption_type?: components["parameters"]["RedemptionTypeQuery"]; /** @description Filter items by `status`. */ readonly status?: components["parameters"]["StatusQuery"]; /** @description Query parameter that specifies the page number in a paginated list of resources. */ readonly page?: components["parameters"]["PageQuery"]; /** @description Query parameter that limits the number of items displayed per page in a paginated list of resources. When none is specified a default value of 50 is used. * */ readonly limit?: components["parameters"]["LimitQuery"]; /** @description Query parameter that specifies the field name to sort by. The default value is *id*. */ readonly sort?: components["parameters"]["SortQuery"]; /** @description Query parameter that specifies the sorting direction. The default value is *asc*. */ readonly direction?: components["parameters"]["DirectionQuery"]; /** @description Filter promotions that target those `channel IDs`. Example: **?channels=1,2**. Note: promotions that target all the channels are included in the filtering result. */ readonly channels?: components["parameters"]["ChannelQuery"]; /** @description Filter items by both name or code. */ readonly query?: components["parameters"]["Query"]; }; readonly header?: { /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */ readonly Accept?: components["parameters"]["Accept"]; }; readonly path?: never; readonly cookie?: never; }; readonly requestBody?: never; readonly responses: { readonly 200: components["responses"]["PromotionsCollectionResponse"]; /** @description Failure due to an invalid query parameter. */ readonly 422: { headers: { readonly [name: string]: unknown; }; content: { readonly "application/json": components["schemas"]["ErrorResponse"]; }; }; }; }; readonly createPromotion: { readonly parameters: { readonly query?: never; readonly header?: { /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */ readonly Accept?: components["parameters"]["Accept"]; /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the request body. */ readonly "Content-Type"?: components["parameters"]["ContentType"]; }; readonly path?: never; readonly cookie?: never; }; readonly requestBody?: { readonly content: { readonly "application/json": components["schemas"]["DraftCouponPromotion"] | components["schemas"]["DraftAutomaticPromotion"]; }; }; readonly responses: { readonly 201: components["responses"]["PromotionsResponse"]; /** @description The request payload was invalid. */ readonly 400: { headers: { readonly [name: string]: unknown; }; content: { readonly "application/json": components["schemas"]["ErrorResponse400"]; }; }; /** @description The request payload was invalid. */ readonly 403: { headers: { readonly [name: string]: unknown; }; content: { readonly "application/json": components["schemas"]["ErrorResponse403"]; }; }; /** @description The request payload was invalid. */ readonly 422: { headers: { readonly [name: string]: unknown; }; content: { readonly "application/json": components["schemas"]["ErrorResponse"]; }; }; }; }; readonly deletePromotions: { readonly parameters: { readonly query: { /** @description A comma-separated list of promotions to filter or target with this operation. * * Example: **?id:in=11,12,13,14** */ readonly "id:in": components["parameters"]["IdInQuery"]; }; readonly header?: { /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */ readonly Accept?: components["parameters"]["Accept"]; }; readonly path?: never; readonly cookie?: never; }; readonly requestBody?: never; readonly responses: { /** @description A 204 response. */ readonly 204: { headers: { readonly [name: string]: unknown; }; content?: never; }; readonly 422: components["responses"]["BulkDeleteResponse"]; }; }; readonly getPromotion: { readonly parameters: { readonly query?: never; readonly header?: { /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */ readonly Accept?: components["parameters"]["Accept"]; }; readonly path: { /** @description The ID of the promotion in question. */ readonly id: components["parameters"]["IdPath"]; }; readonly cookie?: never; }; readonly requestBody?: never; readonly responses: { readonly 200: components["responses"]["PromotionsResponse"]; /** @description The requested resource was not found. */ readonly 404: { headers: { readonly [name: string]: unknown; }; content: { readonly "application/json": components["schemas"]["ErrorResponse"]; }; }; }; }; readonly updatePromotion: { readonly parameters: { readonly query?: never; readonly header?: { /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */ readonly Accept?: components["parameters"]["Accept"]; /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the request body. */ readonly "Content-Type"?: components["parameters"]["ContentType"]; }; readonly path: { /** @description The ID of the promotion in question. */ readonly id: components["parameters"]["IdPath"]; }; readonly cookie?: never; }; readonly requestBody?: { readonly content: { readonly "application/json": components["schemas"]["PatchCouponPromotion"] | components["schemas"]["PatchAutomaticPromotion"]; }; }; readonly responses: { readonly 200: components["responses"]["PromotionsResponse"]; /** @description The requested resource could not be found. */ readonly 404: { headers: { readonly [name: string]: unknown; }; content: { readonly "application/json": components["schemas"]["ErrorResponse"]; }; }; }; }; readonly deletePromotion: { readonly parameters: { readonly query?: never; readonly header?: { /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */ readonly Accept?: components["parameters"]["Accept"]; }; readonly path: { /** @description The ID of the promotion in question. */ readonly id: components["parameters"]["IdPath"]; }; readonly cookie?: never; }; readonly requestBody?: never; readonly responses: { /** @description The deletion was successful or the specified resource does not exist. */ readonly 204: { headers: { readonly [name: string]: unknown; }; content?: never; }; }; }; readonly getPromotionCodes: { readonly parameters: { readonly query?: { /** @description A cursor that can be used for backwards pagination. Will fetch results before the position corresponding to the cursor. Cannot be used with the 'page' query parameter. Cannot be used with the 'after' query parameter. * */ readonly before?: components["parameters"]["BeforeCursorQuery"]; /** @description A cursor that can be used for forwards pagination. Will fetch results after the position corresponding to the cursor. Cannot be used with the 'page' query parameter. Cannot be used with the 'before' query parameter. * */ readonly after?: components["parameters"]["AfterCursorQuery"]; /** * @deprecated * @description Query parameter that specifies the page number in a paginated list of resources. This field is deprecated and the 'before' and 'after' cursor parameters should be used instead. * */ readonly page?: components["parameters"]["DeprecatedPageQuery"]; /** @description Query parameter that limits the number of items displayed per page in a paginated list of resources. When none is specified a default value of 50 is used. * */ readonly limit?: components["parameters"]["LimitQuery"]; }; readonly header?: { /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */ readonly Accept?: components["parameters"]["Accept"]; }; readonly path: { /** @description The ID of the associated promotion. */ readonly promotion_id: components["parameters"]["PromotionIdPath"]; }; readonly cookie?: never; }; readonly requestBody?: never; readonly responses: { readonly 200: components["responses"]["PromotionCodesCollectionResponse"]; }; }; readonly createPromotionCode: { readonly parameters: { readonly query?: never; readonly header?: { /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */ readonly Accept?: components["parameters"]["Accept"]; /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the request body. */ readonly "Content-Type"?: components["parameters"]["ContentType"]; }; readonly path: { /** @description The ID of the associated promotion. */ readonly promotion_id: components["parameters"]["PromotionIdPath"]; }; readonly cookie?: never; }; readonly requestBody: { readonly content: { readonly "application/json": { /** @description A unique code that can be used to manually apply a discount. Only letters, numbers, white spaces, underscores, and hyphens are allowed. */ readonly code: string; /** * @description The maximum number of times you can use this coupon code. The default value is 0, which represents unlimited uses. The parent promotion's `max_uses` field overrides the coupon code's `max_uses` field. * @example 10 */ readonly max_uses?: number; /** * @description The maximum number of times a specific customer can use this coupon code. The default value is 0, which represents unlimited uses. * @example 5 */ readonly max_uses_per_customer?: number; }; }; }; readonly responses: { readonly 200: components["responses"]["PromotionCodeResponse"]; }; }; readonly deleteCouponCodes: { readonly parameters: { readonly query: { /** @description A comma-separated list of promotions to filter or target with this operation. * * Example: **?id:in=11,12,13,14** */ readonly "id:in": components["parameters"]["IdInQuery"]; }; readonly header?: { /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */ readonly Accept?: components["parameters"]["Accept"]; }; readonly path: { /** @description The ID of the associated promotion. */ readonly promotion_id: components["parameters"]["PromotionIdPath"]; }; readonly cookie?: never; }; readonly requestBody?: never; readonly responses: { /** @description A 204 response. */ readonly 204: { headers: { readonly [name: string]: unknown; }; content?: never; }; readonly 422: components["responses"]["BulkDeleteResponse"]; }; }; readonly generatePromotionCodesBatch: { readonly parameters: { readonly query?: never; readonly header?: { /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the request body. */ readonly "Content-Type"?: components["parameters"]["ContentType"]; /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */ readonly Accept?: components["parameters"]["Accept"]; }; readonly path: { /** @description The ID of the associated promotion. */ readonly promotion_id: components["parameters"]["PromotionIdPath"]; }; readonly cookie?: never; }; readonly requestBody: { readonly content: { readonly "application/json": { /** * @description The number of coupon codes to generate in each batch. The maximum value is 250. * @example 5 */ readonly batch_size: number; /** * @description The maximum number of times each coupon code can be used. The default value is 1. The value 0 means unlimited usage. * @example 10 */ readonly max_uses?: number; /** * @description The maximum number of times a specific customer can use each coupon code. The default value is 1. The value 0 means unlimited usage. * @example 5 */ readonly max_uses_per_customer?: number; }; }; }; readonly responses: { readonly 201: components["responses"]["BulkCouponCodesResponse"]; /** @description Invalid request. */ readonly 400: { headers: { readonly [name: string]: unknown; }; content: { readonly "application/json": components["schemas"]["ErrorResponse400"]; }; }; /** @description Forbidden. */ readonly 403: { headers: { readonly [name: string]: unknown; }; content: { readonly "application/json": components["schemas"]["ErrorResponse403"]; }; }; /** @description The request payload is invalid. */ readonly 422: { headers: { readonly [name: string]: unknown; }; content: { readonly "application/json": components["schemas"]["ErrorResponse"]; }; }; }; }; readonly deleteCouponCode: { readonly parameters: { readonly query?: never; readonly header?: { /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */ readonly Accept?: components["parameters"]["Accept"]; }; readonly path: { /** @description The ID of the associated promotion. */ readonly promotion_id: components["parameters"]["PromotionIdPath"]; /** @description The ID of the coupon code to delete. */ readonly code_id: components["parameters"]["CodeIdPath"]; }; readonly cookie?: never; }; readonly requestBody?: never; readonly responses: { /** @description The deletion was successful or the resource does not exist. */ readonly 204: { headers: { readonly [name: string]: unknown; }; content?: never; }; }; }; } type WithRequired = T & { [P in K]-?: T[P]; }; export {};