@salesforce/b2c-tooling-sdk 2.3.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/data/guides/enrichment.json +291 -0
  2. package/data/guides/index.json +426 -37
  3. package/data/schemas/dw.schema.json +590 -0
  4. package/data/tooling/index.json +18 -9
  5. package/dist/esm/cli/base-command.d.ts +20 -1
  6. package/dist/esm/cli/base-command.js +61 -11
  7. package/dist/esm/cli/base-command.js.map +1 -1
  8. package/dist/esm/cli/cartridge-command.js +2 -1
  9. package/dist/esm/cli/cartridge-command.js.map +1 -1
  10. package/dist/esm/cli/command-search.d.ts +85 -0
  11. package/dist/esm/cli/command-search.js +147 -0
  12. package/dist/esm/cli/command-search.js.map +1 -0
  13. package/dist/esm/cli/config.d.ts +10 -1
  14. package/dist/esm/cli/config.js +18 -9
  15. package/dist/esm/cli/config.js.map +1 -1
  16. package/dist/esm/cli/hooks.d.ts +13 -0
  17. package/dist/esm/cli/hooks.js +11 -0
  18. package/dist/esm/cli/hooks.js.map +1 -1
  19. package/dist/esm/cli/index.d.ts +2 -0
  20. package/dist/esm/cli/index.js +2 -0
  21. package/dist/esm/cli/index.js.map +1 -1
  22. package/dist/esm/cli/instance-command.d.ts +1 -0
  23. package/dist/esm/cli/instance-command.js +2 -1
  24. package/dist/esm/cli/instance-command.js.map +1 -1
  25. package/dist/esm/cli/mrt-command.d.ts +3 -2
  26. package/dist/esm/cli/mrt-command.js +4 -4
  27. package/dist/esm/cli/mrt-command.js.map +1 -1
  28. package/dist/esm/cli/oauth-command.d.ts +1 -0
  29. package/dist/esm/cli/ods-command.d.ts +1 -0
  30. package/dist/esm/cli/webdav-command.d.ts +1 -0
  31. package/dist/esm/clients/custom-apis.d.ts +36 -2
  32. package/dist/esm/clients/custom-apis.js +57 -4
  33. package/dist/esm/clients/custom-apis.js.map +1 -1
  34. package/dist/esm/clients/index.d.ts +1 -1
  35. package/dist/esm/clients/index.js +1 -1
  36. package/dist/esm/clients/index.js.map +1 -1
  37. package/dist/esm/clients/scapi-backend-utils.d.ts +15 -0
  38. package/dist/esm/clients/scapi-backend-utils.js +28 -1
  39. package/dist/esm/clients/scapi-backend-utils.js.map +1 -1
  40. package/dist/esm/clients/scapi-fallback-backend.js +2 -2
  41. package/dist/esm/clients/scapi-fallback-backend.js.map +1 -1
  42. package/dist/esm/clients/scapi-schemas.generated.d.ts +2 -2
  43. package/dist/esm/compat/dispatcher.js +2 -2
  44. package/dist/esm/compat/dispatcher.js.map +1 -1
  45. package/dist/esm/config/config-origins.d.ts +19 -0
  46. package/dist/esm/config/config-origins.js +11 -0
  47. package/dist/esm/config/config-origins.js.map +1 -0
  48. package/dist/esm/config/config-write.d.ts +86 -0
  49. package/dist/esm/config/config-write.js +296 -0
  50. package/dist/esm/config/config-write.js.map +1 -0
  51. package/dist/esm/config/dw-json-schema.d.ts +14 -0
  52. package/dist/esm/config/dw-json-schema.js +269 -0
  53. package/dist/esm/config/dw-json-schema.js.map +1 -0
  54. package/dist/esm/config/dw-json.d.ts +2 -0
  55. package/dist/esm/config/dw-json.js +10 -6
  56. package/dist/esm/config/dw-json.js.map +1 -1
  57. package/dist/esm/config/index.d.ts +13 -4
  58. package/dist/esm/config/index.js +8 -3
  59. package/dist/esm/config/index.js.map +1 -1
  60. package/dist/esm/config/instance-manager.d.ts +64 -28
  61. package/dist/esm/config/instance-manager.js +145 -63
  62. package/dist/esm/config/instance-manager.js.map +1 -1
  63. package/dist/esm/config/mapping.d.ts +5 -0
  64. package/dist/esm/config/mapping.js +20 -1
  65. package/dist/esm/config/mapping.js.map +1 -1
  66. package/dist/esm/config/project-environment.d.ts +62 -0
  67. package/dist/esm/config/project-environment.js +113 -0
  68. package/dist/esm/config/project-environment.js.map +1 -1
  69. package/dist/esm/config/resolver.d.ts +22 -0
  70. package/dist/esm/config/resolver.js +106 -37
  71. package/dist/esm/config/resolver.js.map +1 -1
  72. package/dist/esm/config/sources/dw-json-source.d.ts +9 -1
  73. package/dist/esm/config/sources/dw-json-source.js +59 -23
  74. package/dist/esm/config/sources/dw-json-source.js.map +1 -1
  75. package/dist/esm/config/sources/env-source.d.ts +70 -9
  76. package/dist/esm/config/sources/env-source.js +205 -47
  77. package/dist/esm/config/sources/env-source.js.map +1 -1
  78. package/dist/esm/config/sources/index.d.ts +1 -1
  79. package/dist/esm/config/sources/index.js +1 -1
  80. package/dist/esm/config/sources/index.js.map +1 -1
  81. package/dist/esm/config/types.d.ts +53 -3
  82. package/dist/esm/docs/search.js +3 -1
  83. package/dist/esm/docs/search.js.map +1 -1
  84. package/dist/esm/docs/types.d.ts +3 -1
  85. package/dist/esm/guidance/bundle.d.ts +33 -0
  86. package/dist/esm/guidance/bundle.js +268 -0
  87. package/dist/esm/guidance/bundle.js.map +1 -0
  88. package/dist/esm/guidance/catalog.d.ts +8 -1
  89. package/dist/esm/guidance/catalog.js +48 -6
  90. package/dist/esm/guidance/catalog.js.map +1 -1
  91. package/dist/esm/guidance/index.d.ts +1 -0
  92. package/dist/esm/guidance/index.js +1 -0
  93. package/dist/esm/guidance/index.js.map +1 -1
  94. package/dist/esm/guidance/types.d.ts +17 -1
  95. package/dist/esm/guidance/types.js.map +1 -1
  96. package/dist/esm/index.d.ts +1 -1
  97. package/dist/esm/index.js +1 -1
  98. package/dist/esm/index.js.map +1 -1
  99. package/dist/esm/operations/jobs/run-system-job.js +2 -2
  100. package/dist/esm/operations/jobs/run-system-job.js.map +1 -1
  101. package/dist/esm/plugins/discovery.js +2 -1
  102. package/dist/esm/plugins/discovery.js.map +1 -1
  103. package/dist/esm/scapi/catalog.d.ts +5 -2
  104. package/dist/esm/scapi/catalog.js.map +1 -1
  105. package/dist/esm/scapi/index.d.ts +6 -2
  106. package/dist/esm/scapi/index.js +4 -2
  107. package/dist/esm/scapi/index.js.map +1 -1
  108. package/dist/esm/scapi/live.d.ts +14 -3
  109. package/dist/esm/scapi/live.js +33 -5
  110. package/dist/esm/scapi/live.js.map +1 -1
  111. package/dist/esm/scapi/local.d.ts +26 -0
  112. package/dist/esm/scapi/local.js +143 -0
  113. package/dist/esm/scapi/local.js.map +1 -0
  114. package/dist/esm/scapi/request.d.ts +2 -2
  115. package/dist/esm/scapi/request.js +4 -2
  116. package/dist/esm/scapi/request.js.map +1 -1
  117. package/dist/esm/scapi/runtime.d.ts +5 -0
  118. package/dist/esm/scapi/runtime.js.map +1 -1
  119. package/dist/esm/scapi/schema-source.d.ts +90 -0
  120. package/dist/esm/scapi/schema-source.js +146 -0
  121. package/dist/esm/scapi/schema-source.js.map +1 -0
  122. package/dist/esm/scapi/worker-source.js +31 -7
  123. package/dist/esm/scapi/worker-source.js.map +1 -1
  124. package/dist/esm/telemetry/telemetry.d.ts +1 -0
  125. package/dist/esm/telemetry/telemetry.js +18 -1
  126. package/dist/esm/telemetry/telemetry.js.map +1 -1
  127. package/dist/esm/telemetry/types.d.ts +9 -0
  128. package/dist/esm/test-utils/config-isolation.js +21 -15
  129. package/dist/esm/test-utils/config-isolation.js.map +1 -1
  130. package/dist/esm/ux/agent-context.d.ts +69 -0
  131. package/dist/esm/ux/agent-context.js +133 -0
  132. package/dist/esm/ux/agent-context.js.map +1 -0
  133. package/dist/esm/ux/confirm.d.ts +27 -0
  134. package/dist/esm/ux/confirm.js +32 -0
  135. package/dist/esm/ux/confirm.js.map +1 -1
  136. package/dist/esm/ux/index.d.ts +2 -1
  137. package/dist/esm/ux/index.js +2 -1
  138. package/dist/esm/ux/index.js.map +1 -1
  139. package/node_modules/@salesforce/b2c-api-schemas/manifest.json +83 -42
  140. package/node_modules/@salesforce/b2c-api-schemas/package.json +1 -1
  141. package/node_modules/@salesforce/b2c-api-schemas/scapi/cdn/zones/v1.json +6798 -238
  142. package/node_modules/@salesforce/b2c-api-schemas/scapi/checkout/orders/v1.json +2296 -205
  143. package/node_modules/@salesforce/b2c-api-schemas/scapi/checkout/shopper-baskets/v1.json +5571 -666
  144. package/node_modules/@salesforce/b2c-api-schemas/scapi/checkout/shopper-baskets/v2.json +6062 -371
  145. package/node_modules/@salesforce/b2c-api-schemas/scapi/checkout/shopper-orders/v1.json +3426 -360
  146. package/node_modules/@salesforce/b2c-api-schemas/scapi/checkout/shopper-payments/v1.json +351 -99
  147. package/node_modules/@salesforce/b2c-api-schemas/scapi/configuration/cors/v1.json +172 -12
  148. package/node_modules/@salesforce/b2c-api-schemas/scapi/configuration/preferences/v1.json +1497 -111
  149. package/node_modules/@salesforce/b2c-api-schemas/scapi/configuration/shopper-configurations/v1.json +202 -36
  150. package/node_modules/@salesforce/b2c-api-schemas/scapi/configuration/timeouts/v1.json +79 -10
  151. package/node_modules/@salesforce/b2c-api-schemas/scapi/custom-object/custom-objects/v1.json +785 -49
  152. package/node_modules/@salesforce/b2c-api-schemas/scapi/custom-object/shopper-custom-objects/v1.json +191 -40
  153. package/node_modules/@salesforce/b2c-api-schemas/scapi/customer/customers/v1.json +1483 -107
  154. package/node_modules/@salesforce/b2c-api-schemas/scapi/customer/shopper-customers/v1.json +4854 -787
  155. package/node_modules/@salesforce/b2c-api-schemas/scapi/dx/custom-apis/v1.json +119 -15
  156. package/node_modules/@salesforce/b2c-api-schemas/scapi/dx/object-definitions/v1.json +1699 -80
  157. package/node_modules/@salesforce/b2c-api-schemas/scapi/dx/scapi-schemas/v1.json +252 -18
  158. package/node_modules/@salesforce/b2c-api-schemas/scapi/dx/scripts/v1.json +329 -23
  159. package/node_modules/@salesforce/b2c-api-schemas/scapi/experience/experiences/v1.json +4208 -234
  160. package/node_modules/@salesforce/b2c-api-schemas/scapi/experience/shopper-experience/v1.json +1591 -247
  161. package/node_modules/@salesforce/b2c-api-schemas/scapi/intelligence/analytics/v1.json +396 -8
  162. package/node_modules/@salesforce/b2c-api-schemas/scapi/inventory/availability/v1.json +1242 -69
  163. package/node_modules/@salesforce/b2c-api-schemas/scapi/inventory/impex/v1.json +2354 -248
  164. package/node_modules/@salesforce/b2c-api-schemas/scapi/inventory/reservation/v1.json +1550 -45
  165. package/node_modules/@salesforce/b2c-api-schemas/scapi/inventory/segmentation/v1.json +6615 -0
  166. package/node_modules/@salesforce/b2c-api-schemas/scapi/merchant/roles/v1.json +1520 -59
  167. package/node_modules/@salesforce/b2c-api-schemas/scapi/merchant/users/v1.json +397 -17
  168. package/node_modules/@salesforce/b2c-api-schemas/scapi/observability/metrics/v1.json +1241 -27
  169. package/node_modules/@salesforce/b2c-api-schemas/scapi/operation/jobs/v1.json +1069 -68
  170. package/node_modules/@salesforce/b2c-api-schemas/scapi/operation/replications/v1.json +410 -23
  171. package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/assignments/v1.json +502 -102
  172. package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/campaigns/v1.json +1112 -94
  173. package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/coupons/v1.json +820 -93
  174. package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/gift-certificates/v1.json +845 -92
  175. package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/promotions/v1.json +2716 -674
  176. package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/shopper-gift-certificates/v1.json +130 -47
  177. package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/shopper-promotions/v1.json +233 -63
  178. package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/source-code-groups/v1.json +630 -70
  179. package/node_modules/@salesforce/b2c-api-schemas/scapi/product/catalogs/v1.json +2886 -348
  180. package/node_modules/@salesforce/b2c-api-schemas/scapi/product/inventory-lists/v1.json +520 -19
  181. package/node_modules/@salesforce/b2c-api-schemas/scapi/product/price-books/v1.json +3115 -293
  182. package/node_modules/@salesforce/b2c-api-schemas/scapi/product/products/v1.json +3313 -138
  183. package/node_modules/@salesforce/b2c-api-schemas/scapi/product/shopper-availability/v1.json +266 -52
  184. package/node_modules/@salesforce/b2c-api-schemas/scapi/product/shopper-delivery-estimates/v1.json +256 -48
  185. package/node_modules/@salesforce/b2c-api-schemas/scapi/product/shopper-products/v1.json +1744 -306
  186. package/node_modules/@salesforce/b2c-api-schemas/scapi/search/shopper-search/v1.json +1661 -120
  187. package/node_modules/@salesforce/b2c-api-schemas/scapi/shopper/auth/v1.json +2174 -118
  188. package/node_modules/@salesforce/b2c-api-schemas/scapi/shopper/auth-admin/v1.json +1373 -24
  189. package/node_modules/@salesforce/b2c-api-schemas/scapi/shopper/consents/v1.json +531 -20
  190. package/node_modules/@salesforce/b2c-api-schemas/scapi/shopper/shopper-agents/v1.json +154 -6
  191. package/node_modules/@salesforce/b2c-api-schemas/scapi/shopper/shopper-consents/v1.json +596 -79
  192. package/node_modules/@salesforce/b2c-api-schemas/scapi/shopper/shopper-context/v1.json +456 -42
  193. package/node_modules/@salesforce/b2c-api-schemas/scapi/site/seo/v1.json +101 -23
  194. package/node_modules/@salesforce/b2c-api-schemas/scapi/site/shopper-seo/v1.json +184 -41
  195. package/node_modules/@salesforce/b2c-api-schemas/scapi/site/sites/v1.json +995 -47
  196. package/node_modules/@salesforce/b2c-api-schemas/scapi/store/shopper-stores/v1.json +370 -67
  197. package/node_modules/@salesforce/b2c-api-schemas/scapi/store/store-redirect-mappings/v1.json +319 -11
  198. package/node_modules/@salesforce/b2c-api-schemas/scapi/store/stores/v1.json +1109 -64
  199. package/node_modules/@salesforce/b2c-api-schemas/scapi/storefront/deployments/v1.json +1442 -0
  200. package/node_modules/@salesforce/b2c-api-schemas/scapi/storefront/environments/v1.json +4293 -0
  201. package/node_modules/@salesforce/b2c-api-schemas/scapi/storefront/storefronts/v1.json +1371 -0
  202. package/package.json +5 -2
  203. package/specs/scapi-schemas-v1.yaml +4 -1
@@ -2,7 +2,8 @@
2
2
  "openapi": "3.0.3",
3
3
  "info": {
4
4
  "title": "Promotions",
5
- "version": "1.0.36",
5
+ "description": "[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/promotions/promotions-oas-v1-public.yaml)\n\n# API Overview\n\nUse the Promotions API to create, update, delete, and search for promotion information on your site. Promotions are configured with rules that define the type of promotion, conditions, and discounts.\n\nThis API can be used to synchronize promotion data in the commerce platform with third-party promotion management systems. This API can also be called from a custom promotion management application. In sandbox environments, the Promotions API is useful for creating and updating test data, for example, with integration testing or as part of a continuous integration or continuous deployment process.\n\nFor more information, see [Campaigns and Promotions](https://help.salesforce.com/s/articleView?id=cc.b2c_campaigns_and_promotions.htm&type=5) in the B2C Commerce documentation.\n\n## Authentication & Authorization\n\nThe client requesting the promotion information must have access to the Promotion resource. For resource access, you must use a client ID and client secret from Account Manager to request an access token. The access token is used as a bearer token and added to the Authorization header of your API request. The client must first authenticate against Account Manager to log in.\n\nYou must include the relevant scope(s) in the client ID used to generate the token. For details, see [Authorization Scopes Catalog.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/auth-z-scope-catalog.html)\n\nFor detailed setup instructions, see [Authorization for Admin APIs](https://developer.salesforce.com/docs/commerce/commerce-api/guide/authorization-for-admin-apis.html).\n\n## Response Details\n\n### Timeouts\n\nAdmin API requests must respond within 60 seconds. If a response exceeds this threshold, an HTTP 504 status code is returned. For details, see [Timeouts and Limits.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/timeouts-limits.html)\n\n### Error Handling\n\nError responses follow the [RFC 7807](https://datatracker.ietf.org/doc/html/rfc7807) problem detail format. To trace errors, include a `correlation-id` header in your request — the response returns it as `x-correlation-id`. For details, see [HTTP Status Codes and Errors.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/error-response-codes.html)\n\n## Use Cases\n\n**Note**: A promotion can be created, enabled, and assigned exclusivity using the API, but qualifier and discounted criteria must be assigned in Business Manager.\n\n### Shipping Promotions\n\nUse the Promotions API to configure shipping promotions.\n\nYou can configure shipping promotions based on an order and on individual products or product combinations. You can also configure product-specific shipping cost (fixed or surcharge).\n\n**Note**: Product-related shipping discounts are considered product promotions.\n\nIn a multiple ship-to scenario, B2C Commerce determines which shipments use any of the discounted shipping methods and applies the discount from most expensive to least expensive until meeting the maximum applications limit, if specified.\n\nFor example, create a shipping promotion that gives the customer free shipping when their purchase exceeds $50.\n\nFor more detail, see [Shipping Promotions](https://help.salesforce.com/s/articleView?id=cc.b2c_shipping_promotions.htm&type=5) in the B2C Commerce documentation.\n\n### Product Promotions\n\nUse the Promotions API to configure product promotions.\n\nYou can define product promotions for specific products, groups of products or brands, or amounts of products purchased. You can define conditions that require customers to purchase from a set of products.\n\nA product promotion is prorated, calculated, and rounded once per product in the order. A product promotion is different than an order promotion, which is calculated once at the order level, and rounded off once, if necessary.\n\nFor example, create a product promotion that discounts a second item by 50% when the customer buys two.\n\nFor more detail, see [Product Promotions](https://help.salesforce.com/s/articleView?id=cc.b2c_product_promotions.htm&type=5) in the B2C Commerce documentation.\n\n### Order Promotions\n\nUse the Promotions API to configure order promotions.\n\nYou can configure order promotions for percentage discounts, fixed price discounts, and free shipping. You can offer a bonus product or a choice of bonus products, and you can tier order discounts.\n\nAn order promotion is calculated once at the order level, and rounded off once, if necessary. An order promotion is different than a product promotion, where the promotion is prorated, calculated, and rounded per product in the order.\n\nFor example, create an order promotion that discounts an entire order when the customer buys 3 qualifying items.\n\nFor more detail, see [Order Promotions](https://help.salesforce.com/s/articleView?id=cc.b2c_order_promotions.htm&type=5) in the B2C Commerce documentation.\n\n## Related APIs\n\n- [Shopper Promotions](https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-promotions?meta=Summary) — Retrieve active promotions visible to shoppers.\n- [Campaigns](https://developer.salesforce.com/docs/commerce/commerce-api/references/campaigns?meta=Summary) — Manage campaigns that group promotions.\n- [Assignments](https://developer.salesforce.com/docs/commerce/commerce-api/references/assignments?meta=Summary) — Assign promotions and discounts to campaigns.",
6
+ "version": "1.2.0",
6
7
  "x-api-type": "Admin",
7
8
  "x-api-family": "Pricing"
8
9
  },
