@salesforce/b2c-tooling-sdk 2.4.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 (140) hide show
  1. package/data/schemas/dw.schema.json +14 -0
  2. package/data/tooling/index.json +5 -5
  3. package/dist/esm/cli/base-command.js +4 -3
  4. package/dist/esm/cli/base-command.js.map +1 -1
  5. package/dist/esm/cli/cartridge-command.js +2 -1
  6. package/dist/esm/cli/cartridge-command.js.map +1 -1
  7. package/dist/esm/cli/config.js +3 -1
  8. package/dist/esm/cli/config.js.map +1 -1
  9. package/dist/esm/cli/hooks.d.ts +13 -0
  10. package/dist/esm/cli/hooks.js +11 -0
  11. package/dist/esm/cli/hooks.js.map +1 -1
  12. package/dist/esm/cli/instance-command.js +2 -1
  13. package/dist/esm/cli/instance-command.js.map +1 -1
  14. package/dist/esm/clients/scapi-backend-utils.d.ts +15 -0
  15. package/dist/esm/clients/scapi-backend-utils.js +28 -1
  16. package/dist/esm/clients/scapi-backend-utils.js.map +1 -1
  17. package/dist/esm/clients/scapi-fallback-backend.js +2 -2
  18. package/dist/esm/clients/scapi-fallback-backend.js.map +1 -1
  19. package/dist/esm/clients/scapi-schemas.generated.d.ts +2 -2
  20. package/dist/esm/compat/dispatcher.js +2 -2
  21. package/dist/esm/compat/dispatcher.js.map +1 -1
  22. package/dist/esm/config/config-origins.d.ts +19 -0
  23. package/dist/esm/config/config-origins.js +11 -0
  24. package/dist/esm/config/config-origins.js.map +1 -0
  25. package/dist/esm/config/config-write.d.ts +86 -0
  26. package/dist/esm/config/config-write.js +296 -0
  27. package/dist/esm/config/config-write.js.map +1 -0
  28. package/dist/esm/config/dw-json-schema.js +4 -0
  29. package/dist/esm/config/dw-json-schema.js.map +1 -1
  30. package/dist/esm/config/dw-json.d.ts +2 -0
  31. package/dist/esm/config/dw-json.js +10 -6
  32. package/dist/esm/config/dw-json.js.map +1 -1
  33. package/dist/esm/config/index.d.ts +8 -3
  34. package/dist/esm/config/index.js +5 -2
  35. package/dist/esm/config/index.js.map +1 -1
  36. package/dist/esm/config/instance-manager.d.ts +64 -28
  37. package/dist/esm/config/instance-manager.js +145 -63
  38. package/dist/esm/config/instance-manager.js.map +1 -1
  39. package/dist/esm/config/mapping.js +6 -0
  40. package/dist/esm/config/mapping.js.map +1 -1
  41. package/dist/esm/config/resolver.d.ts +22 -0
  42. package/dist/esm/config/resolver.js +54 -29
  43. package/dist/esm/config/resolver.js.map +1 -1
  44. package/dist/esm/config/sources/dw-json-source.d.ts +9 -1
  45. package/dist/esm/config/sources/dw-json-source.js +34 -20
  46. package/dist/esm/config/sources/dw-json-source.js.map +1 -1
  47. package/dist/esm/config/sources/env-source.d.ts +30 -3
  48. package/dist/esm/config/sources/env-source.js +126 -1
  49. package/dist/esm/config/sources/env-source.js.map +1 -1
  50. package/dist/esm/config/types.d.ts +46 -0
  51. package/dist/esm/operations/jobs/run-system-job.js +2 -2
  52. package/dist/esm/operations/jobs/run-system-job.js.map +1 -1
  53. package/dist/esm/plugins/discovery.js +2 -1
  54. package/dist/esm/plugins/discovery.js.map +1 -1
  55. package/dist/esm/scapi/index.d.ts +5 -2
  56. package/dist/esm/scapi/index.js +3 -2
  57. package/dist/esm/scapi/index.js.map +1 -1
  58. package/dist/esm/scapi/live.d.ts +12 -1
  59. package/dist/esm/scapi/live.js +30 -2
  60. package/dist/esm/scapi/live.js.map +1 -1
  61. package/dist/esm/scapi/local.d.ts +17 -0
  62. package/dist/esm/scapi/local.js +68 -16
  63. package/dist/esm/scapi/local.js.map +1 -1
  64. package/dist/esm/scapi/request.d.ts +2 -2
  65. package/dist/esm/scapi/request.js +2 -1
  66. package/dist/esm/scapi/request.js.map +1 -1
  67. package/dist/esm/scapi/runtime.d.ts +5 -0
  68. package/dist/esm/scapi/runtime.js.map +1 -1
  69. package/dist/esm/scapi/schema-source.d.ts +90 -0
  70. package/dist/esm/scapi/schema-source.js +146 -0
  71. package/dist/esm/scapi/schema-source.js.map +1 -0
  72. package/dist/esm/scapi/worker-source.js +30 -6
  73. package/dist/esm/scapi/worker-source.js.map +1 -1
  74. package/dist/esm/test-utils/config-isolation.js +9 -2
  75. package/dist/esm/test-utils/config-isolation.js.map +1 -1
  76. package/node_modules/@salesforce/b2c-api-schemas/manifest.json +83 -42
  77. package/node_modules/@salesforce/b2c-api-schemas/package.json +1 -1
  78. package/node_modules/@salesforce/b2c-api-schemas/scapi/cdn/zones/v1.json +6798 -238
  79. package/node_modules/@salesforce/b2c-api-schemas/scapi/checkout/orders/v1.json +2296 -205
  80. package/node_modules/@salesforce/b2c-api-schemas/scapi/checkout/shopper-baskets/v1.json +5571 -666
  81. package/node_modules/@salesforce/b2c-api-schemas/scapi/checkout/shopper-baskets/v2.json +6062 -371
  82. package/node_modules/@salesforce/b2c-api-schemas/scapi/checkout/shopper-orders/v1.json +3426 -360
  83. package/node_modules/@salesforce/b2c-api-schemas/scapi/checkout/shopper-payments/v1.json +351 -99
  84. package/node_modules/@salesforce/b2c-api-schemas/scapi/configuration/cors/v1.json +172 -12
  85. package/node_modules/@salesforce/b2c-api-schemas/scapi/configuration/preferences/v1.json +1497 -111
  86. package/node_modules/@salesforce/b2c-api-schemas/scapi/configuration/shopper-configurations/v1.json +202 -36
  87. package/node_modules/@salesforce/b2c-api-schemas/scapi/configuration/timeouts/v1.json +79 -10
  88. package/node_modules/@salesforce/b2c-api-schemas/scapi/custom-object/custom-objects/v1.json +785 -49
  89. package/node_modules/@salesforce/b2c-api-schemas/scapi/custom-object/shopper-custom-objects/v1.json +191 -40
  90. package/node_modules/@salesforce/b2c-api-schemas/scapi/customer/customers/v1.json +1483 -107
  91. package/node_modules/@salesforce/b2c-api-schemas/scapi/customer/shopper-customers/v1.json +4854 -787
  92. package/node_modules/@salesforce/b2c-api-schemas/scapi/dx/custom-apis/v1.json +119 -15
  93. package/node_modules/@salesforce/b2c-api-schemas/scapi/dx/object-definitions/v1.json +1699 -80
  94. package/node_modules/@salesforce/b2c-api-schemas/scapi/dx/scapi-schemas/v1.json +252 -18
  95. package/node_modules/@salesforce/b2c-api-schemas/scapi/dx/scripts/v1.json +329 -23
  96. package/node_modules/@salesforce/b2c-api-schemas/scapi/experience/experiences/v1.json +4208 -234
  97. package/node_modules/@salesforce/b2c-api-schemas/scapi/experience/shopper-experience/v1.json +1591 -247
  98. package/node_modules/@salesforce/b2c-api-schemas/scapi/intelligence/analytics/v1.json +396 -8
  99. package/node_modules/@salesforce/b2c-api-schemas/scapi/inventory/availability/v1.json +1242 -69
  100. package/node_modules/@salesforce/b2c-api-schemas/scapi/inventory/impex/v1.json +2354 -248
  101. package/node_modules/@salesforce/b2c-api-schemas/scapi/inventory/reservation/v1.json +1550 -45
  102. package/node_modules/@salesforce/b2c-api-schemas/scapi/inventory/segmentation/v1.json +6615 -0
  103. package/node_modules/@salesforce/b2c-api-schemas/scapi/merchant/roles/v1.json +1520 -59
  104. package/node_modules/@salesforce/b2c-api-schemas/scapi/merchant/users/v1.json +397 -17
  105. package/node_modules/@salesforce/b2c-api-schemas/scapi/observability/metrics/v1.json +1241 -27
  106. package/node_modules/@salesforce/b2c-api-schemas/scapi/operation/jobs/v1.json +1069 -68
  107. package/node_modules/@salesforce/b2c-api-schemas/scapi/operation/replications/v1.json +410 -23
  108. package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/assignments/v1.json +502 -102
  109. package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/campaigns/v1.json +1112 -94
  110. package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/coupons/v1.json +820 -93
  111. package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/gift-certificates/v1.json +845 -92
  112. package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/promotions/v1.json +2716 -674
  113. package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/shopper-gift-certificates/v1.json +130 -47
  114. package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/shopper-promotions/v1.json +233 -63
  115. package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/source-code-groups/v1.json +630 -70
  116. package/node_modules/@salesforce/b2c-api-schemas/scapi/product/catalogs/v1.json +2886 -348
  117. package/node_modules/@salesforce/b2c-api-schemas/scapi/product/inventory-lists/v1.json +520 -19
  118. package/node_modules/@salesforce/b2c-api-schemas/scapi/product/price-books/v1.json +3115 -293
  119. package/node_modules/@salesforce/b2c-api-schemas/scapi/product/products/v1.json +3313 -138
  120. package/node_modules/@salesforce/b2c-api-schemas/scapi/product/shopper-availability/v1.json +266 -52
  121. package/node_modules/@salesforce/b2c-api-schemas/scapi/product/shopper-delivery-estimates/v1.json +256 -48
  122. package/node_modules/@salesforce/b2c-api-schemas/scapi/product/shopper-products/v1.json +1744 -306
  123. package/node_modules/@salesforce/b2c-api-schemas/scapi/search/shopper-search/v1.json +1661 -120
  124. package/node_modules/@salesforce/b2c-api-schemas/scapi/shopper/auth/v1.json +2174 -118
  125. package/node_modules/@salesforce/b2c-api-schemas/scapi/shopper/auth-admin/v1.json +1373 -24
  126. package/node_modules/@salesforce/b2c-api-schemas/scapi/shopper/consents/v1.json +531 -20
  127. package/node_modules/@salesforce/b2c-api-schemas/scapi/shopper/shopper-agents/v1.json +154 -6
  128. package/node_modules/@salesforce/b2c-api-schemas/scapi/shopper/shopper-consents/v1.json +596 -79
  129. package/node_modules/@salesforce/b2c-api-schemas/scapi/shopper/shopper-context/v1.json +456 -42
  130. package/node_modules/@salesforce/b2c-api-schemas/scapi/site/seo/v1.json +101 -23
  131. package/node_modules/@salesforce/b2c-api-schemas/scapi/site/shopper-seo/v1.json +184 -41
  132. package/node_modules/@salesforce/b2c-api-schemas/scapi/site/sites/v1.json +995 -47
  133. package/node_modules/@salesforce/b2c-api-schemas/scapi/store/shopper-stores/v1.json +370 -67
  134. package/node_modules/@salesforce/b2c-api-schemas/scapi/store/store-redirect-mappings/v1.json +319 -11
  135. package/node_modules/@salesforce/b2c-api-schemas/scapi/store/stores/v1.json +1109 -64
  136. package/node_modules/@salesforce/b2c-api-schemas/scapi/storefront/deployments/v1.json +1442 -0
  137. package/node_modules/@salesforce/b2c-api-schemas/scapi/storefront/environments/v1.json +4293 -0
  138. package/node_modules/@salesforce/b2c-api-schemas/scapi/storefront/storefronts/v1.json +1371 -0
  139. package/package.json +2 -2
  140. 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 Availability",
