@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": "Shopper Context",
5
- "version": "1.1.3",
5
+ "description": "[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-context/shopper-context-oas-v1-public.yaml)\n\n# API Overview\n\nWith the Shopper Context API, you can set any context information as a key/value pair and use it to retrieve personalized promotions, payment methods, and shipping methods. The context information that is set is evaluated against the customer group definitions to determine a customer group (shopper segment), and is then used to activate the experiences that are associated with a particular segment, such as promotions.\n\nYou can also get personalized API responses triggered by shopper context from the [Open Commerce API](https://developer.salesforce.com/docs/commerce/b2c-commerce/references/b2c-commerce-ocapi/get-started-with-ocapi.html) (OCAPI). Support for both the B2C Commerce API and OCAPI allows shopper context to be used in hybrid deployments.\n\n**Warning** \nAccess tokens with a scope that includes the Shopper Context API are powerful. They can activate specific promotions and can be used to see how a storefront would be displayed in the future. Don't share them with untrusted clients like web browsers or client apps.\n\nMake Shopper Context calls with a private client and only set shopper context through a secure backend channel. To avoid misuse, do not make direct calls through a browser or similar client in which data can be viewed. \n\nAs part of this, when creating a SLAS public client for a tenant, if you attempt to add the Shopper Context API scope, a warning message is displayed to ensure you are aware of the pitfalls of doing so.\n\n**Note**:\n\nShopper context is valid for 1 day for guest shoppers and 7 days for registered shoppers. To extend the context set, create a new context. As a best practice, refresh your contexts periodically to ensure that the right personalized experience is rendered for your shoppers.\n\n## Authentication & Authorization\n\nThe Shopper Context API requires a shopper access token from the Shopper Login and API Access Service (SLAS).\n\nYou must include `sfcc.shopper-context.rw` in the client ID used to generate the SLAS token. For a full list of permissions, see the [Authorization Scopes Catalog.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/auth-z-scope-catalog.html) \n\nFor details on how to request a shopper access token from SLAS, see the guest user flows for [public clients](https://developer.salesforce.com/docs/commerce/commerce-api/guide/slas-public-client.html) and [private clients](https://developer.salesforce.com/docs/commerce/commerce-api/guide/slas-private-client.html) in the SLAS guides.\n\nFor more information, see [Authorization for Shopper APIs](https://developer.salesforce.com/docs/commerce/commerce-api/guide/authorization-for-shopper-apis.html) in the Get Started guides. \n\n**Warning**: As with all APIs, never store access tokens in the browser because this creates a security vulnerability.\n\n## Customization\n\n### Hooks\n\nFor details on working with hooks, see [Extensibility with Hooks.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/extensibility_via_hooks.html)\n\n## Response Details\n\n### Personalization\n\nResponses from this API are not personalized via the Shopper Context API.\n\n### Caching\n\nResponses from this API are not cached. Shopper context is per-shopper state that changes with each context update.\n\n### Timeouts\n\nShopper API requests must respond within 10 seconds, including any hook execution. 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### Set Shopper Context\n\nSet context attributes for a shopper to personalize subsequent API responses.\n\n```sh\ncurl \"https://{shortCode}.api.commercecloud.salesforce.com/shopper/shopper-context/v1/organizations/{organizationId}/shopper-context/{usid}?siteId=RefArch\" \\\n -X PUT \\\n -H \"Authorization: Bearer {access_token}\" \\\n -H \"Content-Type: application/json\" \\\n -d '{ \"customQualifiers\": { \"deviceType\": \"mobile\" }, \"assignmentQualifiers\": { \"storeId\": \"boston\" } }'\n```\n\n\nFor detailed usage information, see the [Shopper Context guides](https://developer.salesforce.com/docs/commerce/commerce-api/guide/shopper-context-api.html).",
6
+ "version": "1.1.4",
6
7
  "x-api-type": "Shopper",
7
8
  "x-api-family": "Shopper"
8
9
  },
@@ -11,6 +12,7 @@
11
12
  "url": "https://{shortCode}.api.commercecloud.salesforce.com/shopper/shopper-context/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,11 +21,13 @@
