@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": "Assignments",
5
- "version": "1.0.38",
5
+ "description": "[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/assignments/assignments-oas-v1-public.yaml)\n\n# API Overview\n\nUse the Assignments API to search for promotions associated with campaigns.\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### Find All Associated Promotions\n\nUse the Assignments API to find all associated promotions for a given campaign.\n\n## Related APIs\n\n- [Campaigns](https://developer.salesforce.com/docs/commerce/commerce-api/references/campaigns?meta=Summary) — Manage campaigns that contain assignments.\n- [Promotions (Admin)](https://developer.salesforce.com/docs/commerce/commerce-api/references/promotions?meta=Summary) — Manage promotions referenced by assignments.",
6
+ "version": "1.0.39",
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/assignments/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}/assignments": {
21
23
  "post": {
24
+ "summary": "Search for promotion campaign assignments.",
25
+ "description": "The promotion campaign assignment search document contains a search object that allows filtering on various attributes.\n\nThe query attribute specifies a complex query that can be used to narrow down the search. Attributes are grouped into different buckets.\n\nThe following is a list of searchable attributes with their corresponding buckets:\n \n main:\n \n | Attribute | Type |\n |-----------|--------|\n | rank| Integer |\n | startDate | Date |\n | endDate | Date |\n \n campaign:\n \n | Attribute | Type |\n |-----------|--------|\n | campaign| String |\n \n promotion:\n \n | Attribute | Type |\n |-----------|--------|\n | promotionId| String |\n | description | String |\n | enabled | Boolean |\n \n special handling:\n \n | Attribute | Type |\n |-----------|--------|\n | couponId| String |\n\nOnly fields in the same bucket can be joined using a disjunction (or). For instance, when joining campaignId and rank, only a conjunction (and) is allowed, while promotionId and description can be joined using a disjunction because they are in the same bucket. Special handling fields must always use conjunctions. If the field is used in a disjunction that violates this rule, an exception is thrown.\n\n\nNote that only searchable attributes can be used in sorting.\n",
22
26
  "operationId": "assignmentsSearch",
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
  ],