5
- "version": "1.4.0",
5
+ "description": "[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-availability/shopper-availability-oas-v1-public.yaml)\n\n# API Overview\n\nUse the Shopper Availability API enables to retrieve inventory availability for products without fetching full product details. This allows independent caching strategies for volatile availability data and stable product data.\n\nUse `/availability` to retrieve availability for products. If the `inventoryIds` parameter is omitted, availability is returned from the site-assigned default inventory list. If `inventoryIds` is provided, availability is returned only from the specified inventory lists.\n\nCaching is provided for the Shopper Availability API. For details, see [Server-Side Web-Tier Caching.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html)\n\n## Authentication & Authorization\n\nThe client requesting the availability information must have access to the Availability resource. The Shopper Availability API requires a shopper access token from the Shopper Login and API Access Service (SLAS).\n\nYou must include the relevant scopes in the client ID used to generate the SLAS token. For a full list of required 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#guest-user) and [private clients](https://developer.salesforce.com/docs/commerce/commerce-api/guide/slas-private-client.html#guest-user) in the SLAS guides.\n\n## Use Cases\n\n### Retrieve Product Availability\n\nUse the Shopper Availability API so that a customer can see whether products are in stock. This API returns availability details, including stock levels and inventory status, for up to 24 products per request.\n\n### Retrieve Availability from Specific Inventory Lists\n\nUse the `inventoryIds` parameter to retrieve availability from specific inventory lists rather than the site-assigned default. This is useful for scenarios such as showing availability at specific store locations or warehouses. You can request availability from up to 5 inventory lists per request.\n\n### Retrieve Availability for Product Variations\n\nUse the `expand=variations` parameter to retrieve availability for all variants of a master product in a single request. Use the `productId` from each entry in the Shopper Products API `variants` array to look up availability for a specific variant.\n\n## Use Hooks\n\nFor details working with hooks, see [Extensibility with Hooks.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/extensibility_via_hooks.html)",
6
+ "version": "1.4.2",
6
7
  "x-api-type": "Shopper",