@@ -11,6 +12,7 @@
11
12
  "url": "https://{shortCode}.api.commercecloud.salesforce.com/pricing/promotions/v1",
12
13
  "variables": {
13
14
  "shortCode": {
15
+ "description": "An eight-character string assigned to a realm for routing purposes. See [Base URL and Request Formation.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html)",
14
16
  "default": "shortCode"
15
17
  }
16
18
  }
@@ -19,26 +21,36 @@
19
21
  "paths": {
20
22
  "/organizations/{organizationId}/promotions": {
21
23
  "post": {
24
+ "summary": "Search for promotions.",
25
+ "description": "The SearchRequest document contains a search object that allows you to filter using various attributes.\n\nUse the following searchable query attributes to narrow down the search:\n\n | Attribute | Type |\n |-----------|--------|\n | id | String |\n | name | String |\n | currecyCode | String |\n | exclusivity | String |\n | enabled | Boolean |\n\nNote that only searchable attributes can be used in sorting. Additionally, the following attribute can be used to\nsort:\n\n | Attribute | Type |\n |-----------|--------|\n | promotionClass | String |",
22
26
  "operationId": "promotionsSearch",
23
27
  "parameters": [
24
28
  {
25
29
  "name": "organizationId",
26
30
  "in": "path",
31
+ "description": "An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).",
27
32
  "required": true,
28
33
  "style": "simple",
29
34
  "explode": false,
30
35
  "schema": {
31
36
  "$ref": "#/components/schemas/OrganizationId"
32
- }
37
+ },
38
+ "example": "f_ecom_zzxy_prd"
33
39
  },
34
40
  {
35
41
  "name": "siteId",
36
42
  "in": "query",
43
+ "description": "The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.",
37
44
  "required": true,
38
45
  "style": "form",
39
46
  "explode": true,
40
47
  "schema": {
41
48
  "$ref": "#/components/schemas/SiteId"
49
+ },
50
+ "examples": {
51
+ "SiteId": {
52
+ "value": "RefArch"
53
+ }
42
54
  }
43
55
  }
44
56
  ],
@@ -63,7 +75,7 @@
63
75
  }
64
76
  },
65
77
  "400": {
66
- "description": "Thrown when the query is ill-formed."
78
+ "description": "Returned when the query is ill-formed."
67
79
  }
68
80
  },
69
81
  "security": [
@@ -78,11 +90,13 @@
78
90
  },
79
91
  "/organizations/{organizationId}/promotions/{id}": {
80
92
  "get": {
93
+ "summary": "Retrieve promotion information.",
81
94
  "operationId": "getPromotion",
82
95
  "parameters": [
83
96
  {
84
97
  "name": "id",
85
98
  "in": "path",
99
+ "description": "The ID of the promotion to create.",
86
100
  "required": true,
87
101
  "style": "simple",
88
102
  "explode": false,
@@ -94,21 +108,29 @@
94
108
  {
95
109
  "name": "organizationId",
96
110
  "in": "path",
111
+ "description": "An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).",
97
112
  "required": true,
98
113
  "style": "simple",
99
114
  "explode": false,
100
115
  "schema": {
101
116
  "$ref": "#/components/schemas/OrganizationId"
102
- }
117
+ },
118
+ "example": "f_ecom_zzxy_prd"
103
119
  },
104
120
  {
105
121
  "name": "siteId",
106
122
  "in": "query",
123
+ "description": "The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.",
107
124
  "required": true,
108
125
  "style": "form",
109
126
  "explode": true,
110
127
  "schema": {
111
128
  "$ref": "#/components/schemas/SiteId"
129
+ },
130
+ "examples": {
131
+ "SiteId": {
132
+ "value": "RefArch"
133
+ }
112
134
  }
113
135
  }
114
136
  ],
@@ -119,16 +141,26 @@
119
141
  "application/json": {
120
142
  "schema": {
121
143
  "$ref": "#/components/schemas/Promotion"
144
+ },
145
+ "examples": {
146
+ "GetPromotion": {
147
+ "$ref": "#/components/examples/GetPromotion"
148
+ }
122
149
  }
123
150
  }
124
151
  }
125
152
  },
126
153
  "404": {
127
- "description": "Thrown when there is no promotion found for the specified ID for the requested site.",
154
+ "description": "Returned when there is no promotion found for the specified ID for the requested site.",
128
155
  "content": {
129
156
  "application/json": {
130
157
  "schema": {
131
158
  "$ref": "#/components/schemas/ErrorResponse"
159
+ },
160
+ "examples": {
161
+ "getPromotion404": {
162
+ "$ref": "#/components/examples/PromotionNotFound404"
163
+ }
132
164
  }
133
165
  }
134
166
  }
@@ -144,11 +176,13 @@
144
176
  ]
145
177
  },
146
178
  "put": {
179
+ "summary": "Create a promotion using the information provided.",
147
180
  "operationId": "createPromotion",
148
181
  "parameters": [
149
182
  {
150
183
  "name": "id",
151
184
  "in": "path",
185
+ "description": "The ID of the promotion to create.",
152
186
  "required": true,
153
187
  "style": "simple",
154
188
  "explode": false,
@@ -160,21 +194,29 @@
160
194
  {
161
195
  "name": "organizationId",
162
196
  "in": "path",
197
+ "description": "An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).",
163
198
  "required": true,
164
199
  "style": "simple",
165
200
  "explode": false,
166
201
  "schema": {
167
202
  "$ref": "#/components/schemas/OrganizationId"
168
- }
203
+ },
204
+ "example": "f_ecom_zzxy_prd"
169
205
  },
170
206
  {
171
207
  "name": "siteId",
172
208
  "in": "query",
209
+ "description": "The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.",
173
210
  "required": true,
174
211
  "style": "form",
175
212
  "explode": true,
176
213
  "schema": {
177
214
  "$ref": "#/components/schemas/SiteId"
215
+ },
216
+ "examples": {
217
+ "SiteId": {
218
+ "value": "RefArch"
219
+ }
178
220
  }
179
221
  }
180
222
  ],
@@ -183,6 +225,11 @@
183
225
  "application/json": {
184
226
  "schema": {
185
227
  "$ref": "#/components/schemas/Promotion"
228
+ },
229
+ "examples": {
230
+ "PutPromotion": {
231
+ "$ref": "#/components/examples/PutPromotion"
232
+ }
186
233
  }
187
234
  }
188
235
  }
@@ -194,16 +241,26 @@
194
241
  "application/json": {
195
242
  "schema": {
196
243
  "$ref": "#/components/schemas/Promotion"
244
+ },
245
+ "examples": {
246
+ "PutPromotion": {
247
+ "$ref": "#/components/examples/examples-PutPromotion"
248
+ }
197
249
  }
198
250
  }
199
251
  }
200
252
  },
201
253
  "400": {
202
- "description": "Thrown when the ID in the request does not match the ID in the document.",
254
+ "description": "Returned when the ID in the request does not match the ID in the document.",
203
255
  "content": {
204
256
  "application/json": {
205
257
  "schema": {
206
258
  "$ref": "#/components/schemas/ErrorResponse"
259
+ },
260
+ "examples": {
261
+ "IdConflict400": {
262
+ "$ref": "#/components/examples/IdConflict400"
263
+ }
207
264
  }
208
265
  }
209
266
  }
@@ -218,11 +275,13 @@
218
275
  ]
219
276
  },
220
277
  "delete": {
278
+ "summary": "Delete a promotion for a specified ID.",
221
279
  "operationId": "deletePromotion",
222
280
  "parameters": [
223
281
  {
224
282
  "name": "id",
225
283
  "in": "path",
284
+ "description": "The ID of the promotion to create.",
226
285
  "required": true,
227
286
  "style": "simple",
228
287
  "explode": false,
@@ -234,21 +293,29 @@
234
293
  {
235
294
  "name": "organizationId",
236
295
  "in": "path",
296
+ "description": "An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).",
237
297
  "required": true,
238
298
  "style": "simple",
239
299
  "explode": false,
240
300
  "schema": {
241
301
  "$ref": "#/components/schemas/OrganizationId"
242
- }
302
+ },
303
+ "example": "f_ecom_zzxy_prd"
243
304
  },
244
305
  {
245
306
  "name": "siteId",
246
307
  "in": "query",
308
+ "description": "The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.",
247
309
  "required": true,
248
310
  "style": "form",
249
311
  "explode": true,
250
312
  "schema": {
251
313
  "$ref": "#/components/schemas/SiteId"
314
+ },
315
+ "examples": {
316
+ "SiteId": {
317
+ "value": "RefArch"
318
+ }
252
319
  }
253
320
  }
254
321
  ],
@@ -266,11 +333,13 @@
266
333
  ]
267
334
  },
268
335
  "patch": {
336
+ "summary": "Update a promotion with the specified information.",
269
337
  "operationId": "updatePromotion",
270
338
  "parameters": [
271
339
  {
272
340
  "name": "id",
273
341
  "in": "path",
342
+ "description": "The ID of the promotion to create.",
274
343
  "required": true,
275
344
  "style": "simple",
276
345
  "explode": false,
@@ -282,21 +351,29 @@
282
351
  {
283
352
  "name": "organizationId",
284
353
  "in": "path",
354
+ "description": "An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).",
285
355
  "required": true,
286
356
  "style": "simple",
287
357
  "explode": false,
288
358
  "schema": {
289
359
  "$ref": "#/components/schemas/OrganizationId"
290
- }
360
+ },
361
+ "example": "f_ecom_zzxy_prd"
291
362
  },
292
363
  {
293
364
  "name": "siteId",
294
365
  "in": "query",
366
+ "description": "The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.",
295
367
  "required": true,
296
368
  "style": "form",
297
369
  "explode": true,
298
370
  "schema": {
299
371
  "$ref": "#/components/schemas/SiteId"
372
+ },
373
+ "examples": {
374
+ "SiteId": {
375
+ "value": "RefArch"
376
+ }
300
377
  }
301
378
  }
302
379
  ],
@@ -305,6 +382,11 @@
305
382
  "application/json": {
306
383
  "schema": {
307
384
  "$ref": "#/components/schemas/Promotion"
385
+ },
386
+ "examples": {
387
+ "PromotionsPatch": {
388
+ "$ref": "#/components/examples/PatchPromotion"
389
+ }
308
390
  }
309
391
  }
310
392
  }
@@ -316,16 +398,26 @@
316
398
  "application/json": {
317
399
  "schema": {
318
400
  "$ref": "#/components/schemas/Promotion"
401
+ },
402
+ "examples": {
403
+ "PutPromotion": {
404
+ "$ref": "#/components/examples/examples-PatchPromotion"
405
+ }
319
406
  }
320
407
  }
321
408
  }
322
409
  },
323
410
  "404": {
324
- "description": "Thrown when there is no promotion found with the given ID for the requested site.",
411
+ "description": "Returned when there is no promotion found with the given ID for the requested site.",
325
412
  "content": {
326
413
  "application/json": {
327
414
  "schema": {
328
415
  "$ref": "#/components/schemas/ErrorResponse"
416
+ },
417
+ "examples": {
418
+ "GetPromotion": {
419
+ "$ref": "#/components/examples/PromotionNotFound404"
420
+ }
329
421
  }
330
422
  }
331
423
  }
@@ -339,956 +431,2640 @@
339
431
  }
340
432
  ]
341
433
  }