19
21
  "paths": {
20
22
  "/organizations/{organizationId}/shopper-context/{usid}": {
21
23
  "get": {
24
+ "summary": "Get the shopper's context based on the shopperJWT.",
22
25
  "operationId": "getShopperContext",
23
26
  "parameters": [
24
27
  {
25
28
  "name": "usid",
26
29
  "in": "path",
30
+ "description": "The Shopper's unique identifier. It is a required parameter and is part of the response from the Guest or Registered User Shopper Login (SLAS) API call.",
27
31
  "required": true,
28
32
  "style": "simple",
29
33
  "explode": false,
@@ -34,21 +38,38 @@
34
38
  {
35
39
  "name": "organizationId",
36
40
  "in": "path",
41
+ "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).",
37
42
  "required": true,
38
43
  "style": "simple",
39
44
  "explode": false,
40
45
  "schema": {
41
46
  "$ref": "#/components/schemas/OrganizationId"
42
- }
47
+ },
48
+ "example": "f_ecom_zzxy_prd"
43
49
  },
44
50
  {
45
51
  "name": "siteId",
46
52
  "in": "query",
53
+ "description": "The site context.",
47
54
  "required": true,
48
55
  "style": "form",
49
56
  "explode": true,
50
57
  "schema": {
51
58
  "$ref": "#/components/schemas/SiteId"
59
+ },
60
+ "example": "RefArch"
61
+ },
62
+ {
63
+ "name": "sfdc_usid",
64
+ "in": "header",
65
+ "description": "A unique shopper identifier (USID) for tracking client context.\nUsed with endpoints secured with ShopperClientContextToken.\nThis header is required for all endpoints secured with ShopperClientContextToken.",
66
+ "required": false,
67
+ "style": "simple",
68
+ "explode": false,
69
+ "schema": {
70
+ "type": "string",
71
+ "format": "uuid",
72
+ "example": "550e8400-e29b-41d4-a716-446655440000"
52
73
  }
53
74
  }
54
75
  ],
@@ -57,11 +78,13 @@
57
78
  "description": "Shopper Context retrieved successfully.",
58
79
  "headers": {
59
80
  "X-Geolocation": {
81
+ "description": "The response header returns the geolocation based on the `clientIp` or `geoLocation` attribute set in the shopper context. If both are set, `geoLocation` takes precedence.",
60
82
  "required": false,
61
83
  "style": "simple",
62
84
  "explode": false,
63
85
  "schema": {
64
- "type": "string"
86
+ "type": "string",
87
+ "example": "CountryCode: US; Country: United States; MetroCode: 0; Latitude: 37.751; Longitude: -97.822"
65
88
  }
66
89
  }
67
90
  },
@@ -69,6 +92,11 @@
69
92
  "application/json": {
70
93
  "schema": {
71
94
  "$ref": "#/components/schemas/ShopperContext"
95
+ },
96
+ "examples": {
97
+ "ShopperContextExample": {
98
+ "$ref": "#/components/examples/ShopperContextExample"
99
+ }
72
100
  }
73
101
  }
74
102
  }
@@ -76,9 +104,14 @@
76
104
  "400": {
77
105
  "description": "The usid in the incoming request does not match the usid in the token.",
78
106
  "content": {
79
- "application/json": {
107
+ "application/problem+json": {
80
108
  "schema": {
81
109
  "$ref": "#/components/schemas/ErrorResponse"
110
+ },
111
+ "examples": {
112
+ "getShopperContext400": {
113
+ "$ref": "#/components/examples/BadRequestUSIDNotMatching"
114
+ }
82
115
  }
83
116
  }
84
117
  }
@@ -86,9 +119,14 @@
86
119
  "401": {
87
120
  "description": "Your shopper JWT is invalid and cannot be used to identify the API client.",
88
121
  "content": {
89
- "application/json": {
122
+ "application/problem+json": {
90
123
  "schema": {
91
124
  "$ref": "#/components/schemas/ErrorResponse"
125
+ },
126
+ "examples": {
127
+ "getShopperContext401": {
128
+ "$ref": "#/components/examples/Unauthorized"
129
+ }
92
130
  }
93
131
  }
94
132
  }
@@ -96,9 +134,14 @@
96
134
  "403": {
97
135
  "description": "Your shopper JWT is valid, but you do not have permission to access the resource.",
98
136
  "content": {
99
- "application/json": {
137
+ "application/problem+json": {
100
138
  "schema": {
101
139
  "$ref": "#/components/schemas/ErrorResponse"
140
+ },
141
+ "examples": {
142
+ "getShopperContext403": {
143
+ "$ref": "#/components/examples/Forbidden"
144
+ }
102
145
  }
103
146
  }
104
147
  }
@@ -106,9 +149,14 @@
106
149
  "404": {
107
150
  "description": "Shopper Context for ORGANIZATION_ID - f_ecom_bhbv_prd and USID - 7e1f65fb-185c-4788-8cec-05fef8dac77d not found in repository.",
108
151
  "content": {
109
- "application/json": {
152
+ "application/problem+json": {
110
153
  "schema": {
111
154
  "$ref": "#/components/schemas/ErrorResponse"
155
+ },
156
+ "examples": {
157
+ "getShopperContext404": {
158
+ "$ref": "#/components/examples/NotFound"
159
+ }
112
160
  }
113
161
  }
114
162
  }
@@ -120,15 +168,23 @@
120
168
  "sfcc.shopper-context",
121
169
  "sfcc.shopper-context.rw"
122
170
  ]
171
+ },
172
+ {
173
+ "ShopperClientContextToken": [
174
+ "sfcc.shopper-context",
175
+ "sfcc.shopper-context.rw"
176
+ ]
123
177
  }
124
178
  ]
125
179
  },
126
180
  "put": {
181
+ "summary": "Create the shopper's context based on the shopperJWT. If a shopper context already exists, the entire existing context is replaced.",
127
182
  "operationId": "createShopperContext",
128
183
  "parameters": [
129
184
  {
130
185
  "name": "usid",
131
186
  "in": "path",
187
+ "description": "The Shopper's unique identifier. It is a required parameter and is part of the response from the Guest or Registered User Shopper Login (SLAS) API call.",
132
188
  "required": true,
133
189
  "style": "simple",
134
190
  "explode": false,
@@ -139,32 +195,50 @@
139
195
  {
140
196
  "name": "organizationId",
141
197
  "in": "path",
198
+ "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).",
142
199
  "required": true,
143
200
  "style": "simple",
144
201
  "explode": false,
145
202
  "schema": {
146
203
  "$ref": "#/components/schemas/OrganizationId"
147
- }
204
+ },
205
+ "example": "f_ecom_zzxy_prd"
148
206
  },
149
207
  {
150
208
  "name": "siteId",
151
209
  "in": "query",
210
+ "description": "The site context.",
152
211
  "required": true,
153
212
  "style": "form",
154
213
  "explode": true,
155
214
  "schema": {
156
215
  "$ref": "#/components/schemas/SiteId"
157
- }
216
+ },
217
+ "example": "RefArch"
158
218
  },
159
219
  {
160
220
  "name": "evaluateContextWithClientIp",
161
221
  "in": "query",
222
+ "description": "Determines whether to evaluate the context using the provided `clientIp`. This property is available with B2C Commerce version 24.7.\n- If `evaluateContextWithClientIp` is set to `true`:\n - The `clientIP` is saved and used in subsequent requests.\n\n- If `evaluateContextWithClientIp` is set to `false`:\n - The `clientIP` is not saved and will not be used in subsequent requests.\n",
162
223
  "required": false,
163
224
  "style": "form",
164
225
  "explode": true,
165
226
  "schema": {
166
227
  "type": "boolean"
167
228
  }
229
+ },
230
+ {
231
+ "name": "sfdc_usid",
232
+ "in": "header",
233
+ "description": "A unique shopper identifier (USID) for tracking client context.\nUsed with endpoints secured with ShopperClientContextToken.\nThis header is required for all endpoints secured with ShopperClientContextToken.",
234
+ "required": false,
235
+ "style": "simple",
236
+ "explode": false,
237
+ "schema": {
238
+ "type": "string",
239
+ "format": "uuid",
240
+ "example": "550e8400-e29b-41d4-a716-446655440000"
241
+ }
168
242
  }
169
243
  ],
170
244
  "requestBody": {
@@ -172,6 +246,11 @@
172
246
  "application/json": {
173
247
  "schema": {
174
248
  "$ref": "#/components/schemas/ShopperContext"
249
+ },
250
+ "examples": {
251
+ "ShopperContextExample": {
252
+ "$ref": "#/components/examples/ShopperContextExample"
253
+ }
175
254
  }
176
255
  }
177
256
  },
@@ -182,6 +261,7 @@
182
261
  "description": "The shopper's context was created successfully.",
183
262
  "headers": {
184
263
  "X-Geolocation": {
264
+ "description": "The response header returns the geolocation based on the `clientIp` or `geoLocation` attribute set in the shopper context. If both are set, `geoLocation` takes precedence.",
185
265
  "required": false,
186
266
  "style": "simple",
187
267
  "explode": false,
@@ -195,6 +275,7 @@
195
275
  "description": "The shopper's context was created successfully.",
196
276
  "headers": {
197
277
  "X-Geolocation": {
278
+ "description": "The response header returns the geolocation based on the `clientIp` or `geoLocation` attribute set in the shopper context. If both are set, `geoLocation` takes precedence.",
198
279
  "required": false,
199
280
  "style": "simple",
200
281
  "explode": false,
@@ -207,9 +288,14 @@
207
288
  "400": {
208
289
  "description": "The usid in the incoming request does not match the usid in the token.",
209
290
  "content": {
210
- "application/json": {
291
+ "application/problem+json": {
211
292
  "schema": {
212
293
  "$ref": "#/components/schemas/ErrorResponse"
294
+ },
295
+ "examples": {
296
+ "getShopperContext400": {
297
+ "$ref": "#/components/examples/BadRequestUSIDNotMatching"
298
+ }
213
299
  }
214
300
  }
215
301
  }
@@ -217,9 +303,14 @@
217
303
  "401": {
218
304
  "description": "Your shopper JWT is invalid and cannot be used to identify the API client.",
219
305
  "content": {
220
- "application/json": {
306
+ "application/problem+json": {
221
307
  "schema": {
222
308
  "$ref": "#/components/schemas/ErrorResponse"
309
+ },
310
+ "examples": {
311
+ "getShopperContext401": {
312
+ "$ref": "#/components/examples/Unauthorized"
313
+ }
223
314
  }
224
315
  }
225
316
  }
@@ -227,9 +318,14 @@
227
318
  "403": {
228
319
  "description": "Your shopper JWT is valid, but you do not have permission to access the resource.",
229
320
  "content": {
230
- "application/json": {
321
+ "application/problem+json": {
231
322
  "schema": {
232
323
  "$ref": "#/components/schemas/ErrorResponse"
324
+ },
325
+ "examples": {
326
+ "Forbidden": {
327
+ "$ref": "#/components/examples/Forbidden"
328
+ }
233
329
  }
234
330
  }
235
331
  }
@@ -240,15 +336,22 @@
240
336
  "ShopperToken": [
241
337
  "sfcc.shopper-context.rw"
242
338
  ]
339
+ },
340
+ {
341
+ "ShopperClientContextToken": [
342
+ "sfcc.shopper-context.rw"
343
+ ]
243
344
  }
244
345
  ]
245
346
  },
246
347
  "delete": {
348
+ "description": "Delete the shopper's context based on the shopperJWT.",
247
349
  "operationId": "deleteShopperContext",
248
350
  "parameters": [
249
351
  {
250
352
  "name": "usid",
251
353
  "in": "path",
354
+ "description": "The Shopper's unique identifier. It is a required parameter and is part of the response from the Guest or Registered User Shopper Login (SLAS) API call.",
252
355
  "required": true,
253
356
  "style": "simple",
254
357
  "explode": false,
@@ -259,21 +362,38 @@
259
362
  {
260
363
  "name": "organizationId",
261
364
  "in": "path",
365
+ "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).",
262
366
  "required": true,
263
367
  "style": "simple",
264
368
  "explode": false,
265
369
  "schema": {
266
370
  "$ref": "#/components/schemas/OrganizationId"
267
- }
371
+ },
372
+ "example": "f_ecom_zzxy_prd"
268
373
  },
269
374
  {
270
375
  "name": "siteId",
271
376
  "in": "query",
377
+ "description": "The site context.",
272
378
  "required": true,
273
379
  "style": "form",
274
380
  "explode": true,
275
381
  "schema": {
276
382
  "$ref": "#/components/schemas/SiteId"
383
+ },
384
+ "example": "RefArch"
385
+ },
386
+ {
387
+ "name": "sfdc_usid",
388
+ "in": "header",
389
+ "description": "A unique shopper identifier (USID) for tracking client context.\nUsed with endpoints secured with ShopperClientContextToken.\nThis header is required for all endpoints secured with ShopperClientContextToken.",
390
+ "required": false,
391
+ "style": "simple",
392
+ "explode": false,
393
+ "schema": {
394
+ "type": "string",
395
+ "format": "uuid",
396
+ "example": "550e8400-e29b-41d4-a716-446655440000"
277
397
  }
278
398
  }
279
399
  ],
@@ -284,9 +404,14 @@
284
404
  "400": {
285
405
  "description": "The usid in the incoming request does not match the usid in the token.",
286
406
  "content": {
287
- "application/json": {
407
+ "application/problem+json": {
288
408
  "schema": {
289
409
  "$ref": "#/components/schemas/ErrorResponse"
410
+ },
411
+ "examples": {
412
+ "getShopperContext400": {
413
+ "$ref": "#/components/examples/BadRequestUSIDNotMatching"
414
+ }
290
415
  }
291
416
  }
292
417
  }
@@ -294,9 +419,14 @@
294
419
  "401": {
295
420
  "description": "Your shopper JWT is invalid and cannot be used to identify the API client.",
296
421
  "content": {
297
- "application/json": {
422
+ "application/problem+json": {
298
423
  "schema": {
299
424
  "$ref": "#/components/schemas/ErrorResponse"
425
+ },
426
+ "examples": {
427
+ "getShopperContext401": {
428
+ "$ref": "#/components/examples/Unauthorized"
429
+ }
300
430
  }
301
431
  }
302
432
  }
@@ -304,9 +434,14 @@
304
434
  "403": {
305
435
  "description": "Your shopper JWT is valid, but you do not have permission to access the resource.",
306
436
  "content": {
307
- "application/json": {
437
+ "application/problem+json": {
308
438
  "schema": {
309
439
  "$ref": "#/components/schemas/ErrorResponse"
440
+ },
441
+ "examples": {
442
+ "Forbidden": {
443
+ "$ref": "#/components/examples/Forbidden"
444
+ }
310
445
  }
311
446
  }
312
447
  }
@@ -314,9 +449,14 @@
314
449
  "404": {
315
450
  "description": "Shopper Context for ORGANIZATION_ID - f_ecom_bhbv_prd and USID - 7e1f65fb-185c-4788-8cec-05fef8dac77d not found in repository.",
316
451
  "content": {
317
- "application/json": {
452
+ "application/problem+json": {
318
453
  "schema": {
319
454
  "$ref": "#/components/schemas/ErrorResponse"
455
+ },
456
+ "examples": {
457
+ "getShopperContext404": {
458
+ "$ref": "#/components/examples/NotFound"
459
+ }
320
460
  }
321
461
  }
322
462
  }
@@ -327,15 +467,23 @@
327
467
  "ShopperToken": [
328
468
  "sfcc.shopper-context.rw"
329
469
  ]
470
+ },
471
+ {
472
+ "ShopperClientContextToken": [
473
+ "sfcc.shopper-context.rw"
474
+ ]
330
475
  }
331
476
  ]
332
477
  },
333
478
  "patch": {
479
+ "summary": "Update an existing shopper's context based on the Shopper JWT.",
480
+ "description": "If the shopper context exists, it's updated with the patch body.\n- If a new attribute that does not exist in the existing shopper context is present, it is added to the context.\n-If an attribute is already present in the existing shopper context, its value is replaced by the corresponding value from the new shopper context in the request body as follows:\n - `custom qualifiers` or `assignment qualifiers`:\n\n If the individual qualifier key exists, it is overwritten with the new value.\n\n If the value of the key is set to null, it is deleted from the existing shopper context.\n\n If an empty `custom qualifiers` or `assignment qualifiers` object `{}` is passed, the entire qualifier object is deleted.\n - `effectiveDateTime` or `sourceCode` or `clientIp`:\n\n If the new value is set to an empty string (\"\"), it is deleted from the existing shopper context.\n\n If the new value is set to null, it is ignored.\n\n If the new value is not empty or null, it overwrites the existing value.\n\n - `customerGroupIds`:\n\n If a list of `customerGroupIds` exists, it is replaced by the new list of customer group IDs from the request.\n\n If `customerGroupIds` is set to an empty array [], the existing list in the shopper context is deleted.\n\n - `geoLocation`: \n\n If it exists, the entire `geoLocation` object is replaced with the new value.\n\n If the new value is set to null, it is ignored.\n\n If an empty `geoLocation` object `{}` is passed, it is deleted.",
334
481
  "operationId": "updateShopperContext",
335
482
  "parameters": [
336
483
  {
337
484
  "name": "usid",
338
485
  "in": "path",
486
+ "description": "The Shopper's unique identifier. It is a required parameter and is part of the response from the Guest or Registered User Shopper Login (SLAS) API call.",
339
487
  "required": true,
340
488
  "style": "simple",
341
489
  "explode": false,
@@ -346,32 +494,50 @@
346
494
  {
347
495
  "name": "organizationId",
348
496
  "in": "path",
497
+ "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).",
349
498
  "required": true,
350
499
  "style": "simple",
351
500
  "explode": false,
352
501
  "schema": {
353
502
  "$ref": "#/components/schemas/OrganizationId"
354
- }
503
+ },
504
+ "example": "f_ecom_zzxy_prd"
355
505
  },
356
506
  {
357
507
  "name": "siteId",
358
508
  "in": "query",
509
+ "description": "The site context.",
359
510
  "required": true,
360
511
  "style": "form",
361
512
  "explode": true,
362
513
  "schema": {
363
514
  "$ref": "#/components/schemas/SiteId"
364
- }
515
+ },
516
+ "example": "RefArch"
365
517
  },
366
518
  {
367
519
  "name": "evaluateContextWithClientIp",
368
520
  "in": "query",
521
+ "description": "Determines whether to evaluate the context using the provided `clientIp`. This property is available with B2C Commerce version 24.7.\n- If `evaluateContextWithClientIp` is set to `true`:\n - The `clientIP` is saved and used in subsequent requests.\n\n- If `evaluateContextWithClientIp` is set to `false`:\n - The `clientIP` is not saved and will not be used in subsequent requests.\n",
369
522
  "required": false,
370
523
  "style": "form",
371
524
  "explode": true,
372
525
  "schema": {
373
526
  "type": "boolean"
374
527
  }
528
+ },
529
+ {
530
+ "name": "sfdc_usid",
531
+ "in": "header",
532
+ "description": "A unique shopper identifier (USID) for tracking client context.\nUsed with endpoints secured with ShopperClientContextToken.\nThis header is required for all endpoints secured with ShopperClientContextToken.",
533
+ "required": false,
534
+ "style": "simple",
535
+ "explode": false,
536
+ "schema": {
537
+ "type": "string",
538
+ "format": "uuid",
539
+ "example": "550e8400-e29b-41d4-a716-446655440000"
540
+ }
375
541
  }
376
542
  ],
377
543
  "requestBody": {
@@ -379,6 +545,11 @@
379
545
  "application/json": {
380
546
  "schema": {
381
547
  "$ref": "#/components/schemas/ShopperContext"
548
+ },
549
+ "examples": {
550
+ "ShopperContextUpdateRequestBody": {
551
+ "$ref": "#/components/examples/ShopperContextUpdateRequestBody"
552
+ }
382
553
  }
383
554
  }
384
555
  },
@@ -401,6 +572,11 @@
401
572
  "application/json": {
402
573
  "schema": {
403
574
  "$ref": "#/components/schemas/ShopperContext"
575
+ },
576
+ "examples": {
577
+ "ShopperContextUpdateResponseExample": {
578
+ "$ref": "#/components/examples/ShopperContextUpdateResponseExample"
579
+ }
404
580
  }
405
581
  }
406
582
  }
@@ -408,9 +584,14 @@
408
584
  "400": {
409
585
  "description": "The usid in the incoming request does not match the usid in the token.",
410
586
  "content": {
411
- "application/json": {
587
+ "application/problem+json": {
412
588
  "schema": {
413
589
  "$ref": "#/components/schemas/ErrorResponse"
590
+ },
591
+ "examples": {
592
+ "updateShopperContext400": {
593
+ "$ref": "#/components/examples/BadRequestUSIDNotMatching"
594
+ }
414
595
  }
415
596
  }
416
597
  }
@@ -418,9 +599,14 @@
418
599
  "401": {
419
600
  "description": "Your shopper JWT is invalid and cannot be used to identify the API client.",
420
601
  "content": {
421
- "application/json": {
602
+ "application/problem+json": {
422
603
  "schema": {
423
604
  "$ref": "#/components/schemas/ErrorResponse"
605
+ },
606
+ "examples": {
607
+ "updateShopperContext401": {
608
+ "$ref": "#/components/examples/Unauthorized"
609
+ }
424
610
  }
425
611
  }
426
612
  }
@@ -428,9 +614,14 @@
428
614
  "403": {
429
615
  "description": "Your shopper JWT is valid, but you do not have permission to access the resource.",
430
616
  "content": {
431
- "application/json": {
617
+ "application/problem+json": {
432
618
  "schema": {
433
619
  "$ref": "#/components/schemas/ErrorResponse"
620
+ },
621
+ "examples": {
622
+ "updateShopperContext403": {
623
+ "$ref": "#/components/examples/Forbidden"
624
+ }
434
625
  }
435
626
  }
436
627
  }
@@ -441,6 +632,11 @@
441
632
  "ShopperToken": [
442
633
  "sfcc.shopper-context.rw"
443
634
  ]
635
+ },
636
+ {
637
+ "ShopperClientContextToken": [
638
+ "sfcc.shopper-context.rw"
639
+ ]
444
640
  }
445
641
  ]
446
642
  }
@@ -450,29 +646,60 @@
450
646
  "schemas": {
451
647
  "OrganizationId": {
452
648
  "type": "string",
453
- "maxLength": 32,
454
- "minLength": 1
649
+ "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).",
650
+ "example": "f_ecom_zzxy_prd",
651
+ "pattern": "^f_ecom_[a-z]{4}_(prd|stg|dev|s[0-9]{2}|[0-9]{3})$"
455
652
  },
456
653
  "SiteId": {
457
654
  "type": "string",
655
+ "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",
656
+ "example": "RefArch",
458
657
  "maxLength": 32,
459
658
  "minLength": 1
460
659
  },
461
660
  "ShopperContext": {
462
661
  "type": "object",
463
662
  "additionalProperties": false,
663
+ "description": "A shoppers' context represented as key-value string pairs.",
664
+ "example": {
665
+ "effectiveDateTime": "2020-12-20T00:00:00Z",
666
+ "sourceCode": "wii1-98",
667
+ "customQualifiers": {
668
+ "deviceType": "mobile",
669
+ "ipAddress": "189.0.0.0",
670
+ "operatingSystem": "Android"
671
+ },
672
+ "assignmentQualifiers": {
673
+ "store": "boston"
674
+ },
675
+ "customerGroupIds": [
676
+ "BigSpenders",
677
+ "MobileUsers"
678
+ ],
679
+ "clientIp": "12.12.12.1",
680
+ "couponCodes": [
681
+ "Save20",
682
+ "FREESHIP"
683
+ ]
684
+ },
464
685
  "properties": {
465
686
  "effectiveDateTime": {
466
687
  "type": "string",
467
- "format": "date-time"
688
+ "format": "date-time",
689
+ "description": "Qualifier to set the effective date time for the context to apply. For example, \"Shop the Future\" use cases. If not provided, the current dateTime will be assumed.",
690
+ "example": "2020-12-20T00:00:00Z"
468
691
  },
469
692
  "sourceCode": {
470
- "type": "string"
693
+ "type": "string",
694
+ "description": "Qualifier to set the source code for the context to apply. Set the source code to evaluate source code group that triggers the promotion (campaign assignment) and Price books (assigned to Source code group).",
695
+ "example": "wii1-98"
471
696
  },
472
697
  "customerGroupIds": {
473
698
  "type": "array",
699
+ "description": "Qualifier to set the Customer Group Ids for the context to apply. Set the Customer Group Ids to evaluate customer groups that trigger the promotions (campaign assignment) assigned to the customer groups.",
474
700
  "items": {
475
701
  "type": "string",
702
+ "example": "BigSpenders",
476
703
  "maxLength": 256
477
704
  }
478
705
  },
@@ -480,55 +707,88 @@
480
707
  "type": "object",
481
708
  "additionalProperties": {
482
709
  "type": "string"
710
+ },
711
+ "description": "Map of custom qualifiers for the shopper context. Set this object to trigger pricing and promotion experiences using a dynamic session-based customer group. Object size is limited to 20 key-value pairs (properties).",
712
+ "example": {
713
+ "deviceType": "mobile",
714
+ "ipAddress": "189.0.0.0",
715
+ "operatingSystem": "Android"
483
716
  }
484
717
  },
485
718
  "assignmentQualifiers": {
486
719
  "type": "object",
487
720
  "additionalProperties": {
488
- "type": "string"
721
+ "type": "string",
722
+ "example": "{\"store\":\"boston\"}"
723
+ },
724
+ "description": "Map of assignment qualifiers for the shopper context. Set this object when using the assignment framework to activate experiences based on assignment qualifiers. Currently, only pricing and promotion experiences are supported. Object size is limited to 20 key-value pairs (properties).",
725
+ "example": {
726
+ "store": "boston"
489
727
  }
490
728
  },
491
729
  "clientIp": {
492
- "type": "string"
730
+ "type": "string",
731
+ "description": "The IP Address of the client. If the client IP is not a valid IPv4 address, a Bad Request (400) error is thrown. This property is available with B2C Commerce version 24.7.\n\nWhen `clientIp` is set, the geolocation based on the `clientIp` is returned in the `X-Geolocation` header in the response. Note: Use/retrieve this header in a case insensitive manner.\n\nHowever, if the `geoLocation` attribute is also set in the context, it takes precedence over the `clientIp`, and the `X-Geolocation` header returns the geolocation based on the `geoLocation` attribute.\n\nThe query parameter `evaluateContextWithClientIp` determines whether to evaluate the context using the provided `clientIp`.\n - If `evaluateContextWithClientIp` is set to `true`:\n - The `clientIp` is saved and used in subsequent requests. \n \n Note: If `geoLocation` is also saved in the context, it takes precedence over the `clientIp`.\n - If `evaluateContextWithClientIp` is set to `false`:\n - The `clientIp` is not saved and is not used in subsequent requests.",
732
+ "example": "12.12.12.1"
493
733
  },
494
734
  "geoLocation": {
495
735
  "type": "object",
736
+ "description": "The geographic location of the client. When you set a geolocation, it is saved as context for subsequent requests. This overrides any geolocation context previously saved using `clientIp`. This property is available with B2C Commerce version 24.7.",
496
737
  "properties": {
497
738
  "city": {
498
- "type": "string"
739
+ "type": "string",
740
+ "description": "The city name associated with this location.",
741
+ "example": "Boston"
499
742
  },
500
743
  "country": {
501
- "type": "string"
744
+ "type": "string",
745
+ "description": "The country name associated with this location.",
746
+ "example": "United States of America"
502
747
  },
503
748
  "countryCode": {
504
- "type": "string"
749
+ "type": "string",
750
+ "description": "The ISO country code associated with this location.",
751
+ "example": "US"
505
752
  },
506
753
  "latitude": {
507
754
  "type": "number",
508
- "format": "double"
755
+ "format": "double",
756
+ "description": "The latitude coordinate, which is a number between -90.0 and +90.0, associated with this location.",
757
+ "example": 10.11
509
758
  },
510
759
  "longitude": {
511
760
  "type": "number",
512
- "format": "double"
761
+ "format": "double",
762
+ "description": "The longitude coordinate, which is a number between -180.0 and +180.0, associated with this location.",
763
+ "example": 198.34
513
764
  },
514
765
  "metroCode": {
515
- "type": "string"
766
+ "type": "string",
767
+ "description": "The metro code associated with this location."
516
768
  },
517
769
  "postalCode": {
518
- "type": "string"
770
+ "type": "string",
771
+ "description": "The postal code associated with this location.",
772
+ "example": "01730"
519
773
  },
520
774
  "region": {
521
- "type": "string"
775
+ "type": "string",
776
+ "description": "The region (subdivision) name for this location. Corresponds with \"state\" in the USA.",
777
+ "example": "NA"
522
778
  },
523
779
  "regionCode": {
524
- "type": "string"
780
+ "type": "string",
781
+ "description": "The region (province or state) code for this location.",
782
+ "example": "12345"
525
783
  }
526
784
  }
527
785
  },
528
786
  "couponCodes": {
529
787
  "type": "array",
788
+ "description": "Array of coupon codes to be saved in the shopper context. Set the coupon codes to evaluate promotions that can be triggered by these codes.",
530
789
  "items": {
531
790
  "type": "string",
791
+ "example": "SAVE20",
532
792
  "maxLength": 256
533
793
  }
534
794
  }
@@ -540,17 +800,25 @@
540
800
  "properties": {
541
801
  "title": {
542
802
  "type": "string",
803
+ "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",
804
+ "example": "You do not have enough credit",
543
805
  "maxLength": 256
544
806
  },
545
807
  "type": {
546
808
  "type": "string",
809
+ "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",
810
+ "example": "NotEnoughMoney",
547
811
  "maxLength": 2048
548
812
  },
549
813
  "detail": {
550
- "type": "string"
814
+ "type": "string",
815
+ "description": "A human-readable explanation specific to this occurrence of the problem.",
816
+ "example": "Your current balance is 30, but that costs 50"
551
817
  },
552
818
  "instance": {
553
819
  "type": "string",
820
+ "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",
821
+ "example": "/account/12345/msgs/abc",
554
822
  "maxLength": 2048
555
823
  }
556
824
  },
@@ -565,6 +833,7 @@
565
833
  "usid": {
566
834
  "name": "usid",
567
835
  "in": "path",
836
+ "description": "The Shopper's unique identifier. It is a required parameter and is part of the response from the Guest or Registered User Shopper Login (SLAS) API call.",
568
837
  "required": true,
569
838
  "style": "simple",
570
839
  "explode": false,
@@ -575,37 +844,169 @@
575
844
  "organizationId": {
576
845
  "name": "organizationId",
577
846
  "in": "path",
847
+ "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).",
578
848
  "required": true,
579
849
  "style": "simple",
580
850
  "explode": false,
581
851
  "schema": {
582
852
  "$ref": "#/components/schemas/OrganizationId"
583
- }
853
+ },
854
+ "example": "f_ecom_zzxy_prd"
584
855
  },
585
856
  "siteId": {
586
857
  "name": "siteId",
587
858
  "in": "query",
859
+ "description": "The site context.",
588
860
  "required": true,
589
861
  "style": "form",
590
862
  "explode": true,
591
863
  "schema": {
592
864
  "$ref": "#/components/schemas/SiteId"
593
- }
865
+ },
866
+ "example": "RefArch"
594
867
  },
595
868
  "evaluateContextWithClientIp": {
596
869
  "name": "evaluateContextWithClientIp",
597
870
  "in": "query",
871
+ "description": "Determines whether to evaluate the context using the provided `clientIp`. This property is available with B2C Commerce version 24.7.\n- If `evaluateContextWithClientIp` is set to `true`:\n - The `clientIP` is saved and used in subsequent requests.\n\n- If `evaluateContextWithClientIp` is set to `false`:\n - The `clientIP` is not saved and will not be used in subsequent requests.\n",
598
872
  "required": false,
599
873
  "style": "form",
600
874
  "explode": true,
601
875
  "schema": {
602
876
  "type": "boolean"
603
877
  }
878
+ },
879
+ "sfdcUsid": {
880
+ "name": "sfdc_usid",
881
+ "in": "header",
882
+ "description": "A unique shopper identifier (USID) for tracking client context.\nUsed with endpoints secured with ShopperClientContextToken.\nThis header is required for all endpoints secured with ShopperClientContextToken.",
883
+ "required": false,
884
+ "style": "simple",
885
+ "explode": false,
886
+ "schema": {
887
+ "type": "string",
888
+ "format": "uuid",
889
+ "example": "550e8400-e29b-41d4-a716-446655440000"
890
+ }
891
+ }
892
+ },
893
+ "examples": {
894
+ "ShopperContextExample": {
895
+ "value": {
896
+ "effectiveDateTime": "2020-12-20T00:00:00Z",
897
+ "sourceCode": "wii1-98",
898
+ "customQualifiers": {
899
+ "deviceType": "mobile",
900
+ "ipAddress": "189.0.0.0",
901
+ "operatingSystem": "Android"
902
+ },
903
+ "assignmentQualifiers": {
904
+ "store": "boston"
905
+ },
906
+ "customerGroupIds": [
907
+ "BigSpenders",
908
+ "MobileUsers"
909
+ ],
910
+ "clientIp": "12.12.12.1",
911
+ "couponCodes": [
912
+ "Save20",
913
+ "FREESHIP"
914
+ ]
915
+ }
916
+ },
917
+ "BadRequestUSIDNotMatching": {
918
+ "value": {
919
+ "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/usid-not-matching-with-token",
920
+ "detail": "Usid in incoming request does not match Usid in token.",
921
+ "title": "Usid not matching with token"
922
+ }
923
+ },
924
+ "Unauthorized": {
925
+ "value": {
926
+ "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/unauthorized",
927
+ "title": "Unauthorized",
928
+ "detail": "Your shopper JWT is invalid and could not be used to identify the API client."
929
+ }
930
+ },
931
+ "Forbidden": {
932
+ "value": {
933
+ "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/forbidden",
934
+ "title": "Forbidden",
935
+ "detail": "Your shopper JWT is valid, but you have no permissions to access the resource."
936
+ }
937
+ },
938
+ "NotFound": {
939
+ "value": {
940
+ "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/shopper-context-no-found",
941
+ "detail": "Shopper Context for ORGANIZATION_ID: f_ecom_bhbv_prd and USID: 7e1f65fb-185c-4788-8cec-05fef8dac77d not found in Repository.",
942
+ "title": "Shopper Context Not Found"
943
+ }
944
+ },
945
+ "ShopperContextUpdateRequestBody": {
946
+ "value": {
947
+ "customQualifiers": {
948
+ "deviceType": "iPad",
949
+ "storeId": "SLC1"
950
+ },
951
+ "assignmentQualifiers": {
952
+ "store": "london"
953
+ },
954
+ "clientIp": "12.12.12.1",
955
+ "geoLocation": {
956
+ "countryCode": "US",
957
+ "country": "United States of America",
958
+ "city": "Boston",
959
+ "postalCode": "01730",
960
+ "metroCode": "M234",
961
+ "region": "NA",
962
+ "regionCode": "12345",
963
+ "latitude": 10.11,
964
+ "longitude": 198.34
965
+ },
966
+ "couponCodes": [
967
+ "Save20",
968
+ "FREESHIP"
969
+ ]
970
+ }
971
+ },
972
+ "ShopperContextUpdateResponseExample": {
973
+ "value": {
974
+ "sourceCode": "wii1-98",
975
+ "customQualifiers": {
976
+ "deviceType": "iPad",
977
+ "ipAddress": "189.0.0.0",
978
+ "storeId": "SLC1"
979
+ },
980
+ "assignmentQualifiers": {
981
+ "store": "london"
982
+ },
983
+ "customerGroupIds": [
984
+ "BigSpenders",
985
+ "MobileUsers"
986
+ ],
987
+ "clientIp": "12.12.12.1",
988
+ "geoLocation": {
989
+ "countryCode": "US",
990
+ "country": "United States of America",
991
+ "city": "Boston",
992
+ "postalCode": "01730",
993
+ "metroCode": "M234",
994
+ "region": "NA",
995
+ "regionCode": "12345",
996
+ "latitude": 10.11,
997
+ "longitude": 198.34
998
+ },
999
+ "couponCodes": [
1000
+ "Save20",
1001
+ "FREESHIP"
1002
+ ]
1003
+ }
604
1004
  }
605
1005
  },
606
1006
  "securitySchemes": {
607
1007
  "ShopperToken": {
608
1008
  "type": "oauth2",
1009
+ "description": "ShopperToken authentication follows the authorization code grant flow, as defined by the OAuth 2.1 standard. Depending on the type of OAuth client (public or private), this authorization flow has further requirements. \nFor a detailed description of the authorization flow, see the [SLAS overview](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-login:Summary).\nA shopper token allows you to access the Shopper API endpoints of both the Open Commerce API (OCAPI) and the B2C Commerce API. These endpoints can be used to build headless storefronts and other applications.\nThe `ShopperToken` security scheme is a parent of other security schemes, such as `ShopperTokenTsob`. A Shopper API endpoint can require a specific child scheme (`ShopperTokenTsob`, for example) that cannot be accessed with a regular shopper token.\n",
609
1010
  "flows": {
610
1011
  "clientCredentials": {
611
1012
  "tokenUrl": "https://{shortCode}.api.commercecloud.salesforce.com/shopper/auth/v1/organizations/{organizationId}/oauth2/token",
@@ -615,8 +1016,21 @@
615
1016
  }
616
1017
  },
617
1018
  "authorizationCode": {
618
- "authorizationUrl": "https://{short-code}.api.commercecloud.salesforce.com/shopper/auth/v1/organizations/{organizationId}/oauth2/authorize",
619
- "tokenUrl": "https://{short-code}.api.commercecloud.salesforce.com/shopper/auth/v1/organizations/{organizationId}/oauth2/token",
1019
+ "authorizationUrl": "https://{shortCode}.api.commercecloud.salesforce.com/shopper/auth/v1/organizations/{organizationId}/oauth2/authorize",
1020
+ "tokenUrl": "https://{shortCode}.api.commercecloud.salesforce.com/shopper/auth/v1/organizations/{organizationId}/oauth2/token",
1021
+ "scopes": {
1022
+ "sfcc.shopper-context": "Shopper Context READONLY",
1023
+ "sfcc.shopper-context.rw": "Shopper Context"
1024
+ }
1025
+ }
1026
+ }
1027
+ },
1028
+ "ShopperClientContextToken": {
1029
+ "type": "oauth2",
1030
+ "description": "ShopperClientContextToken is a separate security scheme used to track and validate client context information.\nIt is valid for Guest shoppers flows only using SLAS private clients. For registered shoppers, use existing ShopperToken flows.\nFor authentication details, see the [SLAS overview](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-login:Summary).\nThis token allows access to Shopper API endpoints for guest shoppers only.\n",
1031
+ "flows": {
1032
+ "clientCredentials": {
1033
+ "tokenUrl": "https://{shortCode}.api.commercecloud.salesforce.com/shopper/auth/v1/organizations/{organizationId}/oauth2/token?hint=client_context",
620
1034
  "scopes": {
621
1035
  "sfcc.shopper-context": "Shopper Context READONLY",
622
1036
  "sfcc.shopper-context.rw": "Shopper Context"