7
8
  "x-api-family": "Product"
8
9
  },
@@ -11,6 +12,7 @@
11
12
  "url": "https://{shortCode}.api.commercecloud.salesforce.com/product/shopper-availability/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,35 @@
19
21
  "paths": {
20
22
  "/organizations/{organizationId}/availability": {
21
23
  "get": {
24
+ "summary": "Returns availability for multiple products.",
25
+ "description": "Returns availability for multiple products. If `inventoryIds` is omitted, availability is returned from the site-assigned default inventory list. If `inventoryIds` is provided, availability is returned only from the specified inventory lists. The maximum number of product IDs that you can request is 24. The maximum number of inventory list IDs you can request is 5. The `productIds` parameter accepts product IDs for any product type (master, variant, standard, set, or bundle). Products that are offline or not found are silently filtered from the response. To retrieve availability for all variants of a master product, use the `expand=variations` parameter. Use the `productId` from each entry in the Shopper Products API `variants` array to look up availability for a specific variant.",
22
26
  "operationId": "getAvailability",
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": "productIds",
36
42
  "in": "query",
43
+ "description": "The IDs of the requested products (comma-separated, max 24 IDs). If more than 24 IDs are required, split them into multiple parallel requests. Products that are offline or not found are silently filtered from the response.",
37
44
  "required": true,
38
45
  "style": "form",
39
46
  "explode": false,
40
47
  "schema": {
41
48
  "type": "array",
49
+ "example": [
50
+ "apple-ipod-shuffle",
51
+ "apple-ipod-nano"
52
+ ],
42
53
  "items": {
43
54
  "allOf": [
44
55
  {
@@ -48,16 +59,22 @@
48
59
  },
49
60
  "maxItems": 24,
50
61
  "minItems": 1
51
- }
62
+ },
63
+ "example": "apple-ipod-shuffle,apple-ipod-nano"
52
64
  },
53
65
  {
54
66
  "name": "inventoryIds",
55
67
  "in": "query",
68
+ "description": "The inventory list IDs for which the availability should be shown (comma-separated, max 5 inventory list IDs). If omitted, availability is returned from the site-assigned default inventory list. If provided, availability is returned only from the specified inventory lists.",
56
69
  "required": false,
57
70
  "style": "form",
58
71
  "explode": false,
59
72
  "schema": {
60
73
  "type": "array",
74
+ "example": [
75
+ "Site1InventoryList",
76
+ "Site2InventoryList"
77
+ ],
61
78
  "items": {
62
79
  "allOf": [
63
80
  {
@@ -67,63 +84,66 @@
67
84
  },
68
85
  "maxItems": 5,
69
86
  "minItems": 1
70
- }
87
+ },
88
+ "example": "Site1InventoryList,Site2InventoryList"
71
89
  },
72
90
  {
73
91
  "name": "siteId",
74
92
  "in": "query",
93
+ "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.",
75
94
  "required": true,
76
95
  "style": "form",
77
96
  "explode": true,
78
97
  "schema": {
79
98
  "$ref": "#/components/schemas/SiteId"
99
+ },
100
+ "examples": {
101
+ "SiteId": {
102
+ "value": "RefArch"
103
+ }
80
104
  }
81
105
  },
82
106
  {
83
107
  "name": "expand",
84
108
  "in": "query",
109
+ "description": "Expand the response to include availability for related products. When `variations` is specified, availability for all variation products of a master product is included. When `set_products` is specified, availability for all products in a product set is included. The parent product's availability is always included alongside the expanded entries. Expansion is single-level only: if a variation is itself a product set, its set products are not further expanded. Other product types (bundles, bundled items, set items) are not expanded. Expanded results are returned flat at the top level of the response array, not nested below their parent product.\n**Note:** When using `expand=variations`, combine this response with variant data from the Shopper Products API to determine which specific variant attribute combinations (e.g. size=L, color=red) are orderable. Use the `productId` from each entry in the Shopper Products API `variants` array as the key to look up availability for that variant in this response.",
85
110
  "required": false,
86
111
  "style": "form",
87
112
  "explode": false,
88
113
  "schema": {
89
114
  "type": "array",
115
+ "example": [
116
+ "variations",
117
+ "set_products"
118
+ ],
90
119
  "items": {
91
120
  "type": "string",
92
121
  "enum": [
93
122
  "variations",
94
123
  "set_products"
95
- ]
124
+ ],
125
+ "example": "variations"
96
126
  }
97
- }
127
+ },
128
+ "example": "variations,set_products"
98
129
  },
99
130
  {
100
131
  "name": "sfdc_usid",
101
132
  "in": "header",
133
+ "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.",
102
134
  "required": false,
103
135
  "style": "simple",
104
136
  "explode": false,
105
137
  "schema": {
106
138
  "type": "string",
107
- "format": "uuid"
108
- }
109
- },
110
- {
111
- "name": "sfdc_dw_dnt",
112
- "in": "header",
113
- "required": false,
114
- "style": "simple",
115
- "explode": false,
116
- "schema": {
117
- "type": "string",
118
- "enum": [
119
- "0",
120
- "1"
121
- ]
139
+ "format": "uuid",
140
+ "example": "550e8400-e29b-41d4-a716-446655440000"
122
141
  }
123
142
  },
124
143
  {
125
144
  "name": "personalized",
126
145
  "in": "query",
146
+ "description": "Controls whether personalization is applied to the response. When set to `none`, the server skips applying personalization to the response.",
127
147
  "required": false,
128
148
  "style": "form",
129
149
  "explode": true,
@@ -131,12 +151,14 @@
131
151
  "type": "string",
132
152
  "enum": [
133
153
  "none"
134
- ]
154
+ ],
155
+ "example": "none"
135
156
  }
136
157
  },