342
- }
343
- },
344
- "components": {
345
- "schemas": {
346
- "OrganizationId": {
347
- "type": "string",
348
- "maxLength": 32,
349
- "minLength": 1
350
- },
351
- "SiteId": {
352
- "type": "string",
353
- "maxLength": 32,
354
- "minLength": 1
355
- },
356
- "Query": {
357
- "type": "object",
358
- "additionalProperties": false,
359
- "maxProperties": 1,
360
- "minProperties": 1,
361
- "properties": {
362
- "boolQuery": {
363
- "$ref": "#/components/schemas/BoolQuery"
364
- },
365
- "filteredQuery": {
366
- "$ref": "#/components/schemas/FilteredQuery"
367
- },
368
- "matchAllQuery": {
369
- "$ref": "#/components/schemas/MatchAllQuery"
370
- },
371
- "nestedQuery": {
372
- "$ref": "#/components/schemas/NestedQuery"
434
+ },
435
+ "/organizations/{organizationId}/promotions/{id}/discount-rule": {
436
+ "get": {
437
+ "summary": "Retrieve the discount rule for a promotion.",
438
+ "description": "Returns the discount rule, product qualifiers, and payment-method qualifiers for the promotion.",
439
+ "operationId": "getPromotionDiscountRule",
440
+ "parameters": [
441
+ {
442
+ "name": "id",
443
+ "in": "path",
444
+ "description": "The ID of the promotion to create.",
445
+ "required": true,
446
+ "style": "simple",
447
+ "explode": false,
448
+ "schema": {
449
+ "type": "string",
450
+ "minLength": 1
451
+ }
373
452
  },
374
- "termQuery": {
375
- "$ref": "#/components/schemas/TermQuery"
453
+ {
454
+ "name": "organizationId",
455
+ "in": "path",
456
+ "description": "An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).",
457
+ "required": true,
458
+ "style": "simple",
459
+ "explode": false,
460
+ "schema": {
461
+ "$ref": "#/components/schemas/OrganizationId"
462
+ },
463
+ "example": "f_ecom_zzxy_prd"
376
464
  },
377
- "textQuery": {
378
- "$ref": "#/components/schemas/TextQuery"
379
- }
380
- }
381
- },
382
- "BoolQuery": {
383
- "type": "object",
384
- "additionalProperties": false,
385
- "properties": {
386
- "must": {
387
- "type": "array",
388
- "items": {
389
- "$ref": "#/components/schemas/Query"
465
+ {
466
+ "name": "siteId",
467
+ "in": "query",
468
+ "description": "The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.",
469
+ "required": true,
470
+ "style": "form",
471
+ "explode": true,
472
+ "schema": {
473
+ "$ref": "#/components/schemas/SiteId"
474
+ },
475
+ "examples": {
476
+ "SiteId": {
477
+ "value": "RefArch"
478
+ }
390
479
  }
391
- },
392
- "mustNot": {
393
- "type": "array",
394
- "items": {
395
- "$ref": "#/components/schemas/Query"
480
+ }
481
+ ],
482
+ "responses": {
483
+ "200": {
484
+ "description": "Retrieved the discount rule successfully.",
485
+ "content": {
486
+ "application/json": {
487
+ "schema": {
488
+ "$ref": "#/components/schemas/DiscountRule"
489
+ },
490
+ "examples": {
491
+ "GetPromotionDiscountRule": {
492
+ "$ref": "#/components/examples/GetPromotionDiscountRule"
493
+ }
494
+ }
495
+ }
396
496
  }
397
497
  },
398
- "should": {
399
- "type": "array",
400
- "items": {
401
- "$ref": "#/components/schemas/Query"
498
+ "404": {
499
+ "description": "Returned when there is no promotion found for the specified ID for the requested site.",
500
+ "content": {
501
+ "application/json": {
502
+ "schema": {
503
+ "$ref": "#/components/schemas/ErrorResponse"
504
+ },
505
+ "examples": {
506
+ "getPromotionDiscountRule404": {
507
+ "$ref": "#/components/examples/PromotionNotFound404"
508
+ }
509
+ }
510
+ }
402
511
  }
403
512
  }
404
- }
513
+ },
514
+ "security": [
515
+ {
516
+ "AmOAuth2": [
517
+ "sfcc.promotions",
518
+ "sfcc.promotions.rw"
519
+ ]
520
+ }
521
+ ]
405
522
  },
406
- "Filter": {
407
- "type": "object",
408
- "additionalProperties": false,
409
- "maxProperties": 1,
410
- "minProperties": 1,
411
- "properties": {
412
- "boolFilter": {
413
- "$ref": "#/components/schemas/BoolFilter"
414
- },
415
- "queryFilter": {
416
- "$ref": "#/components/schemas/QueryFilter"
417
- },
418
- "range2Filter": {
419
- "$ref": "#/components/schemas/Range2Filter"
523
+ "put": {
524
+ "summary": "Create or replace the discount rule for a promotion.",
525
+ "description": "Replaces the entire discount rule, product qualifiers, and payment-method qualifiers for the promotion.",
526
+ "operationId": "createPromotionDiscountRule",
527
+ "parameters": [
528
+ {
529
+ "name": "id",
530
+ "in": "path",
531
+ "description": "The ID of the promotion to create.",
532
+ "required": true,
533
+ "style": "simple",
534
+ "explode": false,
535
+ "schema": {
536
+ "type": "string",
537
+ "minLength": 1
538
+ }
420
539
  },
421
- "rangeFilter": {
422
- "$ref": "#/components/schemas/RangeFilter"
540
+ {
541
+ "name": "organizationId",
542
+ "in": "path",
543
+ "description": "An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).",
544
+ "required": true,
545
+ "style": "simple",
546
+ "explode": false,
547
+ "schema": {
548
+ "$ref": "#/components/schemas/OrganizationId"
549
+ },
550
+ "example": "f_ecom_zzxy_prd"
423
551
  },
424
- "termFilter": {
425
- "$ref": "#/components/schemas/TermFilter"
552
+ {
553
+ "name": "siteId",
554
+ "in": "query",
555
+ "description": "The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.",
556
+ "required": true,
557
+ "style": "form",
558
+ "explode": true,
559
+ "schema": {
560
+ "$ref": "#/components/schemas/SiteId"
561
+ },
562
+ "examples": {
563
+ "SiteId": {
564
+ "value": "RefArch"
565
+ }
566
+ }
426
567
  }
427
- }
428
- },
429
- "BoolFilter": {
430
- "type": "object",
431
- "additionalProperties": false,
432
- "properties": {
433
- "filters": {
434
- "type": "array",
435
- "items": {
436
- "$ref": "#/components/schemas/Filter"
568
+ ],
569
+ "requestBody": {
570
+ "content": {
571
+ "application/json": {
572
+ "schema": {
573
+ "$ref": "#/components/schemas/DiscountRule"
574
+ },
575
+ "examples": {
576
+ "PutPromotionDiscountRule": {
577
+ "$ref": "#/components/examples/PutPromotionDiscountRule"
578
+ }
579
+ }
580
+ }
581
+ }
582
+ },
583
+ "responses": {
584
+ "200": {
585
+ "description": "Discount rule replaced successfully.",
586
+ "content": {
587
+ "application/json": {
588
+ "schema": {
589
+ "$ref": "#/components/schemas/DiscountRule"
590
+ },
591
+ "examples": {
592
+ "PutPromotionDiscountRule": {
593
+ "$ref": "#/components/examples/GetPromotionDiscountRule"
594
+ }
595
+ }
596
+ }
437
597
  }
438
598
  },
439
- "operator": {
440
- "type": "string",
441
- "enum": [
442
- "and",
443
- "or",
444
- "not"
445
- ]
599
+ "201": {
600
+ "description": "Discount rule created successfully.",
601
+ "content": {
602
+ "application/json": {
603
+ "schema": {
604
+ "$ref": "#/components/schemas/DiscountRule"
605
+ },
606
+ "examples": {
607
+ "PutPromotionDiscountRule": {
608
+ "$ref": "#/components/examples/GetPromotionDiscountRule"
609
+ }
610
+ }
611
+ }
612
+ }
613
+ },
614
+ "404": {
615
+ "description": "Returned when there is no promotion found for the specified ID for the requested site.",
616
+ "content": {
617
+ "application/json": {
618
+ "schema": {
619
+ "$ref": "#/components/schemas/ErrorResponse"
620
+ },
621
+ "examples": {
622
+ "putPromotionDiscountRule404": {
623
+ "$ref": "#/components/examples/PromotionNotFound404"
624
+ }
625
+ }
626
+ }
627
+ }
446
628
  }
447
629
  },
448
- "required": [
449
- "operator"
630
+ "security": [
631
+ {
632
+ "AmOAuth2": [
633
+ "sfcc.promotions.rw"
634
+ ]
635
+ }
636
+ ]
637
+ },
638
+ "delete": {
639
+ "summary": "Delete the discount rule for a promotion.",
640
+ "description": "Removes the discount rule and its qualifiers from the promotion, resetting it to a shell with no discount configuration.",
641
+ "operationId": "deletePromotionDiscountRule",
642
+ "parameters": [
643
+ {
644
+ "name": "id",
645
+ "in": "path",
646
+ "description": "The ID of the promotion to create.",
647
+ "required": true,
648
+ "style": "simple",
649
+ "explode": false,
650
+ "schema": {
651
+ "type": "string",
652
+ "minLength": 1
653
+ }
654
+ },
655
+ {
656
+ "name": "organizationId",
657
+ "in": "path",
658
+ "description": "An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).",
659
+ "required": true,
660
+ "style": "simple",
661
+ "explode": false,
662
+ "schema": {
663
+ "$ref": "#/components/schemas/OrganizationId"
664
+ },
665
+ "example": "f_ecom_zzxy_prd"
666
+ },
667
+ {
668
+ "name": "siteId",
669
+ "in": "query",
670
+ "description": "The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.",
671
+ "required": true,
672
+ "style": "form",
673
+ "explode": true,
674
+ "schema": {
675
+ "$ref": "#/components/schemas/SiteId"
676
+ },
677
+ "examples": {
678
+ "SiteId": {
679
+ "value": "RefArch"
680
+ }
681
+ }
682
+ }
683
+ ],
684
+ "responses": {
685
+ "204": {
686
+ "description": "Deleted the discount rule successfully."
687
+ },
688
+ "404": {
689
+ "description": "Returned when there is no promotion found for the specified ID for the requested site.",
690
+ "content": {
691
+ "application/json": {
692
+ "schema": {
693
+ "$ref": "#/components/schemas/ErrorResponse"
694
+ },
695
+ "examples": {
696
+ "deletePromotionDiscountRule404": {
697
+ "$ref": "#/components/examples/PromotionNotFound404"
698
+ }
699
+ }
700
+ }
701
+ }
702
+ }
703
+ },
704
+ "security": [
705
+ {
706
+ "AmOAuth2": [
707
+ "sfcc.promotions.rw"
708
+ ]
709
+ }
710
+ ]
711
+ },
712
+ "patch": {
713
+ "summary": "Update the discount rule for a promotion.",
714
+ "description": "Updates the discount rule, product qualifiers, or payment-method qualifiers for the promotion. The merge is at\n top-level-section granularity: any of promotionRule, qualifyingProducts, discountedProducts, excludedProducts, or\n paymentMethodQualifiers that is omitted is left unchanged, and any that is supplied fully replaces that section.\n In particular a supplied promotionRule replaces the entire rule - send the complete rule (including all tiers) to\n preserve tiers, since a promotionRule that omits tiers clears them. It is not a field-level (deep) merge.",
715
+ "operationId": "updatePromotionDiscountRule",
716
+ "parameters": [
717
+ {
718
+ "name": "id",
719
+ "in": "path",
720
+ "description": "The ID of the promotion to create.",
721
+ "required": true,
722
+ "style": "simple",
723
+ "explode": false,
724
+ "schema": {
725
+ "type": "string",
726
+ "minLength": 1
727
+ }
728
+ },
729
+ {
730
+ "name": "organizationId",
731
+ "in": "path",
732
+ "description": "An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).",
733
+ "required": true,
734
+ "style": "simple",
735
+ "explode": false,
736
+ "schema": {
737
+ "$ref": "#/components/schemas/OrganizationId"
738
+ },
739
+ "example": "f_ecom_zzxy_prd"
740
+ },
741
+ {
742
+ "name": "siteId",
743
+ "in": "query",
744
+ "description": "The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.",
745
+ "required": true,
746
+ "style": "form",
747
+ "explode": true,
748
+ "schema": {
749
+ "$ref": "#/components/schemas/SiteId"
750
+ },
751
+ "examples": {
752
+ "SiteId": {
753
+ "value": "RefArch"
754
+ }
755
+ }
756
+ }
757
+ ],
758
+ "requestBody": {
759
+ "content": {
760
+ "application/json": {
761
+ "schema": {
762
+ "$ref": "#/components/schemas/DiscountRule"
763
+ },
764
+ "examples": {
765
+ "PatchPromotionDiscountRule": {
766
+ "$ref": "#/components/examples/PatchPromotionDiscountRule"
767
+ }
768
+ }
769
+ }
770
+ }
771
+ },
772
+ "responses": {
773
+ "200": {
774
+ "description": "Discount rule updated successfully.",
775
+ "content": {
776
+ "application/json": {
777
+ "schema": {
778
+ "$ref": "#/components/schemas/DiscountRule"
779
+ },
780
+ "examples": {
781
+ "PatchPromotionDiscountRule": {
782
+ "$ref": "#/components/examples/GetPromotionDiscountRule"
783
+ }
784
+ }
785
+ }
786
+ }
787
+ },
788
+ "404": {
789
+ "description": "Returned when there is no promotion found for the specified ID for the requested site.",
790
+ "content": {
791
+ "application/json": {
792
+ "schema": {
793
+ "$ref": "#/components/schemas/ErrorResponse"
794
+ },
795
+ "examples": {
796
+ "patchPromotionDiscountRule404": {
797
+ "$ref": "#/components/examples/PromotionNotFound404"
798
+ }
799
+ }
800
+ }
801
+ }
802
+ }
803
+ },
804
+ "security": [
805
+ {
806
+ "AmOAuth2": [
807
+ "sfcc.promotions.rw"
808
+ ]
809
+ }
810
+ ]
811
+ }
812
+ },
813
+ "/organizations/{organizationId}/promotions/{id}/compatibility": {
814
+ "get": {
815
+ "summary": "Retrieve the compatibility settings for a promotion.",
816
+ "description": "Returns the stacking / exclusivity settings that control how this promotion combines with other promotions.",
817
+ "operationId": "getPromotionCompatibility",
818
+ "parameters": [
819
+ {
820
+ "name": "id",
821
+ "in": "path",
822
+ "description": "The ID of the promotion to create.",
823
+ "required": true,
824
+ "style": "simple",
825
+ "explode": false,
826
+ "schema": {
827
+ "type": "string",
828
+ "minLength": 1
829
+ }
830
+ },
831
+ {
832
+ "name": "organizationId",
833
+ "in": "path",
834
+ "description": "An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).",
835
+ "required": true,
836
+ "style": "simple",
837
+ "explode": false,
838
+ "schema": {
839
+ "$ref": "#/components/schemas/OrganizationId"
840
+ },
841
+ "example": "f_ecom_zzxy_prd"
842
+ },
843
+ {
844
+ "name": "siteId",
845
+ "in": "query",
846
+ "description": "The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.",
847
+ "required": true,
848
+ "style": "form",
849
+ "explode": true,
850
+ "schema": {
851
+ "$ref": "#/components/schemas/SiteId"
852
+ },
853
+ "examples": {
854
+ "SiteId": {
855
+ "value": "RefArch"
856
+ }
857
+ }
858
+ }
859
+ ],
860
+ "responses": {
861
+ "200": {
862
+ "description": "Retrieved the compatibility settings successfully.",
863
+ "content": {
864
+ "application/json": {
865
+ "schema": {
866
+ "$ref": "#/components/schemas/PromotionCompatibility"
867
+ },
868
+ "examples": {
869
+ "GetPromotionCompatibility": {
870
+ "$ref": "#/components/examples/GetPromotionCompatibility"
871
+ }
872
+ }
873
+ }
874
+ }
875
+ },
876
+ "404": {
877
+ "description": "Returned when there is no promotion found for the specified ID for the requested site.",
878
+ "content": {
879
+ "application/json": {
880
+ "schema": {
881
+ "$ref": "#/components/schemas/ErrorResponse"
882
+ },
883
+ "examples": {
884
+ "getPromotionCompatibility404": {
885
+ "$ref": "#/components/examples/PromotionNotFound404"
886
+ }
887
+ }
888
+ }
889
+ }
890
+ }
891
+ },
892
+ "security": [
893
+ {
894
+ "AmOAuth2": [
895
+ "sfcc.promotions",
896
+ "sfcc.promotions.rw"
897
+ ]
898
+ }
899
+ ]
900
+ },
901
+ "put": {
902
+ "summary": "Create or replace the compatibility settings for a promotion.",
903
+ "description": "Replaces the stacking / exclusivity settings for the promotion.",
904
+ "operationId": "createPromotionCompatibility",
905
+ "parameters": [
906
+ {
907
+ "name": "id",
908
+ "in": "path",
909
+ "description": "The ID of the promotion to create.",
910
+ "required": true,
911
+ "style": "simple",
912
+ "explode": false,
913
+ "schema": {
914
+ "type": "string",
915
+ "minLength": 1
916
+ }
917
+ },
918
+ {
919
+ "name": "organizationId",
920
+ "in": "path",
921
+ "description": "An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).",
922
+ "required": true,
923
+ "style": "simple",
924
+ "explode": false,
925
+ "schema": {
926
+ "$ref": "#/components/schemas/OrganizationId"
927
+ },
928
+ "example": "f_ecom_zzxy_prd"
929
+ },
930
+ {
931
+ "name": "siteId",
932
+ "in": "query",
933
+ "description": "The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.",
934
+ "required": true,
935
+ "style": "form",
936
+ "explode": true,
937
+ "schema": {
938
+ "$ref": "#/components/schemas/SiteId"
939
+ },
940
+ "examples": {
941
+ "SiteId": {
942
+ "value": "RefArch"
943
+ }
944
+ }
945
+ }
946
+ ],
947
+ "requestBody": {
948
+ "content": {
949
+ "application/json": {
950
+ "schema": {
951
+ "$ref": "#/components/schemas/PromotionCompatibility"
952
+ },
953
+ "examples": {
954
+ "PutPromotionCompatibility": {
955
+ "$ref": "#/components/examples/PutPromotionCompatibility"
956
+ }
957
+ }
958
+ }
959
+ }
960
+ },
961
+ "responses": {
962
+ "200": {
963
+ "description": "Compatibility settings replaced successfully.",
964
+ "content": {
965
+ "application/json": {
966
+ "schema": {
967
+ "$ref": "#/components/schemas/PromotionCompatibility"
968
+ },
969
+ "examples": {
970
+ "PutPromotionCompatibility": {
971
+ "$ref": "#/components/examples/GetPromotionCompatibility"
972
+ }
973
+ }
974
+ }
975
+ }
976
+ },
977
+ "201": {
978
+ "description": "Compatibility settings created successfully.",
979
+ "content": {
980
+ "application/json": {
981
+ "schema": {
982
+ "$ref": "#/components/schemas/PromotionCompatibility"
983
+ },
984
+ "examples": {
985
+ "PutPromotionCompatibility": {
986
+ "$ref": "#/components/examples/GetPromotionCompatibility"
987
+ }
988
+ }
989
+ }
990
+ }
991
+ },
992
+ "404": {
993
+ "description": "Returned when there is no promotion found for the specified ID for the requested site.",
994
+ "content": {
995
+ "application/json": {
996
+ "schema": {
997
+ "$ref": "#/components/schemas/ErrorResponse"
998
+ },
999
+ "examples": {
1000
+ "putPromotionCompatibility404": {
1001
+ "$ref": "#/components/examples/PromotionNotFound404"
1002
+ }
1003
+ }
1004
+ }
1005
+ }
1006
+ }
1007
+ },
1008
+ "security": [
1009
+ {
1010
+ "AmOAuth2": [
1011
+ "sfcc.promotions.rw"
1012
+ ]
1013
+ }
1014
+ ]
1015
+ },
1016
+ "patch": {
1017
+ "summary": "Update the compatibility settings for a promotion.",
1018
+ "description": "Partially updates the stacking / exclusivity settings for the promotion. Each field (exclusivity, exclusivityGroup,\n combinablePromotions, mutuallyExclusivePromotions) that is omitted is left unchanged. A supplied\n combinablePromotions or mutuallyExclusivePromotions replaces that list wholesale - the entries are not merged into\n the existing list, so send the complete list.",
1019
+ "operationId": "updatePromotionCompatibility",
1020
+ "parameters": [
1021
+ {
1022
+ "name": "id",
1023
+ "in": "path",
1024
+ "description": "The ID of the promotion to create.",
1025
+ "required": true,
1026
+ "style": "simple",
1027
+ "explode": false,
1028
+ "schema": {
1029
+ "type": "string",
1030
+ "minLength": 1
1031
+ }
1032
+ },
1033
+ {
1034
+ "name": "organizationId",
1035
+ "in": "path",
1036
+ "description": "An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).",
1037
+ "required": true,
1038
+ "style": "simple",
1039
+ "explode": false,
1040
+ "schema": {
1041
+ "$ref": "#/components/schemas/OrganizationId"
1042
+ },
1043
+ "example": "f_ecom_zzxy_prd"
1044
+ },
1045
+ {
1046
+ "name": "siteId",
1047
+ "in": "query",
1048
+ "description": "The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.",
1049
+ "required": true,
1050
+ "style": "form",
1051
+ "explode": true,
1052
+ "schema": {
1053
+ "$ref": "#/components/schemas/SiteId"
1054
+ },
1055
+ "examples": {
1056
+ "SiteId": {
1057
+ "value": "RefArch"
1058
+ }
1059
+ }
1060
+ }
1061
+ ],
1062
+ "requestBody": {
1063
+ "content": {
1064
+ "application/json": {
1065
+ "schema": {
1066
+ "$ref": "#/components/schemas/PromotionCompatibility"
1067
+ },
1068
+ "examples": {
1069
+ "PatchPromotionCompatibility": {
1070
+ "$ref": "#/components/examples/PatchPromotionCompatibility"
1071
+ }
1072
+ }
1073
+ }
1074
+ }
1075
+ },
1076
+ "responses": {
1077
+ "200": {
1078
+ "description": "Compatibility settings updated successfully.",
1079
+ "content": {
1080
+ "application/json": {
1081
+ "schema": {
1082
+ "$ref": "#/components/schemas/PromotionCompatibility"
1083
+ },
1084
+ "examples": {
1085
+ "PatchPromotionCompatibility": {
1086
+ "$ref": "#/components/examples/GetPromotionCompatibility"
1087
+ }
1088
+ }
1089
+ }
1090
+ }
1091
+ },
1092
+ "404": {
1093
+ "description": "Returned when there is no promotion found for the specified ID for the requested site.",
1094
+ "content": {
1095
+ "application/json": {
1096
+ "schema": {
1097
+ "$ref": "#/components/schemas/ErrorResponse"
1098
+ },
1099
+ "examples": {
1100
+ "patchPromotionCompatibility404": {
1101
+ "$ref": "#/components/examples/PromotionNotFound404"
1102
+ }
1103
+ }
1104
+ }
1105
+ }
1106
+ }
1107
+ },
1108
+ "security": [
1109
+ {
1110
+ "AmOAuth2": [
1111
+ "sfcc.promotions.rw"
1112
+ ]
1113
+ }
1114
+ ]
1115
+ }
1116
+ }
1117
+ },
1118
+ "components": {
1119
+ "schemas": {
1120
+ "OrganizationId": {
1121
+ "type": "string",
1122
+ "description": "An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).",
1123
+ "example": "f_ecom_zzxy_prd",
1124
+ "pattern": "^f_ecom_[a-z]{4}_(prd|stg|dev|s[0-9]{2}|[0-9]{3})$"
1125
+ },
1126
+ "SiteId": {
1127
+ "type": "string",
1128
+ "description": "The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites",
1129
+ "example": "RefArch",
1130
+ "maxLength": 32,
1131
+ "minLength": 1
1132
+ },
1133
+ "Query": {
1134
+ "type": "object",
1135
+ "additionalProperties": false,
1136
+ "description": "A set of objects that define criteria used to select records. A query can contain one of the following:\n* `MatchAllQuery`\n - Matches all documents.\n* `TermQuery`\n - Matches one or more documents against one or more document fields.\n* `TextQuery`\n - Matches text against one or more fields.\n* `BoolQuery`\n - Allows construction of a logical expression of multiple queries.\n* `FilteredQuery`\n - Allows a filter to be applied to a query.\n* `NestedQuery`\n - Allows you to query on nested documents.\n - _Only supported by some Commerce APIs. For more details, see the endpoint descriptions in the API documentation._",
1137
+ "example": {
1138
+ "filteredQuery": {
1139
+ "query": {
1140
+ "textQuery": {
1141
+ "fields": [
1142
+ "couponId"
1143
+ ],
1144
+ "searchPhrase": "disabled"
1145
+ }
1146
+ },
1147
+ "filter": {
1148
+ "termFilter": {
1149
+ "field": "enabled",
1150
+ "operator": "is",
1151
+ "values": [
1152
+ false
1153
+ ]
1154
+ }
1155
+ }
1156
+ }
1157
+ },
1158
+ "maxProperties": 1,
1159
+ "minProperties": 1,
1160
+ "properties": {
1161
+ "boolQuery": {
1162
+ "$ref": "#/components/schemas/BoolQuery"
1163
+ },
1164
+ "filteredQuery": {
1165
+ "$ref": "#/components/schemas/FilteredQuery"
1166
+ },
1167
+ "matchAllQuery": {
1168
+ "$ref": "#/components/schemas/MatchAllQuery"
1169
+ },
1170
+ "nestedQuery": {
1171
+ "$ref": "#/components/schemas/NestedQuery"
1172
+ },
1173
+ "termQuery": {
1174
+ "$ref": "#/components/schemas/TermQuery"
1175
+ },
1176
+ "textQuery": {
1177
+ "$ref": "#/components/schemas/TextQuery"
1178
+ }
1179
+ }
1180
+ },
1181
+ "BoolQuery": {
1182
+ "type": "object",
1183
+ "additionalProperties": false,
1184
+ "description": "A boolean query allows construction of full logical expression trees that are composed of other queries (usually term queries and text queries). A boolean query has three sets of clauses:\n \n - `must`, which combines as an `AND` operator.\n - `should`, which combines as an `OR` operator.\n - `must_not`, which combines as a `NOT` operator.\n \nIf `must`, `mustNot`, or `should` appear in the same boolean query, they are combined logically using the `AND` operator. For example:\n\n (must-1 AND must-1 AND ...)\n AND (should-1 OR should-2 OR ...)\n AND NOT (must_not-1 OR must_not-2 OR ...)\n",
1185
+ "example": {
1186
+ "must": [
1187
+ {
1188
+ "textQuery": {
1189
+ "fields": [
1190
+ "couponId"
1191
+ ],
1192
+ "searchPhrase": "DEAL"
1193
+ }
1194
+ },
1195
+ {
1196
+ "textQuery": {
1197
+ "fields": [
1198
+ "description"
1199
+ ],
1200
+ "searchPhrase": "Big bargain deal"
1201
+ }
1202
+ }
1203
+ ],
1204
+ "mustNot": [
1205
+ {
1206
+ "termQuery": {
1207
+ "fields": [
1208
+ "enabled"
1209
+ ],
1210
+ "operator": "is",
1211
+ "values": [
1212
+ false
1213
+ ]
1214
+ }
1215
+ }
1216
+ ]
1217
+ },
1218
+ "properties": {
1219
+ "must": {
1220
+ "type": "array",
1221
+ "description": "List of queries to be evaluated as an `AND` operator.",
1222
+ "items": {
1223
+ "$ref": "#/components/schemas/Query"
1224
+ }
1225
+ },
1226
+ "mustNot": {
1227
+ "type": "array",
1228
+ "description": "List of queries to be evaluated as a `NOT` operator.",
1229
+ "items": {
1230
+ "$ref": "#/components/schemas/Query"
1231
+ }
1232
+ },
1233
+ "should": {
1234
+ "type": "array",
1235
+ "description": "List of queries to be evaluated as an `OR` operator.",
1236
+ "items": {
1237
+ "$ref": "#/components/schemas/Query"
1238
+ }
1239
+ }
1240
+ }
1241
+ },
1242
+ "Filter": {
1243
+ "type": "object",
1244
+ "additionalProperties": false,
1245
+ "description": "Contains a set of objects that define criteria used to select records. A filter can contain one of the following:\n * `TermFilter`\n - Matches records where a field (or fields) exactly matches some simple value (including `null`).\n * `RangeFilter`\n - Matches records where a field value lies within a specified range.\n * `Range2Filter`\n - Matches records in a specified range across fields.\n * `QueryFilter`\n - Matches records based on a query.\n * `BoolFilter`\n - Provides filtering of records using a set of filters combined using a logical operator.",
1246
+ "maxProperties": 1,
1247
+ "minProperties": 1,
1248
+ "properties": {
1249
+ "boolFilter": {
1250
+ "$ref": "#/components/schemas/BoolFilter"
1251
+ },
1252
+ "queryFilter": {
1253
+ "$ref": "#/components/schemas/QueryFilter"
1254
+ },
1255
+ "range2Filter": {
1256
+ "$ref": "#/components/schemas/Range2Filter"
1257
+ },
1258
+ "rangeFilter": {
1259
+ "$ref": "#/components/schemas/RangeFilter"
1260
+ },
1261
+ "termFilter": {
1262
+ "$ref": "#/components/schemas/TermFilter"
1263
+ }
1264
+ }
1265
+ },
1266
+ "BoolFilter": {
1267
+ "type": "object",
1268
+ "additionalProperties": false,
1269
+ "description": "Allows you to combine other filters into (possibly recursive) logical expression trees. A boolean filter is composed of a logical operator (`AND`, `OR`, `NOT`) and a list of filters that the operator relates to. Multiple filters can be negated with a single `NOT` operator, even when the filters are combined with the `AND` operator.",
1270
+ "example": {
1271
+ "operator": "and",
1272
+ "filters": [
1273
+ {
1274
+ "termFilter": {
1275
+ "field": "id",
1276
+ "operator": "is",
1277
+ "values": [
1278
+ "myId"
1279
+ ]
1280
+ }
1281
+ },
1282
+ {
1283
+ "termFilter": {
1284
+ "field": "couponId",
1285
+ "operator": "is",
1286
+ "values": [
1287
+ "couponOne"
1288
+ ]
1289
+ }
1290
+ }
1291
+ ]
1292
+ },
1293
+ "properties": {
1294
+ "filters": {
1295
+ "type": "array",
1296
+ "description": "A list of filters that are logically combined by an operator.",
1297
+ "items": {
1298
+ "$ref": "#/components/schemas/Filter"
1299
+ }
1300
+ },
1301
+ "operator": {
1302
+ "type": "string",
1303
+ "description": "The logical operator that is used to combine the filters.",
1304
+ "enum": [
1305
+ "and",
1306
+ "or",
1307
+ "not"
1308
+ ],
1309
+ "example": "and"
1310
+ }
1311
+ },
1312
+ "required": [
1313
+ "operator"
450
1314
  ]
451
1315
  },
452
1316
  "QueryFilter": {
453
1317
  "type": "object",
1318
+ "description": "Wraps any query and allows it to be used as a filter.",
1319
+ "properties": {
1320
+ "query": {
1321
+ "$ref": "#/components/schemas/Query"
1322
+ }
1323
+ },
1324
+ "required": [
1325
+ "query"
1326
+ ]
1327
+ },
1328
+ "Field": {
1329
+ "type": "string",
1330
+ "description": "Name of the field. Might be a custom field name prefixed with c_.",
1331
+ "example": "couponId",
1332
+ "maxLength": 260
1333
+ },
1334
+ "Range2Filter": {
1335
+ "type": "object",
1336
+ "additionalProperties": false,
1337
+ "description": "Allows you to restrict a search result to hits where a range defined by specified attributes has a certain relationship to a specified range.\n\nThe first range (R1) is defined by a pair of attributes (`fromField` and `toField`) that specify the extent of a range, such as attributes `validFrom` and `validTo`.\n\nThe second range (R2) is defined by `fromValue` and `toValue`.\n\nThe filter mode specifies the method used to compare the two ranges:\n\n* `overlap`: R1 overlaps fully or partially with R2.\n* `containing`: R1 contains R2.\n* `contained`: R1 is contained in R2.\n\nThe range filter supports several value types, and relies on the natural sorting of the value type for range interpretation. Value ranges can be open-ended, but only at one end of the range. You can configure whether the lower bounds and upper bounds are inclusive or exclusive.\n\nA range 2 filter is useful for general restrictions that can be shared between searches (like a static date range) because the filter result is cached in memory. Range filters are not appropriate if the range is expected to be different for every query (for example, if the user controls the date range down to the hour via a UI control). Range filters are inclusive by default.",
1338
+ "example": {
1339
+ "fromField": "validFrom",
1340
+ "toField": "validTo",
1341
+ "filterMode": "overlap",
1342
+ "fromValue": "2007-01-01T00:00:00.000Z",
1343
+ "toValue": "2017-01-01T00:00:00.000Z"
1344
+ },
1345
+ "properties": {
1346
+ "filterMode": {
1347
+ "type": "string",
1348
+ "default": "overlap",
1349
+ "description": "Compare mode: overlap, containing, or contained.",
1350
+ "enum": [
1351
+ "overlap",
1352
+ "containing",
1353
+ "contained"
1354
+ ],
1355
+ "example": "overlap"
1356
+ },
1357
+ "fromField": {
1358
+ "allOf": [
1359
+ {
1360
+ "$ref": "#/components/schemas/Field"
1361
+ }
1362
+ ],
1363
+ "description": "The field name of the field that starts the first range.",
1364
+ "example": "validFrom"
1365
+ },
1366
+ "fromInclusive": {
1367
+ "type": "boolean",
1368
+ "default": true,
1369
+ "description": "A flag indicating if the lower bound of the second range is inclusive. To make the lower bound exclusive, set to `false`.",
1370
+ "example": true
1371
+ },
1372
+ "fromValue": {
1373
+ "description": "The lower bound of the second range. If not specified, the range is open-ended with respect to the lower bound. You can't leave both the lower and upper bounds open-ended.",
1374
+ "example": "2007-01-01T00:00:00.000Z"
1375
+ },
1376
+ "toField": {
1377
+ "allOf": [
1378
+ {
1379
+ "$ref": "#/components/schemas/Field"
1380
+ }
1381
+ ],
1382
+ "description": "The field name of the field that ends the first range.",
1383
+ "example": "validTo"
1384
+ },
1385
+ "toInclusive": {
1386
+ "type": "boolean",
1387
+ "default": true,
1388
+ "description": "A flag indicating if the upper bound of the second range is inclusive. To make the lower bound exclusive, set to `false`.",
1389
+ "example": true
1390
+ },
1391
+ "toValue": {
1392
+ "description": "The upper bound of the second range. If not specified, the range is open-ended with respect to the upper bound. You can't leave both the upper and lower bounds open-ended.",
1393
+ "example": "2017-01-01T00:00:00.000Z"
1394
+ }
1395
+ },
1396
+ "required": [
1397
+ "fromField",
1398
+ "toField"
1399
+ ]
1400
+ },
1401
+ "RangeFilter": {
1402
+ "type": "object",
1403
+ "description": "Allows you to restrict a search result to hits that have values for a given attribute that fall within a given value range. The range filter supports several value types and relies on the natural sorting of the value type for range interpretation. Value ranges can be open-ended, but only at one end of the range. You can configure whether the lower bounds and upper bounds are inclusive or exclusive.\n\nA range filter is useful for general restrictions that can be shared between searches (like a static date range) because the filter result is cached in memory. Range filters are not appropriate if the range is expected to be different for every query (for example, if the user controls the date range down to the hour via a UI control). Range filters are inclusive by default.",
1404
+ "properties": {
1405
+ "field": {
1406
+ "allOf": [
1407
+ {
1408
+ "$ref": "#/components/schemas/Field"
1409
+ }
1410
+ ],
1411
+ "description": "The search field.",
1412
+ "example": "validFrom"
1413
+ },
1414
+ "from": {
1415
+ "description": "The lower bound of the filter range. If not specified, the range is open-ended with respect to the lower bound. You can't leave both the lower and upper bounds open-ended.",
1416
+ "oneOf": [
1417
+ {
1418
+ "type": "string",
1419
+ "format": "date-time",
1420
+ "example": "2007-01-01T00:00:00Z"
1421
+ },
1422
+ {
1423
+ "type": "integer",
1424
+ "example": 1
1425
+ },
1426
+ {
1427
+ "type": "number",
1428
+ "example": 1
1429
+ }
1430
+ ]
1431
+ },
1432
+ "fromInclusive": {
1433
+ "type": "boolean",
1434
+ "default": true,
1435
+ "description": "A flag indicating if the lower bound of the range is inclusive. To make the lower bound exclusive, set to `false`.",
1436
+ "example": true
1437
+ },
1438
+ "to": {
1439
+ "description": "The upper bound of the filter range. If not specified, the range is open-ended with respect to the upper bound. You can't leave both the upper and lower bounds open-ended.",
1440
+ "oneOf": [
1441
+ {
1442
+ "type": "string",
1443
+ "format": "date-time",
1444
+ "example": "2007-01-02T00:00:00Z"
1445
+ },
1446
+ {
1447
+ "type": "integer",
1448
+ "example": 2
1449
+ },
1450
+ {
1451
+ "type": "number",
1452
+ "example": 2
1453
+ }
1454
+ ]
1455
+ },
1456
+ "toInclusive": {
1457
+ "type": "boolean",
1458
+ "default": true,
1459
+ "description": "A flag indicating if the upper bound of the range is inclusive. To make the upper bound exclusive, set to `false`.",
1460
+ "example": true
1461
+ }
1462
+ },
1463
+ "required": [
1464
+ "field"
1465
+ ]
1466
+ },
1467
+ "TermFilter": {
1468
+ "type": "object",
1469
+ "additionalProperties": false,
1470
+ "description": "Allows you to restrict a search result to hits that match exactly one of the values configured for the filter. A term filter is useful for general restrictions that can be shared between searches. Use term filters whenever the criteria you filter on is a shared property of multiple searches (for example, like filtering by an order status). Use term filters for fields that have a discrete and small set of values only.",
1471
+ "example": {
1472
+ "field": "id",
1473
+ "operator": "is",
1474
+ "values": [
1475
+ "myId"
1476
+ ]
1477
+ },
1478
+ "properties": {
1479
+ "field": {
1480
+ "allOf": [
1481
+ {
1482
+ "$ref": "#/components/schemas/Field"
1483
+ }
1484
+ ],
1485
+ "description": "The filter field."
1486
+ },
1487
+ "operator": {
1488
+ "type": "string",
1489
+ "description": "The operator used to compare the field's values with the given values.",
1490
+ "enum": [
1491
+ "is",
1492
+ "one_of",
1493
+ "is_null",
1494
+ "is_not_null",
1495
+ "less",
1496
+ "greater",
1497
+ "not_in",
1498
+ "neq"
1499
+ ],
1500
+ "example": "is"
1501
+ },
1502
+ "values": {
1503
+ "type": "array",
1504
+ "description": "The filter values.",
1505
+ "items": {
1506
+ "type": "string",
1507
+ "example": "myId"
1508
+ }
1509
+ }
1510
+ },
1511
+ "required": [
1512
+ "field",
1513
+ "operator"
1514
+ ]
1515
+ },
1516
+ "FilteredQuery": {
1517
+ "type": "object",
1518
+ "additionalProperties": false,
1519
+ "description": "Allows to filter the result of a possibly complex query using a possibly complex filter.",
1520
+ "example": {
1521
+ "query": {
1522
+ "textQuery": {
1523
+ "fields": [
1524
+ "couponId"
1525
+ ],
1526
+ "searchPhrase": "disabled"
1527
+ }
1528
+ },
1529
+ "filter": {
1530
+ "termFilter": {
1531
+ "field": "enabled",
1532
+ "operator": "is",
1533
+ "values": [
1534
+ false
1535
+ ]
1536
+ }
1537
+ }
1538
+ },
1539
+ "properties": {
1540
+ "filter": {
1541
+ "$ref": "#/components/schemas/Filter"
1542
+ },
1543
+ "query": {
1544
+ "$ref": "#/components/schemas/Query"
1545
+ }
1546
+ },
1547
+ "required": [
1548
+ "filter",
1549
+ "query"
1550
+ ]
1551
+ },
1552
+ "MatchAllQuery": {
1553
+ "type": "object",
1554
+ "description": "Matches all documents (namespace and document type). This query comes in handy if you just want to filter a search result or really do not have any constraints."
1555
+ },
1556
+ "NestedQuery": {
1557
+ "type": "object",
1558
+ "additionalProperties": false,
1559
+ "description": "Allows you to query nested documents that are part of a larger document. Say, for example, that you have a main product with variations in one big document, and you want to constrain a search to main products that have variations that match multiple constraints. \n\nA `NestedQuery` is only supported by some Commerce APIs. For more details, see the endpoint descriptions in the API documentation.\n",
1560
+ "example": {
1561
+ "path": "order.shippingAddresses",
1562
+ "query": {
1563
+ "boolQuery": {
1564
+ "must": [
1565
+ {
1566
+ "boolQuery": {
1567
+ "must": [
1568
+ {
1569
+ "termQuery": {
1570
+ "fields": [
1571
+ "order.shippingAddresses.firstName"
1572
+ ],
1573
+ "operator": "is",
1574
+ "values": [
1575
+ "John"
1576
+ ]
1577
+ }
1578
+ }
1579
+ ]
1580
+ }
1581
+ },
1582
+ {
1583
+ "boolQuery": {
1584
+ "must": [
1585
+ {
1586
+ "termQuery": {
1587
+ "fields": [
1588
+ "order.shippingAddresses.lastName"
1589
+ ],
1590
+ "operator": "is",
1591
+ "values": [
1592
+ "Doe"
1593
+ ]
1594
+ }
1595
+ }
1596
+ ]
1597
+ }
1598
+ }
1599
+ ]
1600
+ }
1601
+ },
1602
+ "scoreMode": "avg"
1603
+ },
454
1604
  "properties": {
1605
+ "path": {
1606
+ "type": "string",
1607
+ "description": "The path to the nested document.",
1608
+ "example": "order.shippingAddresses",
1609
+ "maxLength": 2048
1610
+ },
455
1611
  "query": {
456
1612
  "$ref": "#/components/schemas/Query"
1613
+ },
1614
+ "scoreMode": {
1615
+ "type": "string",
1616
+ "description": "Indicates how scores for matching child objects affect the root parent document’s relevance score.",
1617
+ "enum": [
1618
+ "avg",
1619
+ "total",
1620
+ "max",
1621
+ "none"
1622
+ ],
1623
+ "example": "avg"
457
1624
  }
458
1625
  },
459
1626
  "required": [
1627
+ "path",
460
1628
  "query"
461
1629
  ]
462
1630
  },
463
- "Field": {
464
- "type": "string",
465
- "maxLength": 260
1631
+ "TermQuery": {
1632
+ "type": "object",
1633
+ "description": "A term query matches one or more values against one or more document fields. A document is considered a hit if one of the values matches exactly with at least one of the given fields. The operator `is` can only take one value, while `one_of` can take multiple values. If multiple fields are specified, they are combined using a logical `OR` operator.\n\n**Limitations:**\n\n* The `greater` and `less` operators are not supported under certain conditions. Both operators are permitted unless the API documentation states otherwise.\n* A subset of Commerce APIs handle queries with multiple fields differently. If the query has multiple fields, the query is internally handled as a logical `OR` of `DisjointMaxQueries` (with the dismax matching a value against all fields). The dismax makes sure that a document carrying a single term in multiple fields does not get higher scores than a document matching multiple terms in multiple fields.",
1634
+ "properties": {
1635
+ "fields": {
1636
+ "type": "array",
1637
+ "description": "The document fields that the values are matched against, combined with the operator.",
1638
+ "items": {
1639
+ "$ref": "#/components/schemas/Field"
1640
+ },
1641
+ "minItems": 1
1642
+ },
1643
+ "operator": {
1644
+ "type": "string",
1645
+ "description": "Returns the operator to use for the term query.",
1646
+ "enum": [
1647
+ "is",
1648
+ "one_of",
1649
+ "is_null",
1650
+ "is_not_null",
1651
+ "less",
1652
+ "greater",
1653
+ "not_in",
1654
+ "neq"
1655
+ ],
1656
+ "example": "is"
1657
+ },
1658
+ "values": {
1659
+ "type": "array",
1660
+ "description": "The values that the fields are compared against, combined with the operator.",
1661
+ "items": {
1662
+ "example": "myCouponId",
1663
+ "oneOf": [
1664
+ {
1665
+ "type": "string",
1666
+ "example": "myCouponId"
1667
+ },
1668
+ {
1669
+ "type": "number",
1670
+ "example": 1
1671
+ },
1672
+ {
1673
+ "type": "boolean",
1674
+ "example": true
1675
+ },
1676
+ {
1677
+ "type": "integer",
1678
+ "example": 1
1679
+ }
1680
+ ]
1681
+ }
1682
+ }
1683
+ },
1684
+ "required": [
1685
+ "fields",
1686
+ "operator"
1687
+ ]
1688
+ },
1689
+ "TextQuery": {
1690
+ "type": "object",
1691
+ "additionalProperties": false,
1692
+ "description": "A text query is used to match some text (for example, a search phrase possibly consisting of multiple terms) against one or more fields. When multiple fields are provided, the phrase conceptually forms a logical `OR` over the fields. In this case, the terms of the phrase basically have to match within the text, that would result in concatenating all given fields.",
1693
+ "example": {
1694
+ "fields": [
1695
+ "couponId"
1696
+ ],
1697
+ "searchPhrase": "limit"
1698
+ },
1699
+ "properties": {
1700
+ "fields": {
1701
+ "type": "array",
1702
+ "description": "The document fields that the search phrase matches against.",
1703
+ "items": {
1704
+ "$ref": "#/components/schemas/Field"
1705
+ },
1706
+ "minItems": 1
1707
+ },
1708
+ "searchPhrase": {
1709
+ "type": "string",
1710
+ "description": "A search phrase, which can include multiple terms separated by spaces.",
1711
+ "example": "campaign summer"
1712
+ }
1713
+ },
1714
+ "required": [
1715
+ "fields",
1716
+ "searchPhrase"
1717
+ ]
1718
+ },
1719
+ "Sort": {
1720
+ "type": "object",
1721
+ "additionalProperties": false,
1722
+ "description": "Document representing a sort request. Each API has a different default sort configuration that can be modified in the request.",
1723
+ "example": {
1724
+ "field": "couponId",
1725
+ "sortOrder": "desc"
1726
+ },
1727
+ "properties": {
1728
+ "field": {
1729
+ "type": "string",
1730
+ "description": "The name of the field to sort on.",
1731
+ "example": "couponId",
1732
+ "maxLength": 256
1733
+ },
1734
+ "sortOrder": {
1735
+ "type": "string",
1736
+ "default": "asc",
1737
+ "description": "The sort order to be applied when sorting. When omitted, the default sort order (asc) is used.",
1738
+ "enum": [
1739
+ "asc",
1740
+ "desc"
1741
+ ],
1742
+ "example": "asc"
1743
+ }
1744
+ },
1745
+ "required": [
1746
+ "field"
1747
+ ]
1748
+ },
1749
+ "Offset": {
1750
+ "type": "integer",
1751
+ "format": "int32",
1752
+ "default": 0,
1753
+ "description": "The zero-based index of the first hit/data to include in the result.",
1754
+ "example": 0,
1755
+ "minimum": 0
1756
+ },
1757
+ "SearchRequest": {
1758
+ "type": "object",
1759
+ "description": "Document representing a search request for retrieving items within the Data API. The query is a potentially complex set of expressions. The fields and expands that each query supports are defined within the search resource.",
1760
+ "properties": {
1761
+ "limit": {
1762
+ "type": "integer",
1763
+ "format": "int32",
1764
+ "description": "Maximum records to retrieve per request, not to exceed 200.",
1765
+ "example": 10,
1766
+ "maximum": 200,
1767
+ "minimum": 1
1768
+ },
1769
+ "query": {
1770
+ "$ref": "#/components/schemas/Query"
1771
+ },
1772
+ "sorts": {
1773
+ "type": "array",
1774
+ "description": "The list of sort clauses configured for the search request. Sort clauses are optional. See the description of the search endpoint for details on the default sorting behavior that is used when explicit sorts are not passed.",
1775
+ "items": {
1776
+ "$ref": "#/components/schemas/Sort"
1777
+ }
1778
+ },
1779
+ "offset": {
1780
+ "$ref": "#/components/schemas/Offset"
1781
+ }
1782
+ },
1783
+ "required": [
1784
+ "query"
1785
+ ]
1786
+ },
1787
+ "Total": {
1788
+ "type": "integer",
1789
+ "format": "int32",
1790
+ "default": 0,
1791
+ "description": "The total number of hits that match the search's criteria. This can be greater than the number of results returned as search results are pagenated.",
1792
+ "example": 10,
1793
+ "minimum": 0
1794
+ },
1795
+ "ResultBase": {
1796
+ "type": "object",
1797
+ "description": "Schema defining generic list result. Each response schema of a resource requiring a list response should extend this schema. \nAdditionally it needs to be defined what data is returned.",
1798
+ "properties": {
1799
+ "limit": {
1800
+ "type": "integer",
1801
+ "format": "int32",
1802
+ "description": "Maximum records to retrieve per request. The limit with its constraints (minimum, maximum, default) is defined by the request parameter `limit` of the endpoint returning this schema.",
1803
+ "example": 10
1804
+ },
1805
+ "total": {
1806
+ "$ref": "#/components/schemas/Total"
1807
+ }
1808
+ },
1809
+ "required": [
1810
+ "limit",
1811
+ "total"
1812
+ ]
1813
+ },
1814
+ "PaginatedResultBase": {
1815
+ "allOf": [
1816
+ {
1817
+ "$ref": "#/components/schemas/ResultBase"
1818
+ }
1819
+ ],
1820
+ "description": "Schema defining generic pageable result. Each response schema of a resource requiring pagination should extend this schema. \nIf you use this extend this schema directly, it needs to be defined what data is returned. Allowed names for the data field is `data`.",
1821
+ "properties": {
1822
+ "offset": {
1823
+ "$ref": "#/components/schemas/Offset"
1824
+ }
1825
+ },
1826
+ "required": [
1827
+ "limit",
1828
+ "offset",
1829
+ "total"
1830
+ ]
1831
+ },
1832
+ "PaginatedSearchResult": {
1833
+ "additionalProperties": false,
1834
+ "allOf": [
1835
+ {
1836
+ "$ref": "#/components/schemas/PaginatedResultBase"
1837
+ }
1838
+ ],
1839
+ "description": "Document representing a generic search result. Each search resource should extend this to define what is returned in the `hits`.",
1840
+ "example": {
1841
+ "limit": 1,
1842
+ "hits": [
1843
+ {
1844
+ "couponId": "coupon1",
1845
+ "creationDate": "2019-10-20T12:00:00Z",
1846
+ "description": "This coupon is used to give 10% off stuff.",
1847
+ "enabled": false,
1848
+ "exportedCodeCount": 0,
1849
+ "lastModified": "2019-10-30T04:23:59Z",
1850
+ "redemptionCount": 3,
1851
+ "redemptionLimits": {
1852
+ "limitPerCode": 1,
1853
+ "limitPerCustomer": 1,
1854
+ "limitPerTimeFrame": {
1855
+ "limit": 2,
1856
+ "redemptionTimeFrame": 24
1857
+ }
1858
+ },
1859
+ "singleCode": "MyCode",
1860
+ "systemCodesConfig": {
1861
+ "codePrefix": "SG",
1862
+ "numberOfCodes": 500000
1863
+ },
1864
+ "totalCodesCount": 50,
1865
+ "type": "single_code"
1866
+ }
1867
+ ],
1868
+ "query": {
1869
+ "textQuery": {
1870
+ "fields": [
1871
+ "id",
1872
+ "description"
1873
+ ],
1874
+ "searchPhrase": "stuff"
1875
+ }
1876
+ },
1877
+ "sorts": [
1878
+ {
1879
+ "field": "couponId",
1880
+ "sortOrder": "desc"
1881
+ }
1882
+ ],
1883
+ "offset": 2,
1884
+ "total": 8
1885
+ },
1886
+ "properties": {
1887
+ "query": {
1888
+ "$ref": "#/components/schemas/Query"
1889
+ },
1890
+ "sorts": {
1891
+ "type": "array",
1892
+ "description": "The sorting that was applied to the result.",
1893
+ "items": {
1894
+ "$ref": "#/components/schemas/Sort"
1895
+ }
1896
+ },
1897
+ "hits": {
1898
+ "type": "array",
1899
+ "description": "The sorted array of search hits. Can be empty.",
1900
+ "items": {
1901
+ "type": "object"
1902
+ }
1903
+ }
1904
+ },
1905
+ "required": [
1906
+ "query"
1907
+ ]
1908
+ },
1909
+ "TimeOfDay": {
1910
+ "type": "object",
1911
+ "additionalProperties": false,
1912
+ "description": "Document representing a time schedule within a single day.",
1913
+ "properties": {
1914
+ "timeFrom": {
1915
+ "type": "string",
1916
+ "description": "The time to start from. Time format: HH:mm or HH:mm:ss. Seconds are ignored and set to 0.",
1917
+ "example": "09:00:00",
1918
+ "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$"
1919
+ },
1920
+ "timeTo": {
1921
+ "type": "string",
1922
+ "description": "The time to end on. Time format: HH:mm or HH:mm:ss. Seconds are ignored and set to 0.",
1923
+ "example": "17:00:00",
1924
+ "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$"
1925
+ }
1926
+ }
1927
+ },
1928
+ "Recurrence": {
1929
+ "type": "object",
1930
+ "additionalProperties": false,
1931
+ "description": "Document representing a schedule recurrence.",
1932
+ "properties": {
1933
+ "dayOfWeek": {
1934
+ "type": "array",
1935
+ "description": "The days of week for recurrence.",
1936
+ "items": {
1937
+ "type": "string",
1938
+ "enum": [
1939
+ "monday",
1940
+ "tuesday",
1941
+ "wednesday",
1942
+ "thursday",
1943
+ "friday",
1944
+ "saturday",
1945
+ "sunday"
1946
+ ],
1947
+ "example": "monday"
1948
+ }
1949
+ },
1950
+ "timeOfDay": {
1951
+ "allOf": [
1952
+ {
1953
+ "$ref": "#/components/schemas/TimeOfDay"
1954
+ }
1955
+ ],
1956
+ "description": "The time of the day for recurrence."
1957
+ }
1958
+ }
466
1959
  },
467
- "Range2Filter": {
1960
+ "Schedule": {
468
1961
  "type": "object",
469
1962
  "additionalProperties": false,
1963
+ "description": "Document representing a time schedule. Defines an optional validity window (startDate/endDate) and an optional recurrence. Omitting a bound leaves that side of the window open (unbounded).",
470
1964
  "properties": {
471
- "filterMode": {
1965
+ "startDate": {
472
1966
  "type": "string",
473
- "default": "overlap",
474
- "enum": [
475
- "overlap",
476
- "containing",
477
- "contained"
478
- ]
1967
+ "format": "date-time",
1968
+ "description": "The date to start validity. ISO8601 date time format: yyyy-MM-dd'T'HH:mm:ssZ.",
1969
+ "example": "2026-01-01T00:00:00Z"
479
1970
  },
480
- "fromField": {
1971
+ "endDate": {
1972
+ "type": "string",
1973
+ "format": "date-time",
1974
+ "description": "The date to end of validity. ISO8601 date time format: yyyy-MM-dd'T'HH:mm:ssZ.",
1975
+ "example": "2026-01-31T23:59:59Z"
1976
+ },
1977
+ "recurrence": {
481
1978
  "allOf": [
482
1979
  {
483
- "$ref": "#/components/schemas/Field"
1980
+ "$ref": "#/components/schemas/Recurrence"
484
1981
  }
485
- ]
1982
+ ],
1983
+ "description": "The recurrence of the schedule by day of week and time of day. Not all schedules support a recurrence."
1984
+ }
1985
+ }
1986
+ },
1987
+ "PromotionAbtestGroupAssignment": {
1988
+ "type": "object",
1989
+ "additionalProperties": false,
1990
+ "properties": {
1991
+ "abtestDescription": {
1992
+ "type": "string"
486
1993
  },
487
- "fromInclusive": {
1994
+ "abtestId": {
1995
+ "type": "string"
1996
+ },
1997
+ "enabled": {
488
1998
  "type": "boolean",
489
- "default": true
1999
+ "example": true
490
2000
  },
491
- "fromValue": {},
492
- "toField": {
493
- "allOf": [
494
- {
495
- "$ref": "#/components/schemas/Field"
496
- }
497
- ]
2001
+ "schedule": {
2002
+ "$ref": "#/components/schemas/Schedule"
498
2003
  },
499
- "toInclusive": {
500
- "type": "boolean",
501
- "default": true
2004
+ "segmentDescription": {
2005
+ "type": "string"
502
2006
  },
503
- "toValue": {}
2007
+ "segmentId": {
2008
+ "type": "string"
2009
+ }
504
2010
  },
505
2011
  "required": [
506
- "fromField",
507
- "toField"
2012
+ "abtestDescription",
2013
+ "abtestId",
2014
+ "enabled",
2015
+ "schedule",
2016
+ "segmentDescription",
2017
+ "segmentId"
508
2018
  ]
509
2019
  },
510
- "RangeFilter": {
2020
+ "CampaignId": {
2021
+ "type": "string",
2022
+ "description": "The ID of the campaign.",
2023
+ "example": "NewYearCampaign",
2024
+ "maxLength": 256,
2025
+ "minLength": 1
2026
+ },
2027
+ "Campaign": {
511
2028
  "type": "object",
2029
+ "additionalProperties": {
2030
+ "description": "This type supports additional properties passed along with the defined properties of this API.\nTo indicate that the properties were defined and expected to be handled as additional properties, they are expected to be prefixed with a `c_`.\nThe type will reject any property that does not fit this pattern, only allowing additional properties beginning with the known prefix.",
2031
+ "example": "c_trackingId",
2032
+ "title": "Additional Property Support"
2033
+ },
2034
+ "description": "Document representing a campaign.",
512
2035
  "properties": {
513
- "field": {
514
- "allOf": [
515
- {
516
- "$ref": "#/components/schemas/Field"
517
- }
518
- ]
2036
+ "campaignId": {
2037
+ "$ref": "#/components/schemas/CampaignId"
519
2038
  },
520
- "from": {
521
- "oneOf": [
522
- {
523
- "type": "string",
524
- "format": "date-time"
525
- },
526
- {
527
- "type": "integer"
528
- },
529
- {
530
- "type": "number"
531
- }
532
- ]
2039
+ "coupons": {
2040
+ "type": "array",
2041
+ "description": "The array of assigned coupon IDs, not sorted.",
2042
+ "example": [
2043
+ "20%offOrder",
2044
+ "10%offWelcomeNewUser"
2045
+ ],
2046
+ "items": {
2047
+ "type": "string"
2048
+ }
533
2049
  },
534
- "fromInclusive": {
535
- "type": "boolean",
536
- "default": true
2050
+ "creationDate": {
2051
+ "type": "string",
2052
+ "format": "date-time",
2053
+ "description": "Returns the value of attribute 'creationDate'.",
2054
+ "example": "2019-10-03T19:36:56Z"
537
2055
  },
538
- "to": {
539
- "oneOf": [
540
- {
541
- "type": "string",
542
- "format": "date-time"
543
- },
544
- {
545
- "type": "integer"
546
- },
547
- {
548
- "type": "number"
549
- }
550
- ]
2056
+ "customerGroups": {
2057
+ "type": "array",
2058
+ "description": "The array of assigned customer groups, not sorted.",
2059
+ "example": [
2060
+ "BigShoppers",
2061
+ "NorthAmericanShoppers"
2062
+ ],
2063
+ "items": {
2064
+ "type": "string"
2065
+ }
551
2066
  },
552
- "toInclusive": {
2067
+ "description": {
2068
+ "type": "string",
2069
+ "description": "The description of the campaign.",
2070
+ "maxLength": 4000
2071
+ },
2072
+ "enabled": {
553
2073
  "type": "boolean",
554
- "default": true
2074
+ "description": "The enabled flag for campaign.",
2075
+ "example": true
2076
+ },
2077
+ "endDate": {
2078
+ "type": "string",
2079
+ "format": "date-time",
2080
+ "description": "The date the scenario ends."
2081
+ },
2082
+ "lastModified": {
2083
+ "type": "string",
2084
+ "format": "date-time",
2085
+ "description": "Returns the value of attribute 'lastModified'.",
2086
+ "example": "2019-10-03T19:36:56Z"
2087
+ },
2088
+ "sourceCodeGroups": {
2089
+ "type": "array",
2090
+ "description": "The array of assigned source code groups, not sorted.",
2091
+ "example": [
2092
+ "affiliate-email",
2093
+ "gaming-email"
2094
+ ],
2095
+ "items": {
2096
+ "type": "string"
2097
+ }
2098
+ },
2099
+ "startDate": {
2100
+ "type": "string",
2101
+ "format": "date-time",
2102
+ "description": "The date the scenario begins.",
2103
+ "example": "2019-10-03T19:36:56Z"
555
2104
  }
556
2105
  },
557
2106
  "required": [
558
- "field"
2107
+ "campaignId"
559
2108
  ]
560
2109
  },
561
- "TermFilter": {
2110
+ "Promotion": {
562
2111
  "type": "object",
563
- "additionalProperties": false,
2112
+ "additionalProperties": {
2113
+ "description": "This type supports additional properties passed along with the defined properties of this API.\nTo indicate that the properties were defined and expected to be handled as additional properties, they are expected to be prefixed with a `c_`.\nThe type will reject any property that does not fit this pattern, only allowing additional properties beginning with the known prefix.",
2114
+ "example": "c_trackingId",
2115
+ "title": "Additional Property Support"
2116
+ },
2117
+ "description": "Document representing a promotion. Unless otherwise stated, attributes of this document are not supported when using\nthe Open Commerce API to update multiple promotions at once.",
564
2118
  "properties": {
565
- "field": {
2119
+ "archived": {
2120
+ "type": "boolean",
2121
+ "description": "Determines if this promotion is archived. This attribute is allowed to be updated when using the Open\n Commerce API to update multiple promotions at once.",
2122
+ "example": true
2123
+ },
2124
+ "assignmentInformation": {
566
2125
  "allOf": [
567
2126
  {
568
- "$ref": "#/components/schemas/Field"
2127
+ "$ref": "#/components/schemas/PromotionAssignmentInformation"
569
2128
  }
2129
+ ],
2130
+ "description": "Information about the assignments and assignment schedules of this promotion."
2131
+ },
2132
+ "creationDate": {
2133
+ "type": "string",
2134
+ "format": "date-time",
2135
+ "description": "Returns the value of attribute 'creationDate'."
2136
+ },
2137
+ "currencyCode": {
2138
+ "type": "string",
2139
+ "description": "The ISO 4217 mnemonic code of the currency this promotion is restricted to. If not populated, then there is no\n currency restriction on the promotion.",
2140
+ "maxLength": 3
2141
+ },
2142
+ "disableGloballyExcluded": {
2143
+ "type": "boolean",
2144
+ "description": "Determines if this promotion ignores the global product exclusions for promotions.",
2145
+ "example": true
2146
+ },
2147
+ "enabled": {
2148
+ "type": "boolean",
2149
+ "description": "Determines if this promotion is enabled. This attribute is allowed to be updated when using the Open\n Commerce API to update multiple promotions at once.",
2150
+ "example": true
2151
+ },
2152
+ "exclusivity": {
2153
+ "type": "string",
2154
+ "description": "Determines if the promotion can be combined with other promotions of the same promotion class or if it cannot be\n combined with any other promotions. This attribute is allowed to be updated when using the Open Commerce API to\n update multiple promotions at once.",
2155
+ "enum": [
2156
+ "no",
2157
+ "class",
2158
+ "global"
570
2159
  ]
571
2160
  },
572
- "operator": {
2161
+ "id": {
2162
+ "type": "string",
2163
+ "description": "The ID for the promotion."
2164
+ },
2165
+ "lastModified": {
2166
+ "type": "string",
2167
+ "format": "date-time",
2168
+ "description": "Returns the value of attribute 'lastModified'."
2169
+ },
2170
+ "name": {
2171
+ "type": "object",
2172
+ "additionalProperties": {
2173
+ "type": "string"
2174
+ },
2175
+ "description": "The user supplied name of this promotion, which can be localized."
2176
+ },
2177
+ "promotionClass": {
573
2178
  "type": "string",
2179
+ "description": "The class of the promotion. If the promotion class is modified, then the promotion rule and all of its values,\n such as whether or not to disable global product exclusions, are reset.",
574
2180
  "enum": [
575
- "is",
576
- "one_of",
577
- "is_null",
578
- "is_not_null",
579
- "less",
580
- "greater",
581
- "not_in",
582
- "neq"
2181
+ "product",
2182
+ "shipping",
2183
+ "order"
583
2184
  ]
584
2185
  },
585
- "values": {
2186
+ "tags": {
586
2187
  "type": "array",
2188
+ "description": "Returns the list of tags assigned to this promotion. If used to set the tags on a promotion, the promotion will\n only have the tags passed in the input. Any existing tags are removed.",
587
2189
  "items": {
588
- "type": "string"
2190
+ "$ref": "#/components/schemas/Tag"
589
2191
  }
590
2192
  }
591
- },
592
- "required": [
593
- "field",
594
- "operator"
595
- ]
2193
+ }
596
2194
  },
597
- "FilteredQuery": {
2195
+ "PromotionCampaignAssignment": {
598
2196
  "type": "object",
599
2197
  "additionalProperties": false,
2198
+ "description": "Document representing a promotion campaign assignment.",
600
2199
  "properties": {
601
- "filter": {
602
- "$ref": "#/components/schemas/Filter"
2200
+ "campaign": {
2201
+ "allOf": [
2202
+ {
2203
+ "$ref": "#/components/schemas/Campaign"
2204
+ }
2205
+ ],
2206
+ "description": "The campaign."
2207
+ },
2208
+ "campaignId": {
2209
+ "type": "string",
2210
+ "description": "The ID of the campaign.",
2211
+ "maxLength": 256,
2212
+ "minLength": 1
2213
+ },
2214
+ "coupons": {
2215
+ "type": "array",
2216
+ "description": "The sorted array of assigned coupon IDs.",
2217
+ "items": {
2218
+ "type": "string"
2219
+ }
2220
+ },
2221
+ "customerGroups": {
2222
+ "type": "array",
2223
+ "description": "The sorted array of assigned customer groups.",
2224
+ "items": {
2225
+ "type": "string"
2226
+ }
2227
+ },
2228
+ "description": {
2229
+ "type": "string",
2230
+ "description": "The description of the promotion campaign assignment.",
2231
+ "maxLength": 4000
2232
+ },
2233
+ "enabled": {
2234
+ "type": "boolean",
2235
+ "description": "True if the assignment resource is enabled.",
2236
+ "example": true
2237
+ },
2238
+ "promotion": {
2239
+ "allOf": [
2240
+ {
2241
+ "$ref": "#/components/schemas/Promotion"
2242
+ }
2243
+ ],
2244
+ "description": "The promotion."
2245
+ },
2246
+ "promotionId": {
2247
+ "type": "string",
2248
+ "description": "The ID of the promotion.",
2249
+ "maxLength": 256,
2250
+ "minLength": 1
2251
+ },
2252
+ "rank": {
2253
+ "type": "integer",
2254
+ "format": "int32",
2255
+ "description": "The rank of promotion campaign assignment."
2256
+ },
2257
+ "schedule": {
2258
+ "allOf": [
2259
+ {
2260
+ "$ref": "#/components/schemas/Schedule"
2261
+ }
2262
+ ],
2263
+ "description": "The schedule of the assignment resource."
603
2264
  },
604
- "query": {
605
- "$ref": "#/components/schemas/Query"
2265
+ "sourceCodeGroups": {
2266
+ "type": "array",
2267
+ "description": "The sorted array of assigned source code groups.",
2268
+ "items": {
2269
+ "type": "string"
2270
+ }
606
2271
  }
607
2272
  },
608
2273
  "required": [
609
- "filter",
610
- "query"
2274
+ "campaignId",
2275
+ "description",
2276
+ "enabled",
2277
+ "promotionId",
2278
+ "schedule"
611
2279
  ]
612
2280
  },
613
- "MatchAllQuery": {
614
- "type": "object"
615
- },
616
- "NestedQuery": {
2281
+ "PromotionAssignmentInformation": {
617
2282
  "type": "object",
618
2283
  "additionalProperties": false,
619
2284
  "properties": {
620
- "path": {
2285
+ "abtestId": {
621
2286
  "type": "string",
622
- "maxLength": 2048
623
- },
624
- "query": {
625
- "$ref": "#/components/schemas/Query"
2287
+ "description": "If there is only one assignment, and that assignment is an A/B test segment, the ID of the A/B test the segment\nbelongs to. Otherwise, empty."
626
2288
  },
627
- "scoreMode": {
2289
+ "abtestSegmentId": {
628
2290
  "type": "string",
629
- "enum": [
630
- "avg",
631
- "total",
632
- "max",
633
- "none"
634
- ]
635
- }
636
- },
637
- "required": [
638
- "path",
639
- "query"
640
- ]
641
- },
642
- "TermQuery": {
643
- "type": "object",
644
- "properties": {
645
- "fields": {
646
- "type": "array",
647
- "items": {
648
- "$ref": "#/components/schemas/Field"
649
- },
650
- "minItems": 1
2291
+ "description": "If there is only one assignment, and that assignment is an A/B test segment, the ID of the A/B test segment.\n Otherwise, empty."
651
2292
  },
652
- "operator": {
653
- "type": "string",
654
- "enum": [
655
- "is",
656
- "one_of",
657
- "is_null",
658
- "is_not_null",
659
- "less",
660
- "greater",
661
- "not_in",
662
- "neq"
663
- ]
2293
+ "active": {
2294
+ "type": "boolean",
2295
+ "description": "True if the individual assignment or the multiple assignments are currently active.",
2296
+ "example": true
664
2297
  },
665
- "values": {
2298
+ "activeAbtestAssignments": {
666
2299
  "type": "array",
2300
+ "description": "A list of currently active A/B tests this is assigned to.",
667
2301
  "items": {
668
- "oneOf": [
669
- {
670
- "type": "string"
671
- },
672
- {
673
- "type": "number"
674
- },
675
- {
676
- "type": "boolean"
677
- },
678
- {
679
- "type": "integer"
680
- }
681
- ]
2302
+ "$ref": "#/components/schemas/PromotionAbtestGroupAssignment"
682
2303
  }
683
- }
684
- },
685
- "required": [
686
- "fields",
687
- "operator"
688
- ]
689
- },
690
- "TextQuery": {
691
- "type": "object",
692
- "additionalProperties": false,
693
- "properties": {
694
- "fields": {
2304
+ },
2305
+ "activeCampaignAssignments": {
695
2306
  "type": "array",
2307
+ "description": "A list of currently active campaigns this is assigned to.",
696
2308
  "items": {
697
- "$ref": "#/components/schemas/Field"
698
- },
699
- "minItems": 1
2309
+ "$ref": "#/components/schemas/PromotionCampaignAssignment"
2310
+ }
700
2311
  },
701
- "searchPhrase": {
702
- "type": "string"
703
- }
704
- },
705
- "required": [
706
- "fields",
707
- "searchPhrase"
708
- ]
709
- },
710
- "String256": {
711
- "type": "string",
712
- "maxLength": 256
713
- },
714
- "Sort": {
715
- "type": "object",
716
- "additionalProperties": false,
717
- "properties": {
718
- "field": {
2312
+ "campaignId": {
2313
+ "type": "string",
2314
+ "description": "If there is only one assignment, and that assignment is a campaign, the ID of the campaign. Otherwise, empty."
2315
+ },
2316
+ "enabled": {
2317
+ "type": "boolean",
2318
+ "example": true
2319
+ },
2320
+ "endDate": {
2321
+ "type": "string",
2322
+ "format": "date-time",
2323
+ "description": "The end date of the container of the assignment (a Campaign or ABTest). If scheduleType is\n scheduleType : \"multiple\" or scheduleType : \"none\", then then result is null. Also, a null\n date returns null."
2324
+ },
2325
+ "schedule": {
719
2326
  "allOf": [
720
2327
  {
721
- "$ref": "#/components/schemas/String256"
2328
+ "$ref": "#/components/schemas/Schedule"
722
2329
  }
723
- ]
2330
+ ],
2331
+ "description": "The schedule of the assignment (a Campaign or ABTest). If scheduleType is\n scheduleType : \"multiple\" or scheduleType : \"none\", then then result is null."
724
2332
  },
725
- "sortOrder": {
2333
+ "scheduleType": {
726
2334
  "type": "string",
727
- "default": "asc",
2335
+ "description": "If there is only one active assignment, or no active assignments and one upcoming assignment, this is that type\n of assignment (scheduleType : \"campaign\" or scheduleType : \"abtest\"). If there are no\n assignments, it is scheduleType : \"none\", otherwise, scheduleType : \"multiple\".",
728
2336
  "enum": [
729
- "asc",
730
- "desc"
2337
+ "none",
2338
+ "campaign",
2339
+ "abtest",
2340
+ "multiple"
731
2341
  ]
732
- }
733
- },
734
- "required": [
735
- "field"
736
- ]
737
- },
738
- "Offset": {
739
- "type": "integer",
740
- "format": "int32",
741
- "default": 0,
742
- "minimum": 0
743
- },
744
- "SearchRequest": {
745
- "type": "object",
746
- "properties": {
747
- "limit": {
748
- "type": "integer",
749
- "format": "int32",
750
- "maximum": 200,
751
- "minimum": 1
752
2342
  },
753
- "query": {
754
- "$ref": "#/components/schemas/Query"
2343
+ "startDate": {
2344
+ "type": "string",
2345
+ "format": "date-time",
2346
+ "description": "The start date of the container of the assignment (a Campaign or ABTest). If scheduleType is\n scheduleType : \"multiple\" or scheduleType : \"none\", then then result is null. Also, a null\n date returns null."
755
2347
  },
756
- "sorts": {
2348
+ "upcomingAbtestAssignments": {
757
2349
  "type": "array",
2350
+ "description": "A list of upcoming A/B tests this is assigned to.",
758
2351
  "items": {
759
- "$ref": "#/components/schemas/Sort"
2352
+ "$ref": "#/components/schemas/PromotionAbtestGroupAssignment"
760
2353
  }
761
2354
  },
762
- "offset": {
763
- "$ref": "#/components/schemas/Offset"
2355
+ "upcomingCampaignAssignments": {
2356
+ "type": "array",
2357
+ "description": "A list of upcoming campaigns this is assigned to.",
2358
+ "items": {
2359
+ "$ref": "#/components/schemas/PromotionCampaignAssignment"
2360
+ }
764
2361
  }
765
2362
  },
766
2363
  "required": [
767
- "query"
2364
+ "active",
2365
+ "activeCampaignAssignments",
2366
+ "campaignId",
2367
+ "enabled",
2368
+ "schedule",
2369
+ "scheduleType"
768
2370
  ]
769
2371
  },
770
- "Total": {
771
- "type": "integer",
772
- "format": "int32",
773
- "default": 0,
774
- "minimum": 0
775
- },
776
- "ResultBase": {
2372
+ "Tag": {
777
2373
  "type": "object",
2374
+ "additionalProperties": false,
2375
+ "description": "Document representing a tag",
778
2376
  "properties": {
779
- "limit": {
780
- "type": "integer",
781
- "format": "int32"
782
- },
783
- "total": {
784
- "$ref": "#/components/schemas/Total"
2377
+ "tagId": {
2378
+ "type": "string",
2379
+ "description": "The ID of the tag."
785
2380
  }
786
2381
  },
787
2382
  "required": [
788
- "limit",
789
- "total"
2383
+ "tagId"
790
2384
  ]
791
2385
  },
792
- "PaginatedResultBase": {
2386
+ "PromotionSearchResult": {
793
2387
  "allOf": [
794
2388
  {
795
- "$ref": "#/components/schemas/ResultBase"
2389
+ "$ref": "#/components/schemas/PaginatedSearchResult"
796
2390
  }
797
2391
  ],
2392
+ "description": "Document representing a promotion search result.",
798
2393
  "properties": {
799
- "offset": {
800
- "$ref": "#/components/schemas/Offset"
2394
+ "hits": {
2395
+ "type": "array",
2396
+ "description": "The sorted array of promotion search hits. Can be empty.",
2397
+ "items": {
2398
+ "$ref": "#/components/schemas/Promotion"
2399
+ }
801
2400
  }
802
2401
  },
803
2402
  "required": [
804
- "limit",
805
- "offset",
806
- "total"
2403
+ "hits"
807
2404
  ]
808
2405
  },
809
- "PaginatedSearchResult": {
810
- "additionalProperties": false,
811
- "allOf": [
812
- {
813
- "$ref": "#/components/schemas/PaginatedResultBase"
814
- }
815
- ],
2406
+ "ErrorResponse": {
2407
+ "type": "object",
2408
+ "additionalProperties": true,
816
2409
  "properties": {
817
- "query": {
818
- "$ref": "#/components/schemas/Query"
2410
+ "title": {
2411
+ "type": "string",
2412
+ "description": "A short, human-readable summary of the problem\ntype. It will not change from occurrence to occurrence of the \nproblem, except for purposes of localization\n",
2413
+ "example": "You do not have enough credit",
2414
+ "maxLength": 256
819
2415
  },
820
- "sorts": {
821
- "type": "array",
822
- "items": {
823
- "$ref": "#/components/schemas/Sort"
824
- }
2416
+ "type": {
2417
+ "type": "string",
2418
+ "description": "A URI reference [RFC3986] that identifies the\nproblem type. This specification encourages that, when\ndereferenced, it provide human-readable documentation for the\nproblem type (e.g., using HTML [W3C.REC-html5-20141028]). When\nthis member is not present, its value is assumed to be\n\"about:blank\". It accepts relative URIs; this means\nthat they must be resolved relative to the document's base URI, as\nper [RFC3986], Section 5.\n",
2419
+ "example": "NotEnoughMoney",
2420
+ "maxLength": 2048
825
2421
  },
826
- "hits": {
827
- "type": "array",
828
- "items": {
829
- "type": "object"
830
- }
2422
+ "detail": {
2423
+ "type": "string",
2424
+ "description": "A human-readable explanation specific to this occurrence of the problem.",
2425
+ "example": "Your current balance is 30, but that costs 50"
2426
+ },
2427
+ "instance": {
2428
+ "type": "string",
2429
+ "description": "A URI reference that identifies the specific\noccurrence of the problem. It may or may not yield further\ninformation if dereferenced. It accepts relative URIs; this means\nthat they must be resolved relative to the document's base URI, as\nper [RFC3986], Section 5.\n",
2430
+ "example": "/account/12345/msgs/abc",
2431
+ "maxLength": 2048
831
2432
  }
832
2433
  },
833
2434
  "required": [
834
- "query"
2435
+ "detail",
2436
+ "title",
2437
+ "type"
835
2438
  ]
836
2439
  },
837
- "TimeOfDay": {
2440
+ "CurrencyCode": {
2441
+ "type": "string",
2442
+ "description": "A three letter uppercase currency code conforming to the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard, or the string `N/A` indicating that a currency is not applicable.",
2443
+ "example": "USD",
2444
+ "pattern": "^([A-Z][A-Z][A-Z]|N/A)$"
2445
+ },
2446
+ "Money": {
2447
+ "type": "object",
2448
+ "description": "A combination of a Currency and an amount of that Currency.",
2449
+ "properties": {
2450
+ "currencyMnemonic": {
2451
+ "$ref": "#/components/schemas/CurrencyCode"
2452
+ },
2453
+ "value": {
2454
+ "type": "number",
2455
+ "format": "double",
2456
+ "description": "The amount of money for the given currency.",
2457
+ "example": 1234.56
2458
+ }
2459
+ }
2460
+ },
2461
+ "Percentage": {
2462
+ "type": "number",
2463
+ "format": "double",
2464
+ "description": "A percentage value, from 0 to 100.",
2465
+ "example": 10,
2466
+ "maximum": 100,
2467
+ "minimum": 0
2468
+ },
2469
+ "ProductId": {
2470
+ "type": "string",
2471
+ "description": "The id (SKU) of the product.",
2472
+ "example": "apple-ipod-classic",
2473
+ "maxLength": 100,
2474
+ "minLength": 1
2475
+ },
2476
+ "Discount": {
838
2477
  "type": "object",
839
2478
  "additionalProperties": false,
2479
+ "description": "A discount value object. The type determines which value field applies: amount, fixed_price, total_fixed_price,\n and fixed_price_shipping use amount; percentage and percent_off_options use percentage; price_book_price uses\n priceBookId; bonus and bonus_choice use bonusProducts; free_shipping carries no value.\nValid types depend on the enclosing promotion class - the schema does not enforce this, so the backend rejects an\n out-of-class type: product rules accept amount, percentage, fixed_price, total_fixed_price, price_book_price, bonus,\n bonus_choice, free_shipping, fixed_price_shipping, percent_off_options; order rules accept amount, percentage, bonus,\n bonus_choice; shipping rules accept fixed_price, percentage, amount. A BOGO discount is a stricter product subset:\n fixed_price, price_book_price, percentage, amount.",
840
2480
  "properties": {
841
- "timeFrom": {
842
- "type": "string"
2481
+ "type": {
2482
+ "type": "string",
2483
+ "description": "The kind of discount.",
2484
+ "enum": [
2485
+ "amount",
2486
+ "percentage",
2487
+ "fixed_price",
2488
+ "total_fixed_price",
2489
+ "price_book_price",
2490
+ "bonus",
2491
+ "bonus_choice",
2492
+ "free_shipping",
2493
+ "fixed_price_shipping",
2494
+ "percent_off_options"
2495
+ ],
2496
+ "example": "amount"
2497
+ },
2498
+ "amount": {
2499
+ "allOf": [
2500
+ {
2501
+ "$ref": "#/components/schemas/Money"
2502
+ }
2503
+ ],
2504
+ "description": "The monetary value, for amount, fixed_price, total_fixed_price, and fixed_price_shipping discounts."
843
2505
  },
844
- "timeTo": {
845
- "type": "string"
2506
+ "percentage": {
2507
+ "allOf": [
2508
+ {
2509
+ "$ref": "#/components/schemas/Percentage"
2510
+ }
2511
+ ],
2512
+ "description": "The percentage off, for percentage and percent_off_options discounts."
2513
+ },
2514
+ "priceBookId": {
2515
+ "type": "string",
2516
+ "description": "The price book the discounted price is taken from, for a price_book_price discount.",
2517
+ "example": "usd-list-prices",
2518
+ "maxLength": 256
2519
+ },
2520
+ "bonusProducts": {
2521
+ "type": "array",
2522
+ "description": "The bonus products offered, for bonus and bonus_choice discounts.",
2523
+ "items": {
2524
+ "$ref": "#/components/schemas/ProductId"
2525
+ }
846
2526
  }
847
2527
  },
848
2528
  "required": [
849
- "timeFrom",
850
- "timeTo"
2529
+ "type"
851
2530
  ]
852
2531
  },
853
- "Recurrence": {
2532
+ "TieredDiscount": {
854
2533
  "type": "object",
855
2534
  "additionalProperties": false,
2535
+ "description": "A single discount tier - a threshold and the discount applied once the threshold is met. \n All tiers in the same rule MUST carry the same conditionType - the backend applies one condition-type to the whole\n tier set and rejects mixed values.",
856
2536
  "properties": {
857
- "dayOfWeek": {
858
- "type": "array",
859
- "items": {
860
- "type": "string",
861
- "enum": [
862
- "monday",
863
- "tuesday",
864
- "wednesday",
865
- "thursday",
866
- "friday",
867
- "saturday",
868
- "sunday"
869
- ]
870
- }
871
- },
872
- "timeOfDay": {
2537
+ "threshold": {
2538
+ "type": "number",
2539
+ "format": "double",
2540
+ "description": "The threshold at which this tier's discount applies.",
2541
+ "example": 100,
2542
+ "minimum": 0
2543
+ },
2544
+ "conditionType": {
2545
+ "type": "string",
2546
+ "description": "The kind of threshold. All tiers in the same rule MUST send the same value. Valid values depend on the promotion class -\n product: product_quantity, product_amount; order: order_total, product_quantity, product_combination;\n shipping: shipment_total, product_quantity, product_combination.",
2547
+ "enum": [
2548
+ "product_quantity",
2549
+ "product_amount",
2550
+ "order_total",
2551
+ "product_combination",
2552
+ "shipment_total"
2553
+ ],
2554
+ "example": "order_total"
2555
+ },
2556
+ "discount": {
873
2557
  "allOf": [
874
2558
  {
875
- "$ref": "#/components/schemas/TimeOfDay"
2559
+ "$ref": "#/components/schemas/Discount"
876
2560
  }
877
- ]
2561
+ ],
2562
+ "description": "The discount applied at this tier."
878
2563
  }
879
2564
  },
880
2565
  "required": [
881
- "dayOfWeek",
882
- "timeOfDay"
2566
+ "conditionType",
2567
+ "discount",
2568
+ "threshold"
883
2569
  ]
884
2570
  },
885
- "Schedule": {
2571
+ "BogoDiscount": {
886
2572
  "type": "object",
887
2573
  "additionalProperties": false,
2574
+ "description": "A buy-one-get-one discount. In Business Manager the Type selector (Buy X / Get Y) is Product-class only.",
888
2575
  "properties": {
889
- "endDate": {
890
- "type": "string",
891
- "format": "date-time"
892
- },
893
- "recurrence": {
2576
+ "threshold": {
2577
+ "type": "number",
2578
+ "format": "double",
2579
+ "description": "The quantity of eligible products required.",
2580
+ "example": 1,
2581
+ "minimum": 0
2582
+ },
2583
+ "discount": {
894
2584
  "allOf": [
895
2585
  {
896
- "$ref": "#/components/schemas/Recurrence"
2586
+ "$ref": "#/components/schemas/Discount"
897
2587
  }
898
- ]
2588
+ ],
2589
+ "description": "The discount applied to the bonus product; typically fixed_price, percentage, or amount."
899
2590
  },
900
- "startDate": {
901
- "type": "string",
902
- "format": "date-time"
2591
+ "eligibleQuantity": {
2592
+ "type": "integer",
2593
+ "format": "int32",
2594
+ "description": "The number of eligible products that earn the bonus.",
2595
+ "example": 1,
2596
+ "minimum": 1
2597
+ },
2598
+ "requireExactEligibleQuantity": {
2599
+ "type": "boolean",
2600
+ "description": "Determines if exactly the eligible quantity is required, rather than at least.",
2601
+ "example": false
903
2602
  }
904
2603
  }
905
2604
  },
906
- "PromotionAbtestGroupAssignment": {
2605
+ "ProductPromotionRule": {
907
2606
  "type": "object",
908
2607
  "additionalProperties": false,
2608
+ "description": "The discount rule for a product promotion.",
909
2609
  "properties": {
910
- "abtestDescription": {
911
- "type": "string"
912
- },
913
- "abtestId": {
914
- "type": "string"
915
- },
916
- "enabled": {
917
- "type": "boolean"
918
- },
919
- "schedule": {
920
- "$ref": "#/components/schemas/Schedule"
921
- },
922
- "segmentDescription": {
923
- "type": "string"
924
- },
925
- "segmentId": {
926
- "type": "string"
927
- }
928
- },
929
- "required": [
930
- "abtestDescription",
931
- "abtestId",
932
- "enabled",
933
- "schedule",
934
- "segmentDescription",
935
- "segmentId"
936
- ]
937
- },
938
- "CampaignId": {
939
- "type": "string",
940
- "maxLength": 256,
941
- "minLength": 1
942
- },
943
- "Campaign": {
944
- "type": "object",
945
- "additionalProperties": {},
946
- "properties": {
947
- "campaignId": {
948
- "$ref": "#/components/schemas/CampaignId"
949
- },
950
- "coupons": {
951
- "type": "array",
952
- "items": {
953
- "type": "string"
954
- }
955
- },
956
- "creationDate": {
2610
+ "promotionClass": {
957
2611
  "type": "string",
958
- "format": "date-time"
2612
+ "description": "The promotion class discriminator. Always product for a product promotion rule.",
2613
+ "enum": [
2614
+ "product"
2615
+ ],
2616
+ "example": "product"
959
2617
  },
960
- "customerGroups": {
2618
+ "discount": {
2619
+ "allOf": [
2620
+ {
2621
+ "$ref": "#/components/schemas/Discount"
2622
+ }
2623
+ ],
2624
+ "description": "The discount applied by this rule."
2625
+ },
2626
+ "tiers": {
961
2627
  "type": "array",
2628
+ "description": "The tiered discounts, applied by threshold. Empty or absent for a non-tiered rule.",
962
2629
  "items": {
963
- "type": "string"
2630
+ "$ref": "#/components/schemas/TieredDiscount"
964
2631
  }
965
2632
  },
966
- "description": {
967
- "type": "string",
968
- "maxLength": 4000
969
- },
970
- "enabled": {
971
- "type": "boolean"
2633
+ "bogo": {
2634
+ "allOf": [
2635
+ {
2636
+ "$ref": "#/components/schemas/BogoDiscount"
2637
+ }
2638
+ ],
2639
+ "description": "The buy-one-get-one discount. Present only for a buy-X-get-Y product promotion."
972
2640
  },
973
- "endDate": {
974
- "type": "string",
975
- "format": "date-time"
2641
+ "maxApplications": {
2642
+ "type": "integer",
2643
+ "format": "int32",
2644
+ "description": "The maximum number of times the discount can be applied.",
2645
+ "example": 1,
2646
+ "minimum": 1
976
2647
  },
977
- "lastModified": {
978
- "type": "string",
979
- "format": "date-time"
2648
+ "identicalProducts": {
2649
+ "type": "boolean",
2650
+ "description": "Determines if the qualifying and discounted products must all be identical.",
2651
+ "example": false
980
2652
  },
981
- "sourceCodeGroups": {
982
- "type": "array",
983
- "items": {
984
- "type": "string"
985
- }
2653
+ "prorate": {
2654
+ "type": "boolean",
2655
+ "description": "Determines if the discount is prorated across the eligible items.",
2656
+ "example": false
986
2657
  },
987
- "startDate": {
988
- "type": "string",
989
- "format": "date-time"
2658
+ "disableGlobalExcludedProducts": {
2659
+ "type": "boolean",
2660
+ "default": false,
2661
+ "description": "Determines if this rule ignores the site-level global product exclusions. Distinct from the\n promotion-level disableGloballyExcluded flag.",
2662
+ "example": false
990
2663
  }
991
2664
  },
992
2665
  "required": [
993
- "campaignId"
2666
+ "promotionClass"
994
2667
  ]
995
2668
  },
996
- "Promotion": {
2669
+ "OrderPromotionRule": {
997
2670
  "type": "object",
998
- "additionalProperties": {},
2671
+ "additionalProperties": false,
2672
+ "description": "The discount rule for an order promotion.",
999
2673
  "properties": {
1000
- "archived": {
1001
- "type": "boolean"
1002
- },
1003
- "assignmentInformation": {
1004
- "allOf": [
1005
- {
1006
- "$ref": "#/components/schemas/PromotionAssignmentInformation"
1007
- }
1008
- ]
1009
- },
1010
- "creationDate": {
1011
- "type": "string",
1012
- "format": "date-time"
1013
- },
1014
- "currencyCode": {
1015
- "type": "string",
1016
- "maxLength": 3
1017
- },
1018
- "disableGloballyExcluded": {
1019
- "type": "boolean"
1020
- },
1021
- "enabled": {
1022
- "type": "boolean"
1023
- },
1024
- "exclusivity": {
1025
- "type": "string",
1026
- "enum": [
1027
- "no",
1028
- "class",
1029
- "global"
1030
- ]
1031
- },
1032
- "id": {
1033
- "type": "string"
1034
- },
1035
- "lastModified": {
1036
- "type": "string",
1037
- "format": "date-time"
1038
- },
1039
- "name": {
1040
- "type": "object",
1041
- "additionalProperties": {
1042
- "type": "string"
1043
- }
1044
- },
1045
2674
  "promotionClass": {
1046
2675
  "type": "string",
2676
+ "description": "The promotion class discriminator. Always order for an order promotion rule.",
1047
2677
  "enum": [
1048
- "product",
1049
- "shipping",
1050
2678
  "order"
1051
- ]
2679
+ ],
2680
+ "example": "order"
1052
2681
  },
1053
- "tags": {
1054
- "type": "array",
1055
- "items": {
1056
- "$ref": "#/components/schemas/Tag"
1057
- }
1058
- }
1059
- }
1060
- },
1061
- "PromotionCampaignAssignment": {
1062
- "type": "object",
1063
- "additionalProperties": false,
1064
- "properties": {
1065
- "campaign": {
2682
+ "discount": {
1066
2683
  "allOf": [
1067
2684
  {
1068
- "$ref": "#/components/schemas/Campaign"
2685
+ "$ref": "#/components/schemas/Discount"
1069
2686
  }
1070
- ]
1071
- },
1072
- "campaignId": {
1073
- "type": "string",
1074
- "maxLength": 256,
1075
- "minLength": 1
1076
- },
1077
- "coupons": {
1078
- "type": "array",
1079
- "items": {
1080
- "type": "string"
1081
- }
2687
+ ],
2688
+ "description": "The discount applied by this rule."
1082
2689
  },
1083
- "customerGroups": {
2690
+ "tiers": {
1084
2691
  "type": "array",
2692
+ "description": "The tiered discounts, applied by threshold. Empty or absent for a non-tiered rule.",
1085
2693
  "items": {
1086
- "type": "string"
2694
+ "$ref": "#/components/schemas/TieredDiscount"
1087
2695
  }
1088
2696
  },
1089
- "description": {
1090
- "type": "string",
1091
- "maxLength": 4000
1092
- },
1093
- "enabled": {
1094
- "type": "boolean"
2697
+ "discountOnlyQualifyingProducts": {
2698
+ "type": "boolean",
2699
+ "description": "Determines if only the qualifying products are discounted.",
2700
+ "example": false
1095
2701
  },
1096
- "promotion": {
1097
- "allOf": [
1098
- {
1099
- "$ref": "#/components/schemas/Promotion"
1100
- }
1101
- ]
2702
+ "excludeDiscountedProducts": {
2703
+ "type": "boolean",
2704
+ "description": "Determines if products that already received a product-level discount are excluded.",
2705
+ "example": false
1102
2706
  },
1103
- "promotionId": {
1104
- "type": "string",
1105
- "maxLength": 256,
1106
- "minLength": 1
2707
+ "disableGlobalExcludedProducts": {
2708
+ "type": "boolean",
2709
+ "default": false,
2710
+ "description": "Determines if this rule ignores the site-level global product exclusions. Distinct from the\n promotion-level disableGloballyExcluded flag.",
2711
+ "example": false
1107
2712
  },
1108
- "rank": {
1109
- "type": "integer",
1110
- "format": "int32"
2713
+ "enableUpsells": {
2714
+ "type": "boolean",
2715
+ "description": "Determines if the promotion is returned as an approaching promotion to encourage upsell.",
2716
+ "example": false
1111
2717
  },
1112
- "schedule": {
2718
+ "upsellThreshold": {
1113
2719
  "allOf": [
1114
2720
  {
1115
- "$ref": "#/components/schemas/Schedule"
2721
+ "$ref": "#/components/schemas/Money"
1116
2722
  }
1117
- ]
1118
- },
1119
- "sourceCodeGroups": {
1120
- "type": "array",
1121
- "items": {
1122
- "type": "string"
1123
- }
2723
+ ],
2724
+ "description": "The amount by which the merchandise total may fall short of the purchase condition and still upsell."
1124
2725
  }
1125
2726
  },
1126
2727
  "required": [
1127
- "campaignId",
1128
- "description",
1129
- "enabled",
1130
- "promotionId",
1131
- "schedule"
2728
+ "promotionClass"
1132
2729
  ]
1133
2730
  },
1134
- "PromotionAssignmentInformation": {
2731
+ "PromotedShippingMethods": {
1135
2732
  "type": "object",
1136
2733
  "additionalProperties": false,
2734
+ "description": "The shipping methods a shipping promotion applies to.",
1137
2735
  "properties": {
1138
- "abtestId": {
1139
- "type": "string"
1140
- },
1141
- "abtestSegmentId": {
1142
- "type": "string"
1143
- },
1144
- "active": {
1145
- "type": "boolean"
1146
- },
1147
- "activeAbtestAssignments": {
2736
+ "methodIds": {
1148
2737
  "type": "array",
2738
+ "description": "The shipping method IDs.",
1149
2739
  "items": {
1150
- "$ref": "#/components/schemas/PromotionAbtestGroupAssignment"
2740
+ "type": "string",
2741
+ "example": "001",
2742
+ "maxLength": 256
1151
2743
  }
2744
+ }
2745
+ }
2746
+ },
2747
+ "ShippingPromotionRule": {
2748
+ "type": "object",
2749
+ "additionalProperties": false,
2750
+ "description": "The discount rule for a shipping promotion.",
2751
+ "properties": {
2752
+ "promotionClass": {
2753
+ "type": "string",
2754
+ "description": "The promotion class discriminator. Always shipping for a shipping promotion rule.",
2755
+ "enum": [
2756
+ "shipping"
2757
+ ],
2758
+ "example": "shipping"
1152
2759
  },
1153
- "activeCampaignAssignments": {
2760
+ "discount": {
2761
+ "allOf": [
2762
+ {
2763
+ "$ref": "#/components/schemas/Discount"
2764
+ }
2765
+ ],
2766
+ "description": "The discount applied by this rule."
2767
+ },
2768
+ "tiers": {
1154
2769
  "type": "array",
2770
+ "description": "The tiered discounts, applied by threshold. Empty or absent for a non-tiered rule.",
1155
2771
  "items": {
1156
- "$ref": "#/components/schemas/PromotionCampaignAssignment"
2772
+ "$ref": "#/components/schemas/TieredDiscount"
1157
2773
  }
1158
2774
  },
1159
- "campaignId": {
1160
- "type": "string"
1161
- },
1162
- "enabled": {
1163
- "type": "boolean"
1164
- },
1165
- "endDate": {
1166
- "type": "string",
1167
- "format": "date-time"
1168
- },
1169
- "schedule": {
2775
+ "shippingMethodQualifiers": {
1170
2776
  "allOf": [
1171
2777
  {
1172
- "$ref": "#/components/schemas/Schedule"
2778
+ "$ref": "#/components/schemas/PromotedShippingMethods"
1173
2779
  }
1174
- ]
2780
+ ],
2781
+ "description": "The shipping methods the promotion applies to. Shipping-class only."
1175
2782
  },
1176
- "scheduleType": {
2783
+ "prohibitNonqualifyingProducts": {
2784
+ "type": "boolean",
2785
+ "description": "Determines if the shipment must contain only qualifying products for the discount to apply.",
2786
+ "example": false
2787
+ },
2788
+ "disableGlobalExcludedProducts": {
2789
+ "type": "boolean",
2790
+ "default": false,
2791
+ "description": "Determines if this rule ignores the site-level global product exclusions. Distinct from the\n promotion-level disableGloballyExcluded flag.",
2792
+ "example": false
2793
+ },
2794
+ "maxApplications": {
2795
+ "type": "integer",
2796
+ "format": "int32",
2797
+ "description": "The maximum number of times the discount can be applied.",
2798
+ "example": 1,
2799
+ "minimum": 1
2800
+ }
2801
+ },
2802
+ "required": [
2803
+ "promotionClass"
2804
+ ]
2805
+ },
2806
+ "PromotionRule": {
2807
+ "description": "The discount rule for a promotion. The concrete shape is selected by promotionClass: a product promotion uses\n ProductPromotionRule, an order promotion uses OrderPromotionRule, and a shipping promotion uses ShippingPromotionRule.",
2808
+ "discriminator": {
2809
+ "propertyName": "promotionClass",
2810
+ "mapping": {
2811
+ "product": "#/components/schemas/ProductPromotionRule",
2812
+ "order": "#/components/schemas/OrderPromotionRule",
2813
+ "shipping": "#/components/schemas/ShippingPromotionRule"
2814
+ }
2815
+ },
2816
+ "oneOf": [
2817
+ {
2818
+ "$ref": "#/components/schemas/ProductPromotionRule"
2819
+ },
2820
+ {
2821
+ "$ref": "#/components/schemas/OrderPromotionRule"
2822
+ },
2823
+ {
2824
+ "$ref": "#/components/schemas/ShippingPromotionRule"
2825
+ }
2826
+ ]
2827
+ },
2828
+ "ProductCondition": {
2829
+ "type": "object",
2830
+ "additionalProperties": false,
2831
+ "description": "A single product condition - a condition type, a comparison operator, and one or more values. Each condition type\n supports a specific operator (for example, category supports is_equal, is_exactly,\n is_child_of; brand and attribute add exists / does_not_exist).",
2832
+ "properties": {
2833
+ "type": {
1177
2834
  "type": "string",
2835
+ "description": "The kind of product condition.",
1178
2836
  "enum": [
1179
- "none",
1180
- "campaign",
1181
- "abtest",
1182
- "multiple"
1183
- ]
2837
+ "brand",
2838
+ "product_id",
2839
+ "category",
2840
+ "price",
2841
+ "inventory",
2842
+ "attribute",
2843
+ "product_set",
2844
+ "price_book",
2845
+ "option"
2846
+ ],
2847
+ "example": "category"
1184
2848
  },
1185
- "startDate": {
2849
+ "operator": {
1186
2850
  "type": "string",
1187
- "format": "date-time"
2851
+ "description": "The comparison operator, as a lower_snake_case token. The valid set depends on the condition type:\n category: is_equal, is_exactly, is_direct_child_of, is_child_of, is_direct_parent_of, is_parent_of, is_sibling_of;\n brand: exists, does_not_exist, is_equal, is_not_equal, starts_with, ends_with, contains, does_not_contain;\n product_id: is_equal, is_not_equal, starts_with, ends_with, contains, does_not_contain;\n price: less_than, greater_than, ends_with;\n inventory: less_than, greater_than;\n attribute: less_than, greater_than, equals, is_not_equal, exists, does_not_exist, starts_with, ends_with, contains, does_not_contain;\n product_set: is_equal, exists;\n price_book: storefront_price_in_recursive, storefront_price_in, price_in;\n option: is_equal, exists, does_not_exist.",
2852
+ "example": "is_equal",
2853
+ "maxLength": 256
1188
2854
  },
1189
- "upcomingAbtestAssignments": {
2855
+ "values": {
1190
2856
  "type": "array",
2857
+ "description": "The values compared against.",
1191
2858
  "items": {
1192
- "$ref": "#/components/schemas/PromotionAbtestGroupAssignment"
2859
+ "type": "string",
2860
+ "example": "electronics",
2861
+ "maxLength": 256
1193
2862
  }
1194
2863
  },
1195
- "upcomingCampaignAssignments": {
1196
- "type": "array",
1197
- "items": {
1198
- "$ref": "#/components/schemas/PromotionCampaignAssignment"
1199
- }
2864
+ "catalogId": {
2865
+ "type": "string",
2866
+ "description": "The id of the catalog that owns the categories listed in `values`. Required when `type` is `category; ignored for every other condition type.",
2867
+ "example": "storefront-catalog-m-en",
2868
+ "maxLength": 256
2869
+ },
2870
+ "attributeId": {
2871
+ "type": "string",
2872
+ "description": "The id of the custom product attribute to compare. Required when `type` is `attribute`; ignored for every\n other condition type.",
2873
+ "example": "color",
2874
+ "maxLength": 256
2875
+ },
2876
+ "optionId": {
2877
+ "type": "string",
2878
+ "description": "The id of the product option to compare. Required when `type` is `option`; ignored for every other\n condition type.",
2879
+ "example": "memorySize",
2880
+ "maxLength": 256
1200
2881
  }
1201
2882
  },
1202
2883
  "required": [
1203
- "active",
1204
- "activeCampaignAssignments",
1205
- "campaignId",
1206
- "enabled",
1207
- "schedule",
1208
- "scheduleType"
2884
+ "type"
1209
2885
  ]
1210
2886
  },
1211
- "Tag": {
2887
+ "ProductConditionGroup": {
1212
2888
  "type": "object",
1213
2889
  "additionalProperties": false,
2890
+ "description": "A group of product conditions.",
1214
2891
  "properties": {
1215
- "tagId": {
1216
- "type": "string"
2892
+ "conditions": {
2893
+ "type": "array",
2894
+ "description": "The conditions in this group.",
2895
+ "items": {
2896
+ "$ref": "#/components/schemas/ProductCondition"
2897
+ }
1217
2898
  }
1218
- },
1219
- "required": [
1220
- "tagId"
1221
- ]
2899
+ }
1222
2900
  },
1223
- "PromotionSearchResult": {
1224
- "allOf": [
1225
- {
1226
- "$ref": "#/components/schemas/PaginatedSearchResult"
2901
+ "ProductSpecification": {
2902
+ "type": "object",
2903
+ "additionalProperties": false,
2904
+ "description": "A set of product conditions. A product matches when it satisfies the included-products groups and none of the\n excluded-products groups.",
2905
+ "properties": {
2906
+ "includedProducts": {
2907
+ "type": "array",
2908
+ "description": "The condition groups a product must match.",
2909
+ "items": {
2910
+ "$ref": "#/components/schemas/ProductConditionGroup"
2911
+ }
2912
+ },
2913
+ "excludedProducts": {
2914
+ "type": "array",
2915
+ "description": "The condition groups that exclude a product.",
2916
+ "items": {
2917
+ "$ref": "#/components/schemas/ProductConditionGroup"
2918
+ }
1227
2919
  }
1228
- ],
2920
+ }
2921
+ },
2922
+ "PromotedPaymentMethods": {
2923
+ "type": "object",
2924
+ "additionalProperties": false,
2925
+ "description": "The payment methods a promotion is restricted to.",
1229
2926
  "properties": {
1230
- "hits": {
2927
+ "methodIds": {
1231
2928
  "type": "array",
2929
+ "description": "The payment method IDs. Each is either a payment method ID or a credit card type prefixed with CREDIT_CARD\n (for example CREDIT_CARD.Visa).",
1232
2930
  "items": {
1233
- "$ref": "#/components/schemas/Promotion"
2931
+ "type": "string",
2932
+ "example": "CREDIT_CARD.Visa",
2933
+ "maxLength": 256
1234
2934
  }
1235
2935
  }
2936
+ }
2937
+ },
2938
+ "DiscountRule": {
2939
+ "type": "object",
2940
+ "additionalProperties": {
2941
+ "description": "This type supports additional properties passed along with the defined properties of this API.\nTo indicate that the properties were defined and expected to be handled as additional properties, they are expected to be prefixed with a `c_`.\nThe type will reject any property that does not fit this pattern, only allowing additional properties beginning with the known prefix.",
2942
+ "example": "c_trackingId",
2943
+ "title": "Additional Property Support"
1236
2944
  },
1237
- "required": [
1238
- "hits"
1239
- ]
2945
+ "description": "The discount-rule document for a promotion, managed as a sub-resource at /promotions/{id}/discount-rule. It holds\n the discount rule (shape selected by promotionClass), the product qualifiers, and the payment-method qualifiers.\n The promotion shell (id, name, enabled, promotionClass) is managed separately on the\n parent /promotions/{id} resource.",
2946
+ "properties": {
2947
+ "promotionRule": {
2948
+ "allOf": [
2949
+ {
2950
+ "$ref": "#/components/schemas/PromotionRule"
2951
+ }
2952
+ ],
2953
+ "description": "The discount rule for this promotion. Its shape is selected by the parent promotion's promotionClass (product,\n order, or shipping) and holds the discount, tiers, BOGO, thresholds, max-applications, and class-specific flags."
2954
+ },
2955
+ "qualifyingProducts": {
2956
+ "allOf": [
2957
+ {
2958
+ "$ref": "#/components/schemas/ProductSpecification"
2959
+ }
2960
+ ],
2961
+ "description": "The products a customer must purchase for the promotion to apply."
2962
+ },
2963
+ "discountedProducts": {
2964
+ "allOf": [
2965
+ {
2966
+ "$ref": "#/components/schemas/ProductSpecification"
2967
+ }
2968
+ ],
2969
+ "description": "The products that receive the discount. Valid only for a product-class promotion; supplying it for an order or shipping\n promotion is rejected with a 400."
2970
+ },
2971
+ "excludedProducts": {
2972
+ "allOf": [
2973
+ {
2974
+ "$ref": "#/components/schemas/ProductSpecification"
2975
+ }
2976
+ ],
2977
+ "description": "The products excluded from both qualifying for and receiving the discount. Valid only for an order-class\n promotion; supplying it for a product or shipping promotion is rejected with a 400."
2978
+ },
2979
+ "paymentMethodQualifiers": {
2980
+ "allOf": [
2981
+ {
2982
+ "$ref": "#/components/schemas/PromotedPaymentMethods"
2983
+ }
2984
+ ],
2985
+ "description": "The payment methods the promotion is restricted to."
2986
+ }
2987
+ }
1240
2988
  },
1241
- "ErrorResponse": {
2989
+ "PromotionCompatibility": {
1242
2990
  "type": "object",
1243
- "additionalProperties": true,
2991
+ "additionalProperties": {
2992
+ "description": "This type supports additional properties passed along with the defined properties of this API.\nTo indicate that the properties were defined and expected to be handled as additional properties, they are expected to be prefixed with a `c_`.\nThe type will reject any property that does not fit this pattern, only allowing additional properties beginning with the known prefix.",
2993
+ "example": "c_trackingId",
2994
+ "title": "Additional Property Support"
2995
+ },
2996
+ "description": "The compatibility (stacking / exclusivity) document for a promotion, managed as a sub-resource at\n /promotions/{id}/compatibility. It controls how this promotion combines with other promotions of the same class.",
1244
2997
  "properties": {
1245
- "title": {
2998
+ "exclusivity": {
1246
2999
  "type": "string",
1247
- "maxLength": 256
3000
+ "description": "Determines if the promotion can be combined with other promotions of the same promotion class, cannot be\n combined with any other promotion, or has no exclusivity restriction.",
3001
+ "enum": [
3002
+ "no",
3003
+ "class",
3004
+ "global"
3005
+ ],
3006
+ "example": "class"
1248
3007
  },
1249
- "type": {
3008
+ "exclusivityGroup": {
1250
3009
  "type": "string",
1251
- "maxLength": 2048
3010
+ "description": "The ID of the exclusivity group this promotion belongs to. Only meaningful when exclusivity restricts\n combination to promotions within the same group.",
3011
+ "example": "SummerSale",
3012
+ "maxLength": 256
1252
3013
  },
1253
- "detail": {
1254
- "type": "string"
3014
+ "combinablePromotions": {
3015
+ "type": "array",
3016
+ "description": "The set of promotion or promotion-group IDs this promotion can be combined with.",
3017
+ "items": {
3018
+ "type": "string",
3019
+ "example": "10%offOrder",
3020
+ "maxLength": 256
3021
+ }
1255
3022
  },
1256
- "instance": {
1257
- "type": "string",
1258
- "maxLength": 2048
3023
+ "mutuallyExclusivePromotions": {
3024
+ "type": "array",
3025
+ "description": "The set of promotion or promotion-group IDs this promotion cannot be combined with.",
3026
+ "items": {
3027
+ "type": "string",
3028
+ "example": "20%offOrder",
3029
+ "maxLength": 256
3030
+ }
1259
3031
  }
1260
- },
1261
- "required": [
1262
- "detail",
1263
- "title",
1264
- "type"
1265
- ]
3032
+ }
1266
3033
  }
1267
3034
  },
1268
3035
  "parameters": {
1269
3036
  "organizationId": {
1270
3037
  "name": "organizationId",
1271
3038
  "in": "path",
3039
+ "description": "An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).",
1272
3040
  "required": true,
1273
3041
  "style": "simple",
1274
3042
  "explode": false,
1275
3043
  "schema": {
1276
3044
  "$ref": "#/components/schemas/OrganizationId"
1277
- }
3045
+ },
3046
+ "example": "f_ecom_zzxy_prd"
1278
3047
  },
1279
3048
  "siteId": {
1280
3049
  "name": "siteId",
1281
3050
  "in": "query",
3051
+ "description": "The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.",
1282
3052
  "required": true,
1283
3053
  "style": "form",
1284
3054
  "explode": true,
1285
3055
  "schema": {
1286
3056
  "$ref": "#/components/schemas/SiteId"
3057
+ },
3058
+ "examples": {
3059
+ "SiteId": {
3060
+ "value": "RefArch"
3061
+ }
1287
3062
  }
1288
3063
  },
1289
3064
  "id": {
1290
3065
  "name": "id",
1291
3066
  "in": "path",
3067
+ "description": "The ID of the promotion to create.",
1292
3068
  "required": true,
1293
3069
  "style": "simple",
1294
3070
  "explode": false,
@@ -1298,9 +3074,277 @@
1298
3074
  }
1299
3075
  }
1300
3076
  },
3077
+ "examples": {
3078
+ "GetPromotion": {
3079
+ "value": {
3080
+ "archived": false,
3081
+ "assignmentInformation": {
3082
+ "active": true,
3083
+ "activeCampaignAssignments": [
3084
+ {
3085
+ "campaignId": "coupon-campaign",
3086
+ "coupons": [
3087
+ "shipping-promotion-coupon"
3088
+ ],
3089
+ "description": "Coupon Shipping Promotion",
3090
+ "enabled": true,
3091
+ "promotionId": "my-shipping-promotion",
3092
+ "schedule": {}
3093
+ }
3094
+ ],
3095
+ "campaignId": "coupon-campaign",
3096
+ "enabled": true,
3097
+ "schedule": {},
3098
+ "scheduleType": "none"
3099
+ },
3100
+ "creationDate": "2020-01-09T16:50:32.000Z",
3101
+ "disableGloballyExcluded": false,
3102
+ "enabled": true,
3103
+ "exclusivity": "no",
3104
+ "id": "my-shipping-promotion",
3105
+ "lastModified": "2020-01-09T16:50:32.000Z",
3106
+ "name": {
3107
+ "default": "Coupon Shipping Promotion"
3108
+ },
3109
+ "promotionClass": "shipping",
3110
+ "c_customString": "Custom Value"
3111
+ }
3112
+ },
3113
+ "PromotionNotFound404": {
3114
+ "value": {
3115
+ "title": "Promotion Not Found",
3116
+ "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/promotion-not-found",
3117
+ "detail": "No promotion with ID 'not-existing-promotion' in site 'SiteGenesis' could be found.",
3118
+ "promotionId": "not-existing-promotion",
3119
+ "siteId": "SiteGenesis"
3120
+ }
3121
+ },
3122
+ "PutPromotion": {
3123
+ "value": {
3124
+ "enabled": true,
3125
+ "name": {
3126
+ "default": "__PROMOTION_ID__"
3127
+ },
3128
+ "exclusivity": "class",
3129
+ "promotionClass": "order",
3130
+ "c_customString": "Custom Value"
3131
+ }
3132
+ },
3133
+ "examples-PutPromotion": {
3134
+ "value": {
3135
+ "archived": false,
3136
+ "assignmentInformation": {
3137
+ "active": false,
3138
+ "activeCampaignAssignments": [],
3139
+ "campaignId": "coupon-campaign",
3140
+ "enabled": true,
3141
+ "schedule": {},
3142
+ "scheduleType": "none"
3143
+ },
3144
+ "creationDate": "2020-01-13T20:22:09.189Z",
3145
+ "disableGloballyExcluded": false,
3146
+ "enabled": true,
3147
+ "exclusivity": "class",
3148
+ "id": "my-promotion",
3149
+ "lastModified": "2020-01-13T20:22:09.199Z",
3150
+ "name": {
3151
+ "default": "__PROMOTION_ID__"
3152
+ },
3153
+ "promotionClass": "order",
3154
+ "c_customString": "Custom Value"
3155
+ }
3156
+ },
3157
+ "IdConflict400": {
3158
+ "value": {
3159
+ "title": "Id Conflict",
3160
+ "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/id-conflict",
3161
+ "detail": "The ID in the request body ('his-promotion') doesn't match the ID in the URL ('my-promotion').",
3162
+ "bodyID": "his-promotion",
3163
+ "urlID": "my-promotion"
3164
+ }
3165
+ },
3166
+ "PatchPromotion": {
3167
+ "value": {
3168
+ "enabled": false,
3169
+ "name": {
3170
+ "default": "__PROMOTION_ID__"
3171
+ },
3172
+ "exclusivity": "class",
3173
+ "promotionClass": "order",
3174
+ "c_customString": "Custom Value"
3175
+ }
3176
+ },
3177
+ "examples-PatchPromotion": {
3178
+ "value": {
3179
+ "archived": false,
3180
+ "assignmentInformation": {
3181
+ "active": false,
3182
+ "activeCampaignAssignments": [],
3183
+ "campaignId": "coupon-campaign",
3184
+ "enabled": false,
3185
+ "schedule": {},
3186
+ "scheduleType": "none"
3187
+ },
3188
+ "creationDate": "2020-01-13T20:22:09.189Z",
3189
+ "disableGloballyExcluded": false,
3190
+ "enabled": false,
3191
+ "exclusivity": "class",
3192
+ "id": "my-promotion",
3193
+ "lastModified": "2020-01-13T20:31:25.795Z",
3194
+ "name": {
3195
+ "default": "__PROMOTION_ID__"
3196
+ },
3197
+ "promotionClass": "order",
3198
+ "c_customString": "Custom Value"
3199
+ }
3200
+ },
3201
+ "GetPromotionDiscountRule": {
3202
+ "value": {
3203
+ "promotionRule": {
3204
+ "promotionClass": "order",
3205
+ "discount": {
3206
+ "type": "amount",
3207
+ "amount": {
3208
+ "currencyMnemonic": "USD",
3209
+ "value": 15
3210
+ }
3211
+ },
3212
+ "tiers": [
3213
+ {
3214
+ "threshold": 100,
3215
+ "conditionType": "order_total",
3216
+ "discount": {
3217
+ "type": "amount",
3218
+ "amount": {
3219
+ "currencyMnemonic": "USD",
3220
+ "value": 15
3221
+ }
3222
+ }
3223
+ }
3224
+ ],
3225
+ "discountOnlyQualifyingProducts": false,
3226
+ "disableGlobalExcludedProducts": false
3227
+ },
3228
+ "qualifyingProducts": {
3229
+ "includedProducts": [
3230
+ {
3231
+ "conditions": [
3232
+ {
3233
+ "type": "category",
3234
+ "operator": "is_equal",
3235
+ "catalogId": "storefront-catalog-m-en",
3236
+ "values": [
3237
+ "electronics"
3238
+ ]
3239
+ }
3240
+ ]
3241
+ }
3242
+ ]
3243
+ },
3244
+ "paymentMethodQualifiers": {
3245
+ "methodIds": [
3246
+ "CREDIT_CARD.Visa"
3247
+ ]
3248
+ }
3249
+ }
3250
+ },
3251
+ "PutPromotionDiscountRule": {
3252
+ "value": {
3253
+ "promotionRule": {
3254
+ "promotionClass": "order",
3255
+ "discount": {
3256
+ "type": "amount",
3257
+ "amount": {
3258
+ "currencyMnemonic": "USD",
3259
+ "value": 15
3260
+ }
3261
+ },
3262
+ "tiers": [
3263
+ {
3264
+ "threshold": 100,
3265
+ "conditionType": "order_total",
3266
+ "discount": {
3267
+ "type": "amount",
3268
+ "amount": {
3269
+ "currencyMnemonic": "USD",
3270
+ "value": 15
3271
+ }
3272
+ }
3273
+ }
3274
+ ]
3275
+ },
3276
+ "qualifyingProducts": {
3277
+ "includedProducts": [
3278
+ {
3279
+ "conditions": [
3280
+ {
3281
+ "type": "category",
3282
+ "operator": "is_equal",
3283
+ "catalogId": "storefront-catalog-m-en",
3284
+ "values": [
3285
+ "electronics"
3286
+ ]
3287
+ }
3288
+ ]
3289
+ }
3290
+ ]
3291
+ }
3292
+ }
3293
+ },
3294
+ "PatchPromotionDiscountRule": {
3295
+ "value": {
3296
+ "promotionRule": {
3297
+ "promotionClass": "order",
3298
+ "discount": {
3299
+ "type": "percentage",
3300
+ "percentage": 10
3301
+ },
3302
+ "discountOnlyQualifyingProducts": false,
3303
+ "disableGlobalExcludedProducts": false
3304
+ }
3305
+ }
3306
+ },
3307
+ "GetPromotionCompatibility": {
3308
+ "value": {
3309
+ "exclusivity": "class",
3310
+ "exclusivityGroup": "SummerSale",
3311
+ "combinablePromotions": [
3312
+ "10%offOrder"
3313
+ ],
3314
+ "mutuallyExclusivePromotions": [
3315
+ "20%offOrder"
3316
+ ]
3317
+ }
3318
+ },
3319
+ "PutPromotionCompatibility": {
3320
+ "value": {
3321
+ "exclusivity": "class",
3322
+ "exclusivityGroup": "SummerSale",
3323
+ "combinablePromotions": [
3324
+ "10%offOrder"
3325
+ ],
3326
+ "mutuallyExclusivePromotions": [
3327
+ "20%offOrder"
3328
+ ]
3329
+ }
3330
+ },
3331
+ "PatchPromotionCompatibility": {
3332
+ "value": {
3333
+ "exclusivity": "class",
3334
+ "exclusivityGroup": "SummerSale",
3335
+ "combinablePromotions": [
3336
+ "10%offOrder"
3337
+ ],
3338
+ "mutuallyExclusivePromotions": [
3339
+ "20%offOrder"
3340
+ ]
3341
+ }
3342
+ }
3343
+ },
1301
3344
  "securitySchemes": {
1302
3345
  "AmOAuth2": {
1303
3346
  "type": "oauth2",
3347
+ "description": "AccountManager OAuth 2.0 bearer token Authentication.",
1304
3348
  "flows": {
1305
3349
  "clientCredentials": {
1306
3350
  "tokenUrl": "https://account.demandware.com/dwsso/oauth2/access_token",
@@ -1312,10 +3356,8 @@
1312
3356
  "authorizationCode": {
1313
3357
  "authorizationUrl": "https://account.demandware.com/dwsso/oauth2/authorize",
1314
3358
  "tokenUrl": "https://account.demandware.com/dwsso/oauth2/access_token",
1315
- "scopes": {
1316
- "sfcc.promotions": "promotions READONLY",
1317
- "sfcc.promotions.rw": "promotions read/write"
1318
- }
3359
+ "refreshUrl": "https://account.demandware.com/dwsso/oauth2/access_token",
3360
+ "scopes": {}
1319
3361
  }
1320
3362
  }
1321
3363
  }