@@ -78,17 +90,42 @@
78
90
  "schemas": {
79
91
  "OrganizationId": {
80
92
  "type": "string",
81
- "maxLength": 32,
82
- "minLength": 1
93
+ "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).",
94
+ "example": "f_ecom_zzxy_prd",
95
+ "pattern": "^f_ecom_[a-z]{4}_(prd|stg|dev|s[0-9]{2}|[0-9]{3})$"
83
96
  },
84
97
  "SiteId": {
85
98
  "type": "string",
99
+ "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",
100
+ "example": "RefArch",
86
101
  "maxLength": 32,
87
102
  "minLength": 1
88
103
  },
89
104
  "Query": {
90
105
  "type": "object",
91
106
  "additionalProperties": false,
107
+ "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._",
108
+ "example": {
109
+ "filteredQuery": {
110
+ "query": {
111
+ "textQuery": {
112
+ "fields": [
113
+ "couponId"
114
+ ],
115
+ "searchPhrase": "disabled"
116
+ }
117
+ },
118
+ "filter": {
119
+ "termFilter": {
120
+ "field": "enabled",
121
+ "operator": "is",
122
+ "values": [
123
+ false
124
+ ]
125
+ }
126
+ }
127
+ }
128
+ },
92
129
  "maxProperties": 1,
93
130
  "minProperties": 1,
94
131
  "properties": {
@@ -115,21 +152,58 @@
115
152
  "BoolQuery": {
116
153
  "type": "object",
117
154
  "additionalProperties": false,
155
+ "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",
156
+ "example": {
157
+ "must": [
158
+ {
159
+ "textQuery": {
160
+ "fields": [
161
+ "couponId"
162
+ ],
163
+ "searchPhrase": "DEAL"
164
+ }
165
+ },
166
+ {
167
+ "textQuery": {
168
+ "fields": [
169
+ "description"
170
+ ],
171
+ "searchPhrase": "Big bargain deal"
172
+ }
173
+ }
174
+ ],
175
+ "mustNot": [
176
+ {
177
+ "termQuery": {
178
+ "fields": [
179
+ "enabled"
180
+ ],
181
+ "operator": "is",
182
+ "values": [
183
+ false
184
+ ]
185
+ }
186
+ }
187
+ ]
188
+ },
118
189
  "properties": {
119
190
  "must": {
120
191
  "type": "array",
192
+ "description": "List of queries to be evaluated as an `AND` operator.",
121
193
  "items": {
122
194
  "$ref": "#/components/schemas/Query"
123
195
  }
124
196
  },
125
197
  "mustNot": {
126
198
  "type": "array",
199
+ "description": "List of queries to be evaluated as a `NOT` operator.",
127
200
  "items": {
128
201
  "$ref": "#/components/schemas/Query"
129
202
  }
130
203
  },
131
204
  "should": {
132
205
  "type": "array",
206
+ "description": "List of queries to be evaluated as an `OR` operator.",
133
207
  "items": {
134
208
  "$ref": "#/components/schemas/Query"
135
209
  }
@@ -139,6 +213,7 @@
139
213
  "Filter": {
140
214
  "type": "object",
141
215
  "additionalProperties": false,
216
+ "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.",
142
217
  "maxProperties": 1,
143
218
  "minProperties": 1,
144
219
  "properties": {
@@ -162,20 +237,47 @@
162
237
  "BoolFilter": {
163
238
  "type": "object",
164
239
  "additionalProperties": false,
240
+ "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.",
241
+ "example": {
242
+ "operator": "and",
243
+ "filters": [
244
+ {
245
+ "termFilter": {
246
+ "field": "id",
247
+ "operator": "is",
248
+ "values": [
249
+ "myId"
250
+ ]
251
+ }
252
+ },
253
+ {
254
+ "termFilter": {
255
+ "field": "couponId",
256
+ "operator": "is",
257
+ "values": [
258
+ "couponOne"
259
+ ]
260
+ }
261
+ }
262
+ ]
263
+ },
165
264
  "properties": {
166
265
  "filters": {
167
266
  "type": "array",
267
+ "description": "A list of filters that are logically combined by an operator.",
168
268
  "items": {
169
269
  "$ref": "#/components/schemas/Filter"
170
270
  }
171
271
  },
172
272
  "operator": {
173
273
  "type": "string",
274
+ "description": "The logical operator that is used to combine the filters.",
174
275
  "enum": [
175
276
  "and",
176
277
  "or",
177
278
  "not"
178
- ]
279
+ ],
280
+ "example": "and"
179
281
  }
180
282
  },
181
283
  "required": [
@@ -184,6 +286,7 @@
184
286
  },
185
287
  "QueryFilter": {
186
288
  "type": "object",
289
+ "description": "Wraps any query and allows it to be used as a filter.",
187
290
  "properties": {
188
291
  "query": {
189
292
  "$ref": "#/components/schemas/Query"
@@ -195,45 +298,71 @@
195
298
  },
196
299
  "Field": {
197
300
  "type": "string",
301
+ "description": "Name of the field. Might be a custom field name prefixed with c_.",
302
+ "example": "couponId",
198
303
  "maxLength": 260
199
304
  },
200
305
  "Range2Filter": {
201
306
  "type": "object",
202
307
  "additionalProperties": false,
308
+ "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.",
309
+ "example": {
310
+ "fromField": "validFrom",
311
+ "toField": "validTo",
312
+ "filterMode": "overlap",
313
+ "fromValue": "2007-01-01T00:00:00.000Z",
314
+ "toValue": "2017-01-01T00:00:00.000Z"
315
+ },
203
316
  "properties": {
204
317
  "filterMode": {
205
318
  "type": "string",
206
319
  "default": "overlap",
320
+ "description": "Compare mode: overlap, containing, or contained.",
207
321
  "enum": [
208
322
  "overlap",
209
323
  "containing",
210
324
  "contained"
211
- ]
325
+ ],
326
+ "example": "overlap"
212
327
  },
213
328
  "fromField": {
214
329
  "allOf": [
215
330
  {
216
331
  "$ref": "#/components/schemas/Field"
217
332
  }
218
- ]
333
+ ],
334
+ "description": "The field name of the field that starts the first range.",
335
+ "example": "validFrom"
219
336
  },
220
337
  "fromInclusive": {
221
338
  "type": "boolean",
222
- "default": true
339
+ "default": true,
340
+ "description": "A flag indicating if the lower bound of the second range is inclusive. To make the lower bound exclusive, set to `false`.",
341
+ "example": true
342
+ },
343
+ "fromValue": {
344
+ "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.",
345
+ "example": "2007-01-01T00:00:00.000Z"
223
346
  },
224
- "fromValue": {},
225
347
  "toField": {
226
348
  "allOf": [
227
349
  {
228
350
  "$ref": "#/components/schemas/Field"
229
351
  }
230
- ]
352
+ ],
353
+ "description": "The field name of the field that ends the first range.",
354
+ "example": "validTo"
231
355
  },
232
356
  "toInclusive": {
233
357
  "type": "boolean",
234
- "default": true
358
+ "default": true,
359
+ "description": "A flag indicating if the upper bound of the second range is inclusive. To make the lower bound exclusive, set to `false`.",
360
+ "example": true
235
361
  },
236
- "toValue": {}
362
+ "toValue": {
363
+ "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.",
364
+ "example": "2017-01-01T00:00:00.000Z"
365
+ }
237
366
  },
238
367
  "required": [
239
368
  "fromField",
@@ -242,49 +371,64 @@
242
371
  },
243
372
  "RangeFilter": {
244
373
  "type": "object",
374
+ "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.",
245
375
  "properties": {
246
376
  "field": {
247
377
  "allOf": [
248
378
  {
249
379
  "$ref": "#/components/schemas/Field"
250
380
  }
251
- ]
381
+ ],
382
+ "description": "The search field.",
383
+ "example": "validFrom"
252
384
  },
253
385
  "from": {
386
+ "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.",
254
387
  "oneOf": [
255
388
  {
256
389
  "type": "string",
257
- "format": "date-time"
390
+ "format": "date-time",
391
+ "example": "2007-01-01T00:00:00Z"
258
392
  },
259
393
  {
260
- "type": "integer"
394
+ "type": "integer",
395
+ "example": 1
261
396
  },
262
397
  {
263
- "type": "number"
398
+ "type": "number",
399
+ "example": 1
264
400
  }
265
401
  ]
266
402
  },
267
403
  "fromInclusive": {
268
404
  "type": "boolean",
269
- "default": true
405
+ "default": true,
406
+ "description": "A flag indicating if the lower bound of the range is inclusive. To make the lower bound exclusive, set to `false`.",
407
+ "example": true
270
408
  },
271
409
  "to": {
410
+ "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.",
272
411
  "oneOf": [
273
412
  {
274
413
  "type": "string",
275
- "format": "date-time"
414
+ "format": "date-time",
415
+ "example": "2007-01-02T00:00:00Z"
276
416
  },
277
417
  {
278
- "type": "integer"
418
+ "type": "integer",
419
+ "example": 2
279
420
  },
280
421
  {
281
- "type": "number"
422
+ "type": "number",
423
+ "example": 2
282
424
  }
283
425
  ]
284
426
  },
285
427
  "toInclusive": {
286
428
  "type": "boolean",
287
- "default": true
429
+ "default": true,
430
+ "description": "A flag indicating if the upper bound of the range is inclusive. To make the upper bound exclusive, set to `false`.",
431
+ "example": true
288
432
  }
289
433
  },
290
434
  "required": [
@@ -294,16 +438,26 @@
294
438
  "TermFilter": {
295
439
  "type": "object",
296
440
  "additionalProperties": false,
441
+ "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.",
442
+ "example": {
443
+ "field": "id",
444
+ "operator": "is",
445
+ "values": [
446
+ "myId"
447
+ ]
448
+ },
297
449
  "properties": {
298
450
  "field": {
299
451
  "allOf": [
300
452
  {
301
453
  "$ref": "#/components/schemas/Field"
302
454
  }
303
- ]
455
+ ],
456
+ "description": "The filter field."
304
457
  },
305
458
  "operator": {
306
459
  "type": "string",
460
+ "description": "The operator used to compare the field's values with the given values.",
307
461
  "enum": [
308
462
  "is",
309
463
  "one_of",
@@ -313,12 +467,15 @@
313
467
  "greater",
314
468
  "not_in",
315
469
  "neq"
316
- ]
470
+ ],
471
+ "example": "is"
317
472
  },
318
473
  "values": {
319
474
  "type": "array",
475
+ "description": "The filter values.",
320
476
  "items": {
321
- "type": "string"
477
+ "type": "string",
478
+ "example": "myId"
322
479
  }
323
480
  }
324
481
  },
@@ -330,6 +487,26 @@
330
487
  "FilteredQuery": {
331
488
  "type": "object",
332
489
  "additionalProperties": false,
490
+ "description": "Allows to filter the result of a possibly complex query using a possibly complex filter.",
491
+ "example": {
492
+ "query": {
493
+ "textQuery": {
494
+ "fields": [
495
+ "couponId"
496
+ ],
497
+ "searchPhrase": "disabled"
498
+ }
499
+ },
500
+ "filter": {
501
+ "termFilter": {
502
+ "field": "enabled",
503
+ "operator": "is",
504
+ "values": [
505
+ false
506
+ ]
507
+ }
508
+ }
509
+ },
333
510
  "properties": {
334
511
  "filter": {
335
512
  "$ref": "#/components/schemas/Filter"
@@ -344,14 +521,62 @@
344
521
  ]
345
522
  },
346
523
  "MatchAllQuery": {
347
- "type": "object"
524
+ "type": "object",
525
+ "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."
348
526
  },
349
527
  "NestedQuery": {
350
528
  "type": "object",
351
529
  "additionalProperties": false,
530
+ "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",
531
+ "example": {
532
+ "path": "order.shippingAddresses",
533
+ "query": {
534
+ "boolQuery": {
535
+ "must": [
536
+ {
537
+ "boolQuery": {
538
+ "must": [
539
+ {
540
+ "termQuery": {
541
+ "fields": [
542
+ "order.shippingAddresses.firstName"
543
+ ],
544
+ "operator": "is",
545
+ "values": [
546
+ "John"
547
+ ]
548
+ }
549
+ }
550
+ ]
551
+ }
552
+ },
553
+ {
554
+ "boolQuery": {
555
+ "must": [
556
+ {
557
+ "termQuery": {
558
+ "fields": [
559
+ "order.shippingAddresses.lastName"
560
+ ],
561
+ "operator": "is",
562
+ "values": [
563
+ "Doe"
564
+ ]
565
+ }
566
+ }
567
+ ]
568
+ }
569
+ }
570
+ ]
571
+ }
572
+ },
573
+ "scoreMode": "avg"
574
+ },
352
575
  "properties": {
353
576
  "path": {
354
577
  "type": "string",
578
+ "description": "The path to the nested document.",
579
+ "example": "order.shippingAddresses",
355
580
  "maxLength": 2048
356
581
  },
357
582
  "query": {
@@ -359,12 +584,14 @@
359
584
  },
360
585
  "scoreMode": {
361
586
  "type": "string",
587
+ "description": "Indicates how scores for matching child objects affect the root parent document’s relevance score.",
362
588
  "enum": [
363
589
  "avg",
364
590
  "total",
365
591
  "max",
366
592
  "none"
367
- ]
593
+ ],
594
+ "example": "avg"
368
595
  }
369
596
  },
370
597
  "required": [
@@ -374,9 +601,11 @@
374
601
  },
375
602
  "TermQuery": {
376
603
  "type": "object",
604
+ "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.",
377
605
  "properties": {
378
606
  "fields": {
379
607
  "type": "array",
608
+ "description": "The document fields that the values are matched against, combined with the operator.",
380
609
  "items": {
381
610
  "$ref": "#/components/schemas/Field"
382
611
  },
@@ -384,6 +613,7 @@
384
613
  },
385
614
  "operator": {
386
615
  "type": "string",
616
+ "description": "Returns the operator to use for the term query.",
387
617
  "enum": [
388
618
  "is",
389
619
  "one_of",
@@ -393,23 +623,30 @@
393
623
  "greater",
394
624
  "not_in",
395
625
  "neq"
396
- ]
626
+ ],
627
+ "example": "is"
397
628
  },
398
629
  "values": {
399
630
  "type": "array",
631
+ "description": "The values that the fields are compared against, combined with the operator.",
400
632
  "items": {
633
+ "example": "myCouponId",
401
634
  "oneOf": [
402
635
  {
403
- "type": "string"
636
+ "type": "string",
637
+ "example": "myCouponId"
404
638
  },
405
639
  {
406
- "type": "number"
640
+ "type": "number",
641
+ "example": 1
407
642
  },
408
643
  {
409
- "type": "boolean"
644
+ "type": "boolean",
645
+ "example": true
410
646
  },
411
647
  {
412
- "type": "integer"
648
+ "type": "integer",
649
+ "example": 1
413
650
  }
414
651
  ]
415
652
  }
@@ -423,16 +660,26 @@
423
660
  "TextQuery": {
424
661
  "type": "object",
425
662
  "additionalProperties": false,
663
+ "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.",
664
+ "example": {
665
+ "fields": [
666
+ "couponId"
667
+ ],
668
+ "searchPhrase": "limit"
669
+ },
426
670
  "properties": {
427
671
  "fields": {
428
672
  "type": "array",
673
+ "description": "The document fields that the search phrase matches against.",
429
674
  "items": {
430
675
  "$ref": "#/components/schemas/Field"
431
676
  },
432
677
  "minItems": 1
433
678
  },
434
679
  "searchPhrase": {
435
- "type": "string"
680
+ "type": "string",
681
+ "description": "A search phrase, which can include multiple terms separated by spaces.",
682
+ "example": "campaign summer"
436
683
  }
437
684
  },
438
685
  "required": [
@@ -440,28 +687,30 @@
440
687
  "searchPhrase"
441
688
  ]
442
689
  },
443
- "String256": {
444
- "type": "string",
445
- "maxLength": 256
446
- },
447
690
  "Sort": {
448
691
  "type": "object",
449
692
  "additionalProperties": false,
693
+ "description": "Document representing a sort request. Each API has a different default sort configuration that can be modified in the request.",
694
+ "example": {
695
+ "field": "couponId",
696
+ "sortOrder": "desc"
697
+ },
450
698
  "properties": {
451
699
  "field": {
452
- "allOf": [
453
- {
454
- "$ref": "#/components/schemas/String256"
455
- }
456
- ]
700
+ "type": "string",
701
+ "description": "The name of the field to sort on.",
702
+ "example": "couponId",
703
+ "maxLength": 256
457
704
  },
458
705
  "sortOrder": {
459
706
  "type": "string",
460
707
  "default": "asc",
708
+ "description": "The sort order to be applied when sorting. When omitted, the default sort order (asc) is used.",
461
709
  "enum": [
462
710
  "asc",
463
711
  "desc"
464
- ]
712
+ ],
713
+ "example": "asc"
465
714
  }
466
715
  },
467
716
  "required": [
@@ -472,14 +721,19 @@
472
721
  "type": "integer",
473
722
  "format": "int32",
474
723
  "default": 0,
724
+ "description": "The zero-based index of the first hit/data to include in the result.",
725
+ "example": 0,
475
726
  "minimum": 0
476
727
  },
477
728
  "SearchRequest": {
478
729
  "type": "object",
730
+ "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.",
479
731
  "properties": {
480
732
  "limit": {
481
733
  "type": "integer",
482
734
  "format": "int32",
735
+ "description": "Maximum records to retrieve per request, not to exceed 200.",
736
+ "example": 10,
483
737
  "maximum": 200,
484
738
  "minimum": 1
485
739
  },
@@ -488,6 +742,7 @@
488
742
  },
489
743
  "sorts": {
490
744
  "type": "array",
745
+ "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.",
491
746
  "items": {
492
747
  "$ref": "#/components/schemas/Sort"
493
748
  }
@@ -504,14 +759,19 @@
504
759
  "type": "integer",
505
760
  "format": "int32",
506
761
  "default": 0,
762
+ "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.",
763
+ "example": 10,
507
764
  "minimum": 0
508
765
  },
509
766
  "ResultBase": {
510
767
  "type": "object",
768
+ "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.",
511
769
  "properties": {
512
770
  "limit": {
513
771
  "type": "integer",
514
- "format": "int32"
772
+ "format": "int32",
773
+ "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.",
774
+ "example": 10
515
775
  },
516
776
  "total": {
517
777
  "$ref": "#/components/schemas/Total"
@@ -528,6 +788,7 @@
528
788
  "$ref": "#/components/schemas/ResultBase"
529
789
  }
530
790
  ],
791
+ "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`.",
531
792
  "properties": {
532
793
  "offset": {
533
794
  "$ref": "#/components/schemas/Offset"
@@ -546,18 +807,67 @@
546
807
  "$ref": "#/components/schemas/PaginatedResultBase"
547
808
  }
548
809
  ],
810
+ "description": "Document representing a generic search result. Each search resource should extend this to define what is returned in the `hits`.",
811
+ "example": {
812
+ "limit": 1,
813
+ "hits": [
814
+ {
815
+ "couponId": "coupon1",
816
+ "creationDate": "2019-10-20T12:00:00Z",
817
+ "description": "This coupon is used to give 10% off stuff.",
818
+ "enabled": false,
819
+ "exportedCodeCount": 0,
820
+ "lastModified": "2019-10-30T04:23:59Z",
821
+ "redemptionCount": 3,
822
+ "redemptionLimits": {
823
+ "limitPerCode": 1,
824
+ "limitPerCustomer": 1,
825
+ "limitPerTimeFrame": {
826
+ "limit": 2,
827
+ "redemptionTimeFrame": 24
828
+ }
829
+ },
830
+ "singleCode": "MyCode",
831
+ "systemCodesConfig": {
832
+ "codePrefix": "SG",
833
+ "numberOfCodes": 500000
834
+ },
835
+ "totalCodesCount": 50,
836
+ "type": "single_code"
837
+ }
838
+ ],
839
+ "query": {
840
+ "textQuery": {
841
+ "fields": [
842
+ "id",
843
+ "description"
844
+ ],
845
+ "searchPhrase": "stuff"
846
+ }
847
+ },
848
+ "sorts": [
849
+ {
850
+ "field": "couponId",
851
+ "sortOrder": "desc"
852
+ }
853
+ ],
854
+ "offset": 2,
855
+ "total": 8
856
+ },
549
857
  "properties": {
550
858
  "query": {
551
859
  "$ref": "#/components/schemas/Query"
552
860
  },
553
861
  "sorts": {
554
862
  "type": "array",
863
+ "description": "The sorting that was applied to the result.",
555
864
  "items": {
556
865
  "$ref": "#/components/schemas/Sort"
557
866
  }
558
867
  },
559
868
  "hits": {
560
869
  "type": "array",
870
+ "description": "The sorted array of search hits. Can be empty.",
561
871
  "items": {
562
872
  "type": "object"
563
873
  }
@@ -569,56 +879,88 @@
569
879
  },
570
880
  "CampaignId": {
571
881
  "type": "string",
882
+ "description": "The ID of the campaign.",
883
+ "example": "NewYearCampaign",
572
884
  "maxLength": 256,
573
885
  "minLength": 1
574
886
  },
575
887
  "Campaign": {
576
888
  "type": "object",
577
- "additionalProperties": {},
889
+ "additionalProperties": {
890
+ "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.",
891
+ "example": "c_trackingId",
892
+ "title": "Additional Property Support"
893
+ },
894
+ "description": "Document representing a campaign.",
578
895
  "properties": {
579
896
  "campaignId": {
580
897
  "$ref": "#/components/schemas/CampaignId"
581
898
  },
582
899
  "coupons": {
583
900
  "type": "array",
901
+ "description": "The array of assigned coupon IDs, not sorted.",
902
+ "example": [
903
+ "20%offOrder",
904
+ "10%offWelcomeNewUser"
905
+ ],
584
906
  "items": {
585
907
  "type": "string"
586
908
  }
587
909
  },
588
910
  "creationDate": {
589
911
  "type": "string",
590
- "format": "date-time"
912
+ "format": "date-time",
913
+ "description": "Returns the value of attribute 'creationDate'.",
914
+ "example": "2019-10-03T19:36:56Z"
591
915
  },
592
916
  "customerGroups": {
593
917
  "type": "array",
918
+ "description": "The array of assigned customer groups, not sorted.",
919
+ "example": [
920
+ "BigShoppers",
921
+ "NorthAmericanShoppers"
922
+ ],
594
923
  "items": {
595
924
  "type": "string"
596
925
  }
597
926
  },
598
927
  "description": {
599
928
  "type": "string",
929
+ "description": "The description of the campaign.",
600
930
  "maxLength": 4000
601
931
  },
602
932
  "enabled": {
603
- "type": "boolean"
933
+ "type": "boolean",
934
+ "description": "The enabled flag for campaign.",
935
+ "example": true
604
936
  },
605
937
  "endDate": {
606
938
  "type": "string",
607
- "format": "date-time"
939
+ "format": "date-time",
940
+ "description": "The date the scenario ends."
608
941
  },
609
942
  "lastModified": {
610
943
  "type": "string",
611
- "format": "date-time"
944
+ "format": "date-time",
945
+ "description": "Returns the value of attribute 'lastModified'.",
946
+ "example": "2019-10-03T19:36:56Z"
612
947
  },
613
948
  "sourceCodeGroups": {
614
949
  "type": "array",
950
+ "description": "The array of assigned source code groups, not sorted.",
951
+ "example": [
952
+ "affiliate-email",
953
+ "gaming-email"
954
+ ],
615
955
  "items": {
616
956
  "type": "string"
617
957
  }
618
958
  },
619
959
  "startDate": {
620
960
  "type": "string",
621
- "format": "date-time"
961
+ "format": "date-time",
962
+ "description": "The date the scenario begins.",
963
+ "example": "2019-10-03T19:36:56Z"
622
964
  }
623
965
  },
624
966
  "required": [
@@ -628,25 +970,30 @@
628
970
  "TimeOfDay": {
629
971
  "type": "object",
630
972
  "additionalProperties": false,
973
+ "description": "Document representing a time schedule within a single day.",
631
974
  "properties": {
632
975
  "timeFrom": {
633
- "type": "string"
976
+ "type": "string",
977
+ "description": "The time to start from. Time format: HH:mm or HH:mm:ss. Seconds are ignored and set to 0.",
978
+ "example": "09:00:00",
979
+ "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$"
634
980
  },
635
981
  "timeTo": {
636
- "type": "string"
982
+ "type": "string",
983
+ "description": "The time to end on. Time format: HH:mm or HH:mm:ss. Seconds are ignored and set to 0.",
984
+ "example": "17:00:00",
985
+ "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$"
637
986
  }
638
- },
639
- "required": [
640
- "timeFrom",
641
- "timeTo"
642
- ]
987
+ }
643
988
  },
644
989
  "Recurrence": {
645
990
  "type": "object",
646
991
  "additionalProperties": false,
992
+ "description": "Document representing a schedule recurrence.",
647
993
  "properties": {
648
994
  "dayOfWeek": {
649
995
  "type": "array",
996
+ "description": "The days of week for recurrence.",
650
997
  "items": {
651
998
  "type": "string",
652
999
  "enum": [
@@ -657,7 +1004,8 @@
657
1004
  "friday",
658
1005
  "saturday",
659
1006
  "sunday"
660
- ]
1007
+ ],
1008
+ "example": "monday"
661
1009
  }
662
1010
  },
663
1011
  "timeOfDay": {
@@ -665,39 +1013,37 @@
665
1013
  {
666
1014
  "$ref": "#/components/schemas/TimeOfDay"
667
1015
  }
668
- ]
1016
+ ],
1017
+ "description": "The time of the day for recurrence."
669
1018
  }
670
- },
671
- "required": [
672
- "dayOfWeek",
673
- "timeOfDay"
674
- ]
1019
+ }
675
1020
  },
676
1021
  "Schedule": {
677
1022
  "type": "object",
678
1023
  "additionalProperties": false,
1024
+ "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).",
679
1025
  "properties": {
1026
+ "startDate": {
1027
+ "type": "string",
1028
+ "format": "date-time",
1029
+ "description": "The date to start validity. ISO8601 date time format: yyyy-MM-dd'T'HH:mm:ssZ.",
1030
+ "example": "2026-01-01T00:00:00Z"
1031
+ },
680
1032
  "endDate": {
681
1033
  "type": "string",
682
- "format": "date-time"
1034
+ "format": "date-time",
1035
+ "description": "The date to end of validity. ISO8601 date time format: yyyy-MM-dd'T'HH:mm:ssZ.",
1036
+ "example": "2026-01-31T23:59:59Z"
683
1037
  },
684
1038
  "recurrence": {
685
1039
  "allOf": [
686
1040
  {
687
1041
  "$ref": "#/components/schemas/Recurrence"
688
1042
  }
689
- ]
690
- },
691
- "startDate": {
692
- "type": "string",
693
- "format": "date-time"
1043
+ ],
1044
+ "description": "The recurrence of the schedule by day of week and time of day. Not all schedules support a recurrence."
694
1045
  }
695
- },
696
- "required": [
697
- "endDate",
698
- "recurrence",
699
- "startDate"
700
- ]
1046
+ }
701
1047
  },
702
1048
  "PromotionAbtestGroupAssignment": {
703
1049
  "type": "object",
@@ -734,63 +1080,75 @@
734
1080
  "PromotionCampaignAssignment": {
735
1081
  "type": "object",
736
1082
  "additionalProperties": false,
1083
+ "description": "Document representing a promotion campaign assignment.",
737
1084
  "properties": {
738
1085
  "campaign": {
739
1086
  "allOf": [
740
1087
  {
741
1088
  "$ref": "#/components/schemas/Campaign"
742
1089
  }
743
- ]
1090
+ ],
1091
+ "description": "The campaign."
744
1092
  },
745
1093
  "campaignId": {
746
1094
  "type": "string",
1095
+ "description": "The ID of the campaign.",
747
1096
  "maxLength": 256,
748
1097
  "minLength": 1
749
1098
  },
750
1099
  "coupons": {
751
1100
  "type": "array",
1101
+ "description": "The sorted array of assigned coupon IDs.",
752
1102
  "items": {
753
1103
  "type": "string"
754
1104
  }
755
1105
  },
756
1106
  "customerGroups": {
757
1107
  "type": "array",
1108
+ "description": "The sorted array of assigned customer groups.",
758
1109
  "items": {
759
1110
  "type": "string"
760
1111
  }
761
1112
  },
762
1113
  "description": {
763
1114
  "type": "string",
1115
+ "description": "The description of the promotion campaign assignment.",
764
1116
  "maxLength": 4000
765
1117
  },
766
1118
  "enabled": {
767
- "type": "boolean"
1119
+ "type": "boolean",
1120
+ "description": "True if the assignment resource is enabled."
768
1121
  },
769
1122
  "promotion": {
770
1123
  "allOf": [
771
1124
  {
772
1125
  "$ref": "#/components/schemas/Promotion"
773
1126
  }
774
- ]
1127
+ ],
1128
+ "description": "The promotion."
775
1129
  },
776
1130
  "promotionId": {
777
1131
  "type": "string",
1132
+ "description": "The ID of the promotion.",
778
1133
  "maxLength": 256,
779
1134
  "minLength": 1
780
1135
  },
781
1136
  "rank": {
782
1137
  "type": "integer",
783
- "format": "int32"
1138
+ "format": "int32",
1139
+ "description": "The rank of promotion campaign assignment."
784
1140
  },
785
1141
  "schedule": {
786
1142
  "allOf": [
787
1143
  {
788
1144
  "$ref": "#/components/schemas/Schedule"
789
1145
  }
790
- ]
1146
+ ],
1147
+ "description": "The schedule of the assignment resource."
791
1148
  },
792
1149
  "sourceCodeGroups": {
793
1150
  "type": "array",
1151
+ "description": "The sorted array of assigned source code groups.",
794
1152
  "items": {
795
1153
  "$ref": "#/components/schemas/SourceCodeGroupId"
796
1154
  }
@@ -815,45 +1173,54 @@
815
1173
  "additionalProperties": false,
816
1174
  "properties": {
817
1175
  "abtestId": {
818
- "type": "string"
1176
+ "type": "string",
1177
+ "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."
819
1178
  },
820
1179
  "abtestSegmentId": {
821
- "type": "string"
1180
+ "type": "string",
1181
+ "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."
822
1182
  },
823
1183
  "active": {
824
- "type": "boolean"
1184
+ "type": "boolean",
1185
+ "description": "True if the individual assignment or the multiple assignments are currently active."
825
1186
  },
826
1187
  "activeAbtestAssignments": {
827
1188
  "type": "array",
1189
+ "description": "A list of currently active A/B tests this is assigned to.",
828
1190
  "items": {
829
1191
  "$ref": "#/components/schemas/PromotionAbtestGroupAssignment"
830
1192
  }
831
1193
  },
832
1194
  "activeCampaignAssignments": {
833
1195
  "type": "array",
1196
+ "description": "A list of currently active campaigns this is assigned to.",
834
1197
  "items": {
835
1198
  "$ref": "#/components/schemas/PromotionCampaignAssignment"
836
1199
  }
837
1200
  },
838
1201
  "campaignId": {
839
- "type": "string"
1202
+ "type": "string",
1203
+ "description": "If there is only one assignment, and that assignment is a campaign, the ID of the campaign. Otherwise, empty."
840
1204
  },
841
1205
  "enabled": {
842
1206
  "type": "boolean"
843
1207
  },
844
1208
  "endDate": {
845
1209
  "type": "string",
846
- "format": "date-time"
1210
+ "format": "date-time",
1211
+ "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."
847
1212
  },
848
1213
  "schedule": {
849
1214
  "allOf": [
850
1215
  {
851
1216
  "$ref": "#/components/schemas/Schedule"
852
1217
  }
853
- ]
1218
+ ],
1219
+ "description": "The schedule of the assignment (a Campaign or ABTest). If scheduleType is\n scheduleType : \"multiple\" or scheduleType : \"none\", then then result is null."
854
1220
  },
855
1221
  "scheduleType": {
856
1222
  "type": "string",
1223
+ "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\".",
857
1224
  "enum": [
858
1225
  "none",
859
1226
  "campaign",
@@ -863,16 +1230,19 @@
863
1230
  },
864
1231
  "startDate": {
865
1232
  "type": "string",
866
- "format": "date-time"
1233
+ "format": "date-time",
1234
+ "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."
867
1235
  },
868
1236
  "upcomingAbtestAssignments": {
869
1237
  "type": "array",
1238
+ "description": "A list of upcoming A/B tests this is assigned to.",
870
1239
  "items": {
871
1240
  "$ref": "#/components/schemas/PromotionAbtestGroupAssignment"
872
1241
  }
873
1242
  },
874
1243
  "upcomingCampaignAssignments": {
875
1244
  "type": "array",
1245
+ "description": "A list of upcoming campaigns this is assigned to.",
876
1246
  "items": {
877
1247
  "$ref": "#/components/schemas/PromotionCampaignAssignment"
878
1248
  }
@@ -897,9 +1267,11 @@
897
1267
  "Tag": {
898
1268
  "type": "object",
899
1269
  "additionalProperties": false,
1270
+ "description": "Document representing a tag",
900
1271
  "properties": {
901
1272
  "tagId": {
902
- "type": "string"
1273
+ "type": "string",
1274
+ "description": "The ID of the tag."
903
1275
  }
904
1276
  },
905
1277
  "required": [
@@ -908,34 +1280,46 @@
908
1280
  },
909
1281
  "Promotion": {
910
1282
  "type": "object",
911
- "additionalProperties": {},
1283
+ "additionalProperties": {
1284
+ "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.",
1285
+ "example": "c_trackingId",
1286
+ "title": "Additional Property Support"
1287
+ },
1288
+ "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.",
912
1289
  "properties": {
913
1290
  "archived": {
914
- "type": "boolean"
1291
+ "type": "boolean",
1292
+ "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."
915
1293
  },
916
1294
  "assignmentInformation": {
917
1295
  "allOf": [
918
1296
  {
919
1297
  "$ref": "#/components/schemas/PromotionAssignmentInformation"
920
1298
  }
921
- ]
1299
+ ],
1300
+ "description": "Information about the assignments and assignment schedules of this promotion."
922
1301
  },
923
1302
  "creationDate": {
924
1303
  "type": "string",
925
- "format": "date-time"
1304
+ "format": "date-time",
1305
+ "description": "Returns the value of attribute 'creationDate'."
926
1306
  },
927
1307
  "currencyCode": {
928
1308
  "type": "string",
1309
+ "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.",
929
1310
  "maxLength": 3
930
1311
  },
931
1312
  "disableGloballyExcluded": {
932
- "type": "boolean"
1313
+ "type": "boolean",
1314
+ "description": "Determines if this promotion ignores the global product exclusions for promotions."
933
1315
  },
934
1316
  "enabled": {
935
- "type": "boolean"
1317
+ "type": "boolean",
1318
+ "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."
936
1319
  },
937
1320
  "exclusivity": {
938
1321
  "type": "string",
1322
+ "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.",
939
1323
  "enum": [
940
1324
  "no",
941
1325
  "class",
@@ -943,20 +1327,24 @@
943
1327
  ]
944
1328
  },
945
1329
  "id": {
946
- "type": "string"
1330
+ "type": "string",
1331
+ "description": "The ID for the promotion."
947
1332
  },
948
1333
  "lastModified": {
949
1334
  "type": "string",
950
- "format": "date-time"
1335
+ "format": "date-time",
1336
+ "description": "Returns the value of attribute 'lastModified'."
951
1337
  },
952
1338
  "name": {
953
1339
  "type": "object",
954
1340
  "additionalProperties": {
955
1341
  "type": "string"
956
- }
1342
+ },
1343
+ "description": "The user supplied name of this promotion, which can be localized."
957
1344
  },
958
1345
  "promotionClass": {
959
1346
  "type": "string",
1347
+ "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.",
960
1348
  "enum": [
961
1349
  "product",
962
1350
  "shipping",
@@ -965,6 +1353,7 @@
965
1353
  },
966
1354
  "tags": {
967
1355
  "type": "array",
1356
+ "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.",
968
1357
  "items": {
969
1358
  "$ref": "#/components/schemas/Tag"
970
1359
  }
@@ -977,6 +1366,8 @@
977
1366
  },
978
1367
  "SourceCodeGroupId": {
979
1368
  "type": "string",
1369
+ "description": "The ID of source code group.",
1370
+ "example": "TV-Email",
980
1371
  "maxLength": 28,
981
1372
  "minLength": 1
982
1373
  },
@@ -986,9 +1377,11 @@
986
1377
  "$ref": "#/components/schemas/PaginatedSearchResult"
987
1378
  }
988
1379
  ],
1380
+ "description": "Document representing a promotion campaign assignment search result.",
989
1381
  "properties": {
990
1382
  "hits": {
991
1383
  "type": "array",
1384
+ "description": "The sorted array of campaign search hits. Can be empty.",
992
1385
  "items": {
993
1386
  "$ref": "#/components/schemas/PromotionCampaignAssignment"
994
1387
  }
@@ -1003,27 +1396,36 @@
1003
1396
  "organizationId": {
1004
1397
  "name": "organizationId",
1005
1398
  "in": "path",
1399
+ "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).",
1006
1400
  "required": true,
1007
1401
  "style": "simple",
1008
1402
  "explode": false,
1009
1403
  "schema": {
1010
1404
  "$ref": "#/components/schemas/OrganizationId"
1011
- }
1405
+ },
1406
+ "example": "f_ecom_zzxy_prd"
1012
1407
  },
1013
1408
  "siteId": {
1014
1409
  "name": "siteId",
1015
1410
  "in": "query",
1411
+ "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.",
1016
1412
  "required": true,
1017
1413
  "style": "form",
1018
1414
  "explode": true,
1019
1415
  "schema": {
1020
1416
  "$ref": "#/components/schemas/SiteId"
1417
+ },
1418
+ "examples": {
1419
+ "SiteId": {
1420
+ "value": "RefArch"
1421
+ }
1021
1422
  }
1022
1423
  }
1023
1424
  },
1024
1425
  "securitySchemes": {
1025
1426
  "AmOAuth2": {
1026
1427
  "type": "oauth2",
1428
+ "description": "AccountManager OAuth 2.0 bearer token Authentication.",
1027
1429
  "flows": {
1028
1430
  "clientCredentials": {
1029
1431
  "tokenUrl": "https://account.demandware.com/dwsso/oauth2/access_token",
@@ -1035,10 +1437,8 @@
1035
1437
  "authorizationCode": {
1036
1438
  "authorizationUrl": "https://account.demandware.com/dwsso/oauth2/authorize",
1037
1439
  "tokenUrl": "https://account.demandware.com/dwsso/oauth2/access_token",
1038
- "scopes": {
1039
- "sfcc.promotions": "promotions READONLY",
1040
- "sfcc.promotions.rw": "promotions read/write"
1041
- }
1440
+ "refreshUrl": "https://account.demandware.com/dwsso/oauth2/access_token",
1441
+ "scopes": {}
1042
1442
  }
1043
1443
  }
1044
1444
  }