137
158
  {
138
159
  "name": "sfdc_shopper_context",
139
160
  "in": "header",
161
+ "description": "Shopper context information (for example clientIP, sourceCode, and customQualifiers)\npassed in from a trusted backend application.",
140
162
  "required": false,
141
163
  "style": "simple",
142
164
  "explode": false,
@@ -152,6 +174,14 @@
152
174
  "application/json": {
153
175
  "schema": {
154
176
  "$ref": "#/components/schemas/AvailabilityResult"
177
+ },
178
+ "examples": {
179
+ "GetAvailabilityResponseExample": {
180
+ "$ref": "#/components/examples/GetAvailabilityResponseExample"
181
+ },
182
+ "GetAvailabilityInventoryListsResponseExample": {
183
+ "$ref": "#/components/examples/GetAvailabilityInventoryListsResponseExample"
184
+ }
155
185
  }
156
186
  }
157
187
  }
@@ -162,6 +192,17 @@
162
192
  "application/problem+json": {
163
193
  "schema": {
164
194
  "$ref": "#/components/schemas/ErrorResponse"
195
+ },
196
+ "examples": {
197
+ "GetAvailabilityBadRequestResponseExample": {
198
+ "$ref": "#/components/examples/GetAvailabilityBadRequestResponseExample"
199
+ },
200
+ "GetAvailabilityInventoryListsBadRequestResponseExample": {
201
+ "$ref": "#/components/examples/GetAvailabilityInventoryListsBadRequestResponseExample"
202
+ },
203
+ "MalformedSelectorResponseExample": {
204
+ "$ref": "#/components/examples/MalformedSelectorResponseExample"
205
+ }
165
206
  }
166
207
  }
167
208
  }
@@ -216,49 +257,70 @@
216
257
  "schemas": {
217
258
  "OrganizationId": {
218
259
  "type": "string",
260
+ "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).",
261
+ "example": "f_ecom_zzxy_prd",
219
262
  "pattern": "^f_ecom_[a-z]{4}_(prd|stg|dev|s[0-9]{2}|[0-9]{3})$"
220
263
  },
221
264
  "ProductId": {
222
265
  "type": "string",
266
+ "description": "The id (SKU) of the product.",
267
+ "example": "apple-ipod-classic",
223
268
  "maxLength": 100,
224
269
  "minLength": 1
225
270
  },
226
271
  "InventoryId": {
227
272
  "type": "string",
273
+ "description": "The inventory ID.",
274
+ "example": "Site1InventoryList",
228
275
  "maxLength": 256,
229
276
  "minLength": 1
230
277
  },
231
278
  "SiteId": {
232
279
  "type": "string",
280
+ "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",
281
+ "example": "RefArch",
233
282
  "maxLength": 32,
234
283
  "minLength": 1
235
284
  },
236
285
  "Inventory": {
237
286
  "type": "object",
287
+ "description": "Document representing inventory information of the current product for a particular inventory list.",
238
288
  "properties": {
239
289
  "ats": {
240
290
  "type": "number",
241
- "format": "double"
291
+ "format": "double",
292
+ "description": "The Available To Sell (ATS) of the product. If it is infinity, the return value is 999999. The value can be overwritten by the\n OCAPI setting 'product.inventory.ats.max_threshold'.",
293
+ "example": 15
242
294
  },
243
295
  "backorderable": {
244
- "type": "boolean"
296
+ "type": "boolean",
297
+ "description": "A flag indicating whether the product is backorderable.",
298
+ "example": true
245
299
  },
246
300
  "id": {
247
301
  "$ref": "#/components/schemas/InventoryId"
248
302
  },
249
303
  "inStockDate": {
250
304
  "type": "string",
251
- "format": "date-time"
305
+ "format": "date-time",
306
+ "description": "A flag indicating the date when the product will be in stock.",
307
+ "example": "9999-12-31T00:00:00Z"
252
308
  },
253
309
  "orderable": {
254
- "type": "boolean"
310
+ "type": "boolean",
311
+ "description": "A flag indicating whether at least one of the products is available to sell.",
312
+ "example": true
255
313
  },
256
314
  "preorderable": {
257
- "type": "boolean"
315
+ "type": "boolean",
316
+ "description": "A flag indicating whether the product is preorderable.",
317
+ "example": false
258
318
  },
259
319
  "stockLevel": {
260
320
  "type": "number",
261
- "format": "double"
321
+ "format": "double",
322
+ "description": "The stock level of the product. If it is infinity, the return value is 999999. The value can be overwritten by the\n OCAPI setting 'product.inventory.stock_level.max_threshold'.",
323
+ "example": 10
262
324
  }
263
325
  },
264
326
  "required": [
@@ -267,12 +329,14 @@
267
329
  },
268
330
  "Availability": {
269
331
  "type": "object",
332
+ "description": "Availability of one product across the requested inventory lists, or the site-assigned default inventory list.",
270
333
  "properties": {
271
334
  "id": {
272
335
  "$ref": "#/components/schemas/ProductId"
273
336
  },
274
337
  "inventories": {
275
338
  "type": "array",
339
+ "description": "The array of inventory information for the product.",
276
340
  "items": {
277
341
  "$ref": "#/components/schemas/Inventory"
278
342
  }
@@ -285,20 +349,26 @@
285
349
  },
286
350
  "AvailabilityResult": {
287
351
  "type": "object",
352
+ "description": "Result document containing an array of product availability.",
288
353
  "properties": {
289
354
  "limit": {
290
355
  "type": "integer",
291
- "format": "int32"
356
+ "format": "int32",
357
+ "description": "The number of returned product entries in the data array.",
358
+ "example": 2
292
359
  },
293
360
  "data": {
294
361
  "type": "array",
362
+ "description": "The array of product availability entries. Each entry represents one product (SKU) with available inventory across the requested inventory lists.",
295
363
  "items": {
296
364
  "$ref": "#/components/schemas/Availability"
297
365
  }
298
366
  },
299
367
  "total": {
300
368
  "type": "integer",
301
- "format": "int32"
369
+ "format": "int32",
370
+ "description": "The total number of distinct product entries in the data array, not individual inventory records.",
371
+ "example": 2
302
372
  }
303
373
  },
304
374
  "required": [
@@ -313,17 +383,25 @@
313
383
  "properties": {
314
384
  "title": {
315
385
  "type": "string",
386
+ "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",
387
+ "example": "You do not have enough credit",
316
388
  "maxLength": 256
317
389
  },
318
390
  "type": {
319
391
  "type": "string",
392
+ "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",
393
+ "example": "NotEnoughMoney",
320
394
  "maxLength": 2048
321
395
  },
322
396
  "detail": {
323
- "type": "string"
397
+ "type": "string",
398
+ "description": "A human-readable explanation specific to this occurrence of the problem.",
399
+ "example": "Your current balance is 30, but that costs 50"
324
400
  },
325
401
  "instance": {
326
402
  "type": "string",
403
+ "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",
404
+ "example": "/account/12345/msgs/abc",
327
405
  "maxLength": 2048
328
406
  }
329
407
  },
@@ -341,6 +419,11 @@
341
419
  "application/problem+json": {
342
420
  "schema": {
343
421
  "$ref": "#/components/schemas/ErrorResponse"
422
+ },
423
+ "examples": {
424
+ "UnauthorizedExample": {
425
+ "$ref": "#/components/examples/UnauthorizedExample"
426
+ }
344
427
  }
345
428
  }
346
429
  }
@@ -350,21 +433,28 @@
350
433
  "organizationId": {
351
434
  "name": "organizationId",
352
435
  "in": "path",
436
+ "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).",
353
437
  "required": true,
354
438
  "style": "simple",
355
439
  "explode": false,
356
440
  "schema": {
357
441
  "$ref": "#/components/schemas/OrganizationId"
358
- }
442
+ },
443
+ "example": "f_ecom_zzxy_prd"
359
444
  },
360
445
  "productIds": {
361
446
  "name": "productIds",
362
447
  "in": "query",
448
+ "description": "The IDs of the requested products (comma-separated, max 24 IDs). If more than 24 IDs are required, split them into multiple parallel requests. Products that are offline or not found are silently filtered from the response.",
363
449
  "required": true,
364
450
  "style": "form",
365
451
  "explode": false,
366
452
  "schema": {
367
453
  "type": "array",
454
+ "example": [
455
+ "apple-ipod-shuffle",
456
+ "apple-ipod-nano"
457
+ ],
368
458
  "items": {
369
459
  "allOf": [
370
460
  {
@@ -374,16 +464,22 @@
374
464
  },
375
465
  "maxItems": 24,
376
466
  "minItems": 1
377
- }
467
+ },
468
+ "example": "apple-ipod-shuffle,apple-ipod-nano"
378
469
  },
379
470
  "inventoryIds": {
380
471
  "name": "inventoryIds",
381
472
  "in": "query",
473
+ "description": "The inventory list IDs for which the availability should be shown (comma-separated, max 5 inventory list IDs). If omitted, availability is returned from the site-assigned default inventory list. If provided, availability is returned only from the specified inventory lists.",
382
474
  "required": false,
383
475
  "style": "form",
384
476
  "explode": false,
385
477
  "schema": {
386
478
  "type": "array",
479
+ "example": [
480
+ "Site1InventoryList",
481
+ "Site2InventoryList"
482
+ ],
387
483
  "items": {
388
484
  "allOf": [
389
485
  {
@@ -393,63 +489,66 @@
393
489
  },
394
490
  "maxItems": 5,
395
491
  "minItems": 1
396
- }
492
+ },
493
+ "example": "Site1InventoryList,Site2InventoryList"
397
494
  },
398
495
  "siteId": {
399
496
  "name": "siteId",
400
497
  "in": "query",
498
+ "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.",
401
499
  "required": true,
402
500
  "style": "form",
403
501
  "explode": true,
404
502
  "schema": {
405
503
  "$ref": "#/components/schemas/SiteId"
504
+ },
505
+ "examples": {
506
+ "SiteId": {
507
+ "value": "RefArch"
508
+ }
406
509
  }
407
510
  },
408
511
  "expand": {
409
512
  "name": "expand",
410
513
  "in": "query",
514
+ "description": "Expand the response to include availability for related products. When `variations` is specified, availability for all variation products of a master product is included. When `set_products` is specified, availability for all products in a product set is included. The parent product's availability is always included alongside the expanded entries. Expansion is single-level only: if a variation is itself a product set, its set products are not further expanded. Other product types (bundles, bundled items, set items) are not expanded. Expanded results are returned flat at the top level of the response array, not nested below their parent product.\n**Note:** When using `expand=variations`, combine this response with variant data from the Shopper Products API to determine which specific variant attribute combinations (e.g. size=L, color=red) are orderable. Use the `productId` from each entry in the Shopper Products API `variants` array as the key to look up availability for that variant in this response.",
411
515
  "required": false,
412
516
  "style": "form",
413
517
  "explode": false,
414
518
  "schema": {
415
519
  "type": "array",
520
+ "example": [
521
+ "variations",
522
+ "set_products"
523
+ ],
416
524
  "items": {
417
525
  "type": "string",
418
526
  "enum": [
419
527
  "variations",
420
528
  "set_products"
421
- ]
529
+ ],
530
+ "example": "variations"
422
531
  }
423
- }
532
+ },
533
+ "example": "variations,set_products"
424
534
  },
425
535
  "sfdcUsid": {
426
536
  "name": "sfdc_usid",
427
537
  "in": "header",
538
+ "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.",
428
539
  "required": false,
429
540
  "style": "simple",
430
541
  "explode": false,
431
542
  "schema": {
432
543
  "type": "string",
433
- "format": "uuid"
434
- }
435
- },
436
- "sfdcDwDnt": {
437
- "name": "sfdc_dw_dnt",
438
- "in": "header",
439
- "required": false,
440
- "style": "simple",
441
- "explode": false,
442
- "schema": {
443
- "type": "string",
444
- "enum": [
445
- "0",
446
- "1"
447
- ]
544
+ "format": "uuid",
545
+ "example": "550e8400-e29b-41d4-a716-446655440000"
448
546
  }
449
547
  },
450
548
  "personalized": {
451
549
  "name": "personalized",
452
550
  "in": "query",
551
+ "description": "Controls whether personalization is applied to the response. When set to `none`, the server skips applying personalization to the response.",
453
552
  "required": false,
454
553
  "style": "form",
455
554
  "explode": true,
@@ -457,12 +556,14 @@
457
556
  "type": "string",
458
557
  "enum": [
459
558
  "none"
460
- ]
559
+ ],
560
+ "example": "none"
461
561
  }
462
562
  },
463
563
  "sfdcShopperContext": {
464
564
  "name": "sfdc_shopper_context",
465
565
  "in": "header",
566
+ "description": "Shopper context information (for example clientIP, sourceCode, and customQualifiers)\npassed in from a trusted backend application.",
466
567
  "required": false,
467
568
  "style": "simple",
468
569
  "explode": false,
@@ -471,9 +572,121 @@
471
572
  }
472
573
  }
473
574
  },
575
+ "examples": {
576
+ "GetAvailabilityResponseExample": {
577
+ "value": {
578
+ "data": [
579
+ {
580
+ "id": "poodle-collar",
581
+ "inventories": [
582
+ {
583
+ "ats": 100,
584
+ "backorderable": false,
585
+ "id": "site-default-inventory",
586
+ "inStockDate": "2026-06-15T00:00:00.0Z",
587
+ "orderable": true,
588
+ "preorderable": false,
589
+ "stockLevel": 90
590
+ }
591
+ ]
592
+ },
593
+ {
594
+ "id": "poodle-coat",
595
+ "inventories": [
596
+ {
597
+ "id": "site-default-inventory"
598
+ }
599
+ ]
600
+ }
601
+ ],
602
+ "limit": 2,
603
+ "total": 2
604
+ }
605
+ },
606
+ "GetAvailabilityInventoryListsResponseExample": {
607
+ "value": {
608
+ "data": [
609
+ {
610
+ "id": "poodle-collar",
611
+ "inventories": [
612
+ {
613
+ "ats": 100,
614
+ "backorderable": false,
615
+ "id": "inventory1",
616
+ "orderable": true,
617
+ "preorderable": false,
618
+ "stockLevel": 90
619
+ },
620
+ {
621
+ "ats": 5,
622
+ "backorderable": false,
623
+ "id": "inventory2",
624
+ "orderable": true,
625
+ "preorderable": true,
626
+ "stockLevel": 5
627
+ }
628
+ ]
629
+ },
630
+ {
631
+ "id": "poodle-coat",
632
+ "inventories": [
633
+ {
634
+ "ats": 7100,
635
+ "backorderable": false,
636
+ "id": "inventory1",
637
+ "orderable": true,
638
+ "preorderable": false,
639
+ "stockLevel": 7090
640
+ },
641
+ {
642
+ "ats": 15,
643
+ "backorderable": false,
644
+ "id": "inventory2",
645
+ "orderable": true,
646
+ "preorderable": true,
647
+ "stockLevel": 15
648
+ }
649
+ ]
650
+ }
651
+ ],
652
+ "limit": 2,
653
+ "total": 2
654
+ }
655
+ },
656
+ "GetAvailabilityBadRequestResponseExample": {
657
+ "value": {
658
+ "title": "Bad Request",
659
+ "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/validation",
660
+ "detail": "Maximum number of product IDs you can request in one call is 24."
661
+ }
662
+ },
663
+ "GetAvailabilityInventoryListsBadRequestResponseExample": {
664
+ "value": {
665
+ "title": "Bad Request",
666
+ "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/validation",
667
+ "detail": "Maximum number of inventory list IDs you can request in one call is 5."
668
+ }
669
+ },
670
+ "MalformedSelectorResponseExample": {
671
+ "value": {
672
+ "title": "Malformed Selector",
673
+ "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/malformed-selector",
674
+ "detail": "The property selector '(data.(id, inventories.(**))' is malformed.",
675
+ "selector": "(data.(id, inventories.(**))"
676
+ }
677
+ },
678
+ "UnauthorizedExample": {
679
+ "value": {
680
+ "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/unauthorized",
681
+ "title": "Unauthorized",
682
+ "detail": "Unauthorized request"
683
+ }
684
+ }
685
+ },
474
686
  "securitySchemes": {
475
687
  "ShopperToken": {
476
688
  "type": "oauth2",
689
+ "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",
477
690
  "flows": {
478
691
  "clientCredentials": {
479
692
  "tokenUrl": "https://{shortCode}.api.commercecloud.salesforce.com/shopper/auth/v1/organizations/{organizationId}/oauth2/token",
@@ -494,6 +707,7 @@
494
707
  },
495
708
  "ShopperClientContextToken": {
496
709
  "type": "oauth2",
710
+ "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",
497
711
  "flows": {
498
712
  "clientCredentials": {
499
713
  "tokenUrl": "https://{shortCode}.api.commercecloud.salesforce.com/shopper/auth/v1/organizations/{organizationId}/oauth2/token?hint=client_context",