@salesforce/b2c-cli 2.3.1 → 2.4.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 (415) hide show
  1. package/bin/dev.js +8 -8
  2. package/bin/run.js +5 -7
  3. package/content/guidance/b2c/b2c-business-manager-extensions/SKILL.md +361 -0
  4. package/content/guidance/b2c/b2c-business-manager-extensions/references/EXTENSIONS-XML.md +458 -0
  5. package/content/guidance/b2c/b2c-controllers/SKILL.md +301 -0
  6. package/content/guidance/b2c/b2c-controllers/references/CLASSIC-PATTERNS.md +335 -0
  7. package/content/guidance/b2c/b2c-controllers/references/SFRA-PATTERNS.md +400 -0
  8. package/content/guidance/b2c/b2c-custom-api-development/SKILL.md +281 -0
  9. package/content/guidance/b2c/b2c-custom-api-development/references/CONTRACT.md +142 -0
  10. package/content/guidance/b2c/b2c-custom-api-development/references/IMPLEMENTATION.md +153 -0
  11. package/content/guidance/b2c/b2c-custom-api-development/references/TESTING.md +118 -0
  12. package/content/guidance/b2c/b2c-custom-caches/SKILL.md +279 -0
  13. package/content/guidance/b2c/b2c-custom-job-steps/SKILL.md +520 -0
  14. package/content/guidance/b2c/b2c-custom-job-steps/references/CHUNK-ORIENTED.md +377 -0
  15. package/content/guidance/b2c/b2c-custom-job-steps/references/JOBS-XML.md +212 -0
  16. package/content/guidance/b2c/b2c-custom-job-steps/references/STEPTYPES-JSON.md +373 -0
  17. package/content/guidance/b2c/b2c-custom-job-steps/references/TASK-ORIENTED.md +344 -0
  18. package/content/guidance/b2c/b2c-custom-objects/SKILL.md +327 -0
  19. package/content/guidance/b2c/b2c-custom-objects/references/OCAPI-SEARCH.md +298 -0
  20. package/content/guidance/b2c/b2c-forms/SKILL.md +242 -0
  21. package/content/guidance/b2c/b2c-forms/references/FORM-XML.md +409 -0
  22. package/content/guidance/b2c/b2c-hooks/SKILL.md +500 -0
  23. package/content/guidance/b2c/b2c-hooks/references/OCAPI-SCAPI-HOOKS.md +403 -0
  24. package/content/guidance/b2c/b2c-hooks/references/ORDER-HOOK-LIFECYCLE.md +169 -0
  25. package/content/guidance/b2c/b2c-hooks/references/SYSTEM-HOOKS.md +433 -0
  26. package/content/guidance/b2c/b2c-isml/SKILL.md +320 -0
  27. package/content/guidance/b2c/b2c-isml/references/EXPRESSIONS.md +366 -0
  28. package/content/guidance/b2c/b2c-isml/references/TAGS.md +443 -0
  29. package/content/guidance/b2c/b2c-localization/SKILL.md +344 -0
  30. package/content/guidance/b2c/b2c-localization/references/PATTERNS.md +407 -0
  31. package/content/guidance/b2c/b2c-logging/SKILL.md +352 -0
  32. package/content/guidance/b2c/b2c-logging/references/LOG-FILES.md +282 -0
  33. package/content/guidance/b2c/b2c-metadata/SKILL.md +406 -0
  34. package/content/guidance/b2c/b2c-metadata/references/SYSTEM-OBJECTS.md +320 -0
  35. package/content/guidance/b2c/b2c-metadata/references/XML-EXAMPLES.md +366 -0
  36. package/content/guidance/b2c/b2c-onboarding/SKILL.md +154 -0
  37. package/content/guidance/b2c/b2c-ordering/SKILL.md +391 -0
  38. package/content/guidance/b2c/b2c-page-designer/SKILL.md +410 -0
  39. package/content/guidance/b2c/b2c-page-designer/references/ATTRIBUTE-TYPES.md +436 -0
  40. package/content/guidance/b2c/b2c-page-designer/references/META-DEFINITIONS.md +340 -0
  41. package/content/guidance/b2c/b2c-querying-data/SKILL.md +289 -0
  42. package/content/guidance/b2c/b2c-querying-data/references/PERFORMANCE-APIS.md +74 -0
  43. package/content/guidance/b2c/b2c-scapi-admin/SKILL.md +53 -0
  44. package/content/guidance/b2c/b2c-scapi-admin/references/CLIENT-EXAMPLES.md +440 -0
  45. package/content/guidance/b2c/b2c-scapi-admin/references/INTEGRATION-PATTERNS.md +518 -0
  46. package/content/guidance/b2c/b2c-scapi-admin/references/OAUTH-SCOPES.md +337 -0
  47. package/content/guidance/b2c/b2c-scapi-shopper/SKILL.md +56 -0
  48. package/content/guidance/b2c/b2c-scapi-shopper/references/CHECKOUT-FLOW.md +466 -0
  49. package/content/guidance/b2c/b2c-scapi-shopper/references/CLIENT-EXAMPLES.md +351 -0
  50. package/content/guidance/b2c/b2c-scapi-shopper/references/COMMON-PATTERNS.md +390 -0
  51. package/content/guidance/b2c/b2c-scapi-shopper/references/SCOPES.md +290 -0
  52. package/content/guidance/b2c/b2c-slas-auth-patterns/SKILL.md +420 -0
  53. package/content/guidance/b2c/b2c-slas-auth-patterns/references/PASSKEYS.md +126 -0
  54. package/content/guidance/b2c/b2c-slas-auth-patterns/references/SESSION-BRIDGE.md +267 -0
  55. package/content/guidance/b2c/b2c-slas-auth-patterns/references/TOKEN-LIFECYCLE.md +367 -0
  56. package/content/guidance/b2c/b2c-webservices/SKILL.md +318 -0
  57. package/content/guidance/b2c/b2c-webservices/references/FTP-SERVICES.md +524 -0
  58. package/content/guidance/b2c/b2c-webservices/references/HTTP-SERVICES.md +578 -0
  59. package/content/guidance/b2c/b2c-webservices/references/SERVICES-XML.md +351 -0
  60. package/content/guidance/b2c/b2c-webservices/references/SOAP-SERVICES.md +587 -0
  61. package/content/guidance/b2c-cli/b2c-am/SKILL.md +277 -0
  62. package/content/guidance/b2c-cli/b2c-bm-users-roles/SKILL.md +210 -0
  63. package/content/guidance/b2c-cli/b2c-cap/SKILL.md +131 -0
  64. package/content/guidance/b2c-cli/b2c-cip/SKILL.md +116 -0
  65. package/content/guidance/b2c-cli/b2c-cip/references/KNOWN_TABLES.md +105 -0
  66. package/content/guidance/b2c-cli/b2c-cip/references/SALES_ANALYSIS.md +50 -0
  67. package/content/guidance/b2c-cli/b2c-cip/references/STARTER_QUERIES.md +147 -0
  68. package/content/guidance/b2c-cli/b2c-code/SKILL.md +146 -0
  69. package/content/guidance/b2c-cli/b2c-config/SKILL.md +462 -0
  70. package/content/guidance/b2c-cli/b2c-content/SKILL.md +176 -0
  71. package/content/guidance/b2c-cli/b2c-debug/SKILL.md +138 -0
  72. package/content/guidance/b2c-cli/b2c-docs/SKILL.md +301 -0
  73. package/content/guidance/b2c-cli/b2c-ecdn/SKILL.md +135 -0
  74. package/content/guidance/b2c-cli/b2c-ecdn/references/ADVANCED.md +97 -0
  75. package/content/guidance/b2c-cli/b2c-ecdn/references/SECURITY.md +75 -0
  76. package/content/guidance/b2c-cli/b2c-import-set-migrations/SKILL.md +265 -0
  77. package/content/guidance/b2c-cli/b2c-job/SKILL.md +64 -0
  78. package/content/guidance/b2c-cli/b2c-job/references/EXPORT.md +121 -0
  79. package/content/guidance/b2c-cli/b2c-job/references/IMPORT.md +55 -0
  80. package/content/guidance/b2c-cli/b2c-job/references/RUN-AND-MONITOR.md +119 -0
  81. package/content/guidance/b2c-cli/b2c-logs/SKILL.md +249 -0
  82. package/content/guidance/b2c-cli/b2c-metrics/SKILL.md +315 -0
  83. package/content/guidance/b2c-cli/b2c-mrt/SKILL.md +207 -0
  84. package/content/guidance/b2c-cli/b2c-mrt/references/BUNDLE-COMMANDS.md +203 -0
  85. package/content/guidance/b2c-cli/b2c-mrt/references/ENVIRONMENT-COMMANDS.md +218 -0
  86. package/content/guidance/b2c-cli/b2c-mrt/references/PROJECT-COMMANDS.md +154 -0
  87. package/content/guidance/b2c-cli/b2c-sandbox/SKILL.md +112 -0
  88. package/content/guidance/b2c-cli/b2c-scapi-custom/SKILL.md +126 -0
  89. package/content/guidance/b2c-cli/b2c-scapi-schemas/SKILL.md +66 -0
  90. package/content/guidance/b2c-cli/b2c-scapi-schemas/references/CLI-EXAMPLES.md +108 -0
  91. package/content/guidance/b2c-cli/b2c-site-import-export/SKILL.md +57 -0
  92. package/content/guidance/b2c-cli/b2c-site-import-export/references/IMPORT-OPTIONS.md +118 -0
  93. package/content/guidance/b2c-cli/b2c-site-import-export/references/METADATA-XML.md +381 -0
  94. package/content/guidance/b2c-cli/b2c-site-import-export/references/WORKFLOWS.md +182 -0
  95. package/content/guidance/b2c-cli/b2c-sites/SKILL.md +112 -0
  96. package/content/guidance/b2c-cli/b2c-slas/SKILL.md +182 -0
  97. package/content/guidance/b2c-cli/b2c-webdav/SKILL.md +186 -0
  98. package/content/guidance/b2c-ops/b2c-checkout-triage/SKILL.md +68 -0
  99. package/content/guidance/b2c-ops/b2c-job-health/SKILL.md +75 -0
  100. package/content/guidance/b2c-ops/b2c-job-health/references/job-logs.md +21 -0
  101. package/content/guidance/b2c-ops/b2c-order-failure-triage/SKILL.md +66 -0
  102. package/content/guidance/b2c-ops/b2c-order-failure-triage/references/order-evidence.md +87 -0
  103. package/content/guidance/b2c-ops/b2c-production-triage/SKILL.md +87 -0
  104. package/content/guidance/b2c-ops/b2c-production-triage/references/escalation.md +57 -0
  105. package/content/guidance/index.json +1949 -0
  106. package/content/guidance/storefront-next/sfnext-accessibility/SKILL.md +103 -0
  107. package/content/guidance/storefront-next/sfnext-accessibility/references/checklist.md +64 -0
  108. package/content/guidance/storefront-next/sfnext-analytics-consent/SKILL.md +91 -0
  109. package/content/guidance/storefront-next/sfnext-analytics-consent/references/CUSTOM-ADAPTER.md +49 -0
  110. package/content/guidance/storefront-next/sfnext-authentication/SKILL.md +127 -0
  111. package/content/guidance/storefront-next/sfnext-authentication/references/COOKIES.md +39 -0
  112. package/content/guidance/storefront-next/sfnext-authentication/references/LOGIN-FLOWS.md +59 -0
  113. package/content/guidance/storefront-next/sfnext-commerce-features/SKILL.md +67 -0
  114. package/content/guidance/storefront-next/sfnext-commerce-features/references/FEATURE-PREREQUISITES.md +37 -0
  115. package/content/guidance/storefront-next/sfnext-components/SKILL.md +153 -0
  116. package/content/guidance/storefront-next/sfnext-components/references/COMPONENT-AUTHORING.md +118 -0
  117. package/content/guidance/storefront-next/sfnext-components/references/SHAPE-TOKENS.md +51 -0
  118. package/content/guidance/storefront-next/sfnext-components/references/STORYBOOK.md +54 -0
  119. package/content/guidance/storefront-next/sfnext-components/references/TOKEN-SYSTEM.md +53 -0
  120. package/content/guidance/storefront-next/sfnext-components/references/TROUBLESHOOTING.md +19 -0
  121. package/content/guidance/storefront-next/sfnext-configuration/SKILL.md +163 -0
  122. package/content/guidance/storefront-next/sfnext-configuration/references/ENV-VARIABLES.md +55 -0
  123. package/content/guidance/storefront-next/sfnext-configuration/references/MULTI-SITE-URLS.md +137 -0
  124. package/content/guidance/storefront-next/sfnext-data-fetching/SKILL.md +140 -0
  125. package/content/guidance/storefront-next/sfnext-data-fetching/references/ACTIONS.md +53 -0
  126. package/content/guidance/storefront-next/sfnext-data-fetching/references/API-CLIENTS.md +34 -0
  127. package/content/guidance/storefront-next/sfnext-data-fetching/references/LOADERS.md +73 -0
  128. package/content/guidance/storefront-next/sfnext-data-fetching/references/SCAPI-FETCHER.md +39 -0
  129. package/content/guidance/storefront-next/sfnext-deployment/SKILL.md +127 -0
  130. package/content/guidance/storefront-next/sfnext-deployment/references/MRT-DEPLOYMENT.md +59 -0
  131. package/content/guidance/storefront-next/sfnext-extensions/SKILL.md +118 -0
  132. package/content/guidance/storefront-next/sfnext-extensions/references/ACTION-HOOKS.md +57 -0
  133. package/content/guidance/storefront-next/sfnext-extensions/references/BASE-AUDIT.md +68 -0
  134. package/content/guidance/storefront-next/sfnext-extensions/references/CLI-AND-INSTALL.md +58 -0
  135. package/content/guidance/storefront-next/sfnext-extensions/references/EXTENSION-EXAMPLES.md +79 -0
  136. package/content/guidance/storefront-next/sfnext-hybrid-storefronts/SKILL.md +93 -0
  137. package/content/guidance/storefront-next/sfnext-hybrid-storefronts/references/HYBRID-PROXY-CONFIG.md +86 -0
  138. package/content/guidance/storefront-next/sfnext-i18n/SKILL.md +152 -0
  139. package/content/guidance/storefront-next/sfnext-i18n/references/locale-config.md +35 -0
  140. package/content/guidance/storefront-next/sfnext-overview/SKILL.md +101 -0
  141. package/content/guidance/storefront-next/sfnext-page-designer/SKILL.md +202 -0
  142. package/content/guidance/storefront-next/sfnext-page-designer/references/BUSINESS-MANAGER.md +46 -0
  143. package/content/guidance/storefront-next/sfnext-page-designer/references/COMPONENT-REGISTRY.md +111 -0
  144. package/content/guidance/storefront-next/sfnext-page-designer/references/DECORATOR-PATTERNS.md +168 -0
  145. package/content/guidance/storefront-next/sfnext-page-designer/references/REVIEW-CHECKLIST.md +83 -0
  146. package/content/guidance/storefront-next/sfnext-page-designer/references/TROUBLESHOOTING.md +35 -0
  147. package/content/guidance/storefront-next/sfnext-performance/SKILL.md +102 -0
  148. package/content/guidance/storefront-next/sfnext-performance/references/PERFORMANCE-REVIEW-CHECKLIST.md +85 -0
  149. package/content/guidance/storefront-next/sfnext-performance/references/SUSPENSE-AND-STREAMING.md +58 -0
  150. package/content/guidance/storefront-next/sfnext-project-setup/SKILL.md +147 -0
  151. package/content/guidance/storefront-next/sfnext-project-setup/references/PROJECT-STRUCTURE.md +61 -0
  152. package/content/guidance/storefront-next/sfnext-project-setup/references/SCRIPTS.md +47 -0
  153. package/content/guidance/storefront-next/sfnext-project-setup/references/SFNEXT-CLI.md +63 -0
  154. package/content/guidance/storefront-next/sfnext-quality-gates/SKILL.md +70 -0
  155. package/content/guidance/storefront-next/sfnext-quality-gates/references/lint-and-budgets.md +39 -0
  156. package/content/guidance/storefront-next/sfnext-revalidation/SKILL.md +121 -0
  157. package/content/guidance/storefront-next/sfnext-revalidation/references/POLICIES-AND-TAGS.md +55 -0
  158. package/content/guidance/storefront-next/sfnext-routing/SKILL.md +123 -0
  159. package/content/guidance/storefront-next/sfnext-routing/references/ROUTE-CONVENTIONS.md +65 -0
  160. package/content/guidance/storefront-next/sfnext-routing/references/URLS-AND-SEO-ROUTES.md +22 -0
  161. package/content/guidance/storefront-next/sfnext-scapi/SKILL.md +126 -0
  162. package/content/guidance/storefront-next/sfnext-scapi/references/WORKED-EXAMPLE.md +39 -0
  163. package/content/guidance/storefront-next/sfnext-security/SKILL.md +129 -0
  164. package/content/guidance/storefront-next/sfnext-security/references/COOKIE-DOMAIN.md +39 -0
  165. package/content/guidance/storefront-next/sfnext-security/references/TURNSTILE.md +43 -0
  166. package/content/guidance/storefront-next/sfnext-seo/SKILL.md +95 -0
  167. package/content/guidance/storefront-next/sfnext-seo/references/MULTI-DOMAIN-BASE-PATH.md +17 -0
  168. package/content/guidance/storefront-next/sfnext-seo/references/SEO-ROUTES.md +31 -0
  169. package/content/guidance/storefront-next/sfnext-state-management/SKILL.md +114 -0
  170. package/content/guidance/storefront-next/sfnext-state-management/references/PATTERNS.md +45 -0
  171. package/content/guidance/storefront-next/sfnext-testing/SKILL.md +151 -0
  172. package/content/guidance/storefront-next/sfnext-testing/references/E2E.md +38 -0
  173. package/content/guidance/storefront-next/sfnext-testing/references/STORYBOOK-PATTERNS.md +97 -0
  174. package/content/guidance/storefront-next/sfnext-testing/references/UNIT-AND-ROUTE-TESTS.md +60 -0
  175. package/content/guidance/storefront-next/sfnext-theming/SKILL.md +104 -0
  176. package/content/guidance/storefront-next/sfnext-theming/references/REBRAND-CHECKLIST.md +29 -0
  177. package/dist/commands/cap/install.d.ts +1 -0
  178. package/dist/commands/cap/list.d.ts +1 -0
  179. package/dist/commands/cap/pull.d.ts +1 -0
  180. package/dist/commands/cap/tasks.d.ts +1 -0
  181. package/dist/commands/cap/uninstall.d.ts +1 -0
  182. package/dist/commands/cip/describe.d.ts +1 -0
  183. package/dist/commands/cip/query.d.ts +1 -0
  184. package/dist/commands/cip/report/bot-traffic-share.d.ts +1 -0
  185. package/dist/commands/cip/report/checkout-funnel-dropoff.d.ts +1 -0
  186. package/dist/commands/cip/report/controller-error-rate-trend.d.ts +1 -0
  187. package/dist/commands/cip/report/controller-health-scorecard.d.ts +1 -0
  188. package/dist/commands/cip/report/customer-registration-trends.d.ts +1 -0
  189. package/dist/commands/cip/report/discount-depth-breakdown.d.ts +1 -0
  190. package/dist/commands/cip/report/inventory-stockout-by-location.d.ts +1 -0
  191. package/dist/commands/cip/report/new-vs-returning-buyer-revenue.d.ts +1 -0
  192. package/dist/commands/cip/report/ocapi-client-usage.d.ts +1 -0
  193. package/dist/commands/cip/report/ocapi-requests.d.ts +1 -0
  194. package/dist/commands/cip/report/payment-method-performance.d.ts +1 -0
  195. package/dist/commands/cip/report/product-co-purchase-analysis.d.ts +1 -0
  196. package/dist/commands/cip/report/promotion-discount-analysis.d.ts +1 -0
  197. package/dist/commands/cip/report/promotion-roi-leaderboard.d.ts +1 -0
  198. package/dist/commands/cip/report/recommender-effectiveness.d.ts +1 -0
  199. package/dist/commands/cip/report/remote-include-performance.d.ts +1 -0
  200. package/dist/commands/cip/report/revenue-by-channel.d.ts +1 -0
  201. package/dist/commands/cip/report/sales-analytics.d.ts +1 -0
  202. package/dist/commands/cip/report/sales-summary.d.ts +1 -0
  203. package/dist/commands/cip/report/scapi-cache-hit-ratio.d.ts +1 -0
  204. package/dist/commands/cip/report/scapi-error-rate-by-status.d.ts +1 -0
  205. package/dist/commands/cip/report/scapi-latency-distribution.d.ts +1 -0
  206. package/dist/commands/cip/report/scapi-traffic-latency.d.ts +1 -0
  207. package/dist/commands/cip/report/search-query-performance.d.ts +1 -0
  208. package/dist/commands/cip/report/top-referrers.d.ts +1 -0
  209. package/dist/commands/cip/report/top-selling-products.d.ts +1 -0
  210. package/dist/commands/cip/report/zero-result-searches.d.ts +1 -0
  211. package/dist/commands/cip/tables.d.ts +1 -0
  212. package/dist/commands/code/activate.d.ts +1 -0
  213. package/dist/commands/code/delete.d.ts +1 -0
  214. package/dist/commands/code/deploy.d.ts +1 -0
  215. package/dist/commands/code/download.d.ts +1 -0
  216. package/dist/commands/code/watch.d.ts +1 -0
  217. package/dist/commands/commands/search.d.ts +35 -0
  218. package/dist/commands/commands/search.js +85 -0
  219. package/dist/commands/commands/search.js.map +1 -0
  220. package/dist/commands/content/export.d.ts +1 -0
  221. package/dist/commands/content/list.d.ts +1 -0
  222. package/dist/commands/content/validate.d.ts +1 -0
  223. package/dist/commands/debug/cli.d.ts +1 -0
  224. package/dist/commands/debug/index.d.ts +1 -0
  225. package/dist/commands/docs/cache.d.ts +1 -0
  226. package/dist/commands/docs/download.d.ts +1 -0
  227. package/dist/commands/docs/read.d.ts +1 -0
  228. package/dist/commands/docs/schema.d.ts +1 -0
  229. package/dist/commands/docs/search.d.ts +1 -0
  230. package/dist/commands/docs/skill.d.ts +41 -0
  231. package/dist/commands/docs/skill.js +183 -0
  232. package/dist/commands/docs/skill.js.map +1 -0
  233. package/dist/commands/ecdn/cache/purge.d.ts +1 -0
  234. package/dist/commands/ecdn/certificates/add.d.ts +1 -0
  235. package/dist/commands/ecdn/certificates/delete.d.ts +1 -0
  236. package/dist/commands/ecdn/certificates/list.d.ts +1 -0
  237. package/dist/commands/ecdn/certificates/update.d.ts +1 -0
  238. package/dist/commands/ecdn/certificates/validate.d.ts +1 -0
  239. package/dist/commands/ecdn/cipher-suites/get.d.ts +1 -0
  240. package/dist/commands/ecdn/cipher-suites/update.d.ts +1 -0
  241. package/dist/commands/ecdn/firewall/create.d.ts +1 -0
  242. package/dist/commands/ecdn/firewall/delete.d.ts +1 -0
  243. package/dist/commands/ecdn/firewall/get.d.ts +1 -0
  244. package/dist/commands/ecdn/firewall/list.d.ts +1 -0
  245. package/dist/commands/ecdn/firewall/reorder.d.ts +1 -0
  246. package/dist/commands/ecdn/firewall/update.d.ts +1 -0
  247. package/dist/commands/ecdn/logpush/jobs/create.d.ts +1 -0
  248. package/dist/commands/ecdn/logpush/jobs/delete.d.ts +1 -0
  249. package/dist/commands/ecdn/logpush/jobs/get.d.ts +1 -0
  250. package/dist/commands/ecdn/logpush/jobs/list.d.ts +1 -0
  251. package/dist/commands/ecdn/logpush/jobs/update.d.ts +1 -0
  252. package/dist/commands/ecdn/logpush/ownership.d.ts +1 -0
  253. package/dist/commands/ecdn/mrt-rules/create.d.ts +1 -0
  254. package/dist/commands/ecdn/mrt-rules/delete.d.ts +1 -0
  255. package/dist/commands/ecdn/mrt-rules/get.d.ts +1 -0
  256. package/dist/commands/ecdn/mrt-rules/rules/delete.d.ts +1 -0
  257. package/dist/commands/ecdn/mrt-rules/rules/update.d.ts +1 -0
  258. package/dist/commands/ecdn/mrt-rules/update.d.ts +1 -0
  259. package/dist/commands/ecdn/mtls/create.d.ts +1 -0
  260. package/dist/commands/ecdn/mtls/delete.d.ts +1 -0
  261. package/dist/commands/ecdn/mtls/get.d.ts +1 -0
  262. package/dist/commands/ecdn/mtls/issue.d.ts +1 -0
  263. package/dist/commands/ecdn/mtls/list.d.ts +1 -0
  264. package/dist/commands/ecdn/mtls/setup.d.ts +1 -0
  265. package/dist/commands/ecdn/origin-headers/delete.d.ts +1 -0
  266. package/dist/commands/ecdn/origin-headers/get.d.ts +1 -0
  267. package/dist/commands/ecdn/origin-headers/set.d.ts +1 -0
  268. package/dist/commands/ecdn/page-shield/notifications/create.d.ts +1 -0
  269. package/dist/commands/ecdn/page-shield/notifications/delete.d.ts +1 -0
  270. package/dist/commands/ecdn/page-shield/notifications/list.d.ts +1 -0
  271. package/dist/commands/ecdn/page-shield/policies/create.d.ts +1 -0
  272. package/dist/commands/ecdn/page-shield/policies/delete.d.ts +1 -0
  273. package/dist/commands/ecdn/page-shield/policies/get.d.ts +1 -0
  274. package/dist/commands/ecdn/page-shield/policies/list.d.ts +1 -0
  275. package/dist/commands/ecdn/page-shield/policies/update.d.ts +1 -0
  276. package/dist/commands/ecdn/page-shield/scripts/get.d.ts +1 -0
  277. package/dist/commands/ecdn/page-shield/scripts/list.d.ts +1 -0
  278. package/dist/commands/ecdn/rate-limit/create.d.ts +1 -0
  279. package/dist/commands/ecdn/rate-limit/delete.d.ts +1 -0
  280. package/dist/commands/ecdn/rate-limit/get.d.ts +1 -0
  281. package/dist/commands/ecdn/rate-limit/list.d.ts +1 -0
  282. package/dist/commands/ecdn/rate-limit/update.d.ts +1 -0
  283. package/dist/commands/ecdn/security/get.d.ts +1 -0
  284. package/dist/commands/ecdn/security/update.d.ts +1 -0
  285. package/dist/commands/ecdn/speed/get.d.ts +1 -0
  286. package/dist/commands/ecdn/speed/update.d.ts +1 -0
  287. package/dist/commands/ecdn/waf/groups/list.d.ts +1 -0
  288. package/dist/commands/ecdn/waf/groups/update.d.ts +1 -0
  289. package/dist/commands/ecdn/waf/managed-rules/list.d.ts +1 -0
  290. package/dist/commands/ecdn/waf/managed-rules/update.d.ts +1 -0
  291. package/dist/commands/ecdn/waf/migrate.d.ts +1 -0
  292. package/dist/commands/ecdn/waf/owasp/get.d.ts +1 -0
  293. package/dist/commands/ecdn/waf/owasp/update.d.ts +1 -0
  294. package/dist/commands/ecdn/waf/rules/get.d.ts +1 -0
  295. package/dist/commands/ecdn/waf/rules/list.d.ts +1 -0
  296. package/dist/commands/ecdn/waf/rules/update.d.ts +1 -0
  297. package/dist/commands/ecdn/waf/rulesets/list.d.ts +1 -0
  298. package/dist/commands/ecdn/waf/rulesets/update.d.ts +1 -0
  299. package/dist/commands/ecdn/zones/create.d.ts +1 -0
  300. package/dist/commands/ecdn/zones/list.d.ts +1 -0
  301. package/dist/commands/job/execution/delete.d.ts +1 -0
  302. package/dist/commands/job/export.d.ts +1 -0
  303. package/dist/commands/job/import-set.d.ts +1 -0
  304. package/dist/commands/job/import.d.ts +1 -0
  305. package/dist/commands/job/log.d.ts +1 -0
  306. package/dist/commands/job/run.d.ts +1 -0
  307. package/dist/commands/job/search.d.ts +1 -0
  308. package/dist/commands/job/wait.d.ts +1 -0
  309. package/dist/commands/logs/get.d.ts +1 -0
  310. package/dist/commands/logs/list.d.ts +1 -0
  311. package/dist/commands/logs/tail.d.ts +1 -0
  312. package/dist/commands/metrics/controller.d.ts +1 -0
  313. package/dist/commands/metrics/ecdn.d.ts +1 -0
  314. package/dist/commands/metrics/mrt.d.ts +1 -0
  315. package/dist/commands/metrics/ocapi.d.ts +1 -0
  316. package/dist/commands/metrics/overall.d.ts +1 -0
  317. package/dist/commands/metrics/sales.d.ts +1 -0
  318. package/dist/commands/metrics/scapi-hooks.d.ts +1 -0
  319. package/dist/commands/metrics/scapi.d.ts +1 -0
  320. package/dist/commands/metrics/third-party.d.ts +1 -0
  321. package/dist/commands/mrt/bundle/delete.d.ts +1 -0
  322. package/dist/commands/mrt/bundle/deploy.d.ts +1 -0
  323. package/dist/commands/mrt/bundle/download.d.ts +1 -0
  324. package/dist/commands/mrt/bundle/history.d.ts +1 -0
  325. package/dist/commands/mrt/bundle/list.d.ts +1 -0
  326. package/dist/commands/mrt/bundle/save.d.ts +1 -0
  327. package/dist/commands/mrt/bundle/upload-v2.d.ts +1 -0
  328. package/dist/commands/mrt/env/access-control/list.d.ts +1 -0
  329. package/dist/commands/mrt/env/b2c.d.ts +1 -0
  330. package/dist/commands/mrt/env/clone.d.ts +1 -0
  331. package/dist/commands/mrt/env/create.d.ts +1 -0
  332. package/dist/commands/mrt/env/delete.d.ts +1 -0
  333. package/dist/commands/mrt/env/get.d.ts +1 -0
  334. package/dist/commands/mrt/env/invalidate.d.ts +1 -0
  335. package/dist/commands/mrt/env/list.d.ts +1 -0
  336. package/dist/commands/mrt/env/redirect/clone.d.ts +1 -0
  337. package/dist/commands/mrt/env/redirect/create.d.ts +1 -0
  338. package/dist/commands/mrt/env/redirect/delete.d.ts +1 -0
  339. package/dist/commands/mrt/env/redirect/list.d.ts +1 -0
  340. package/dist/commands/mrt/env/update.d.ts +1 -0
  341. package/dist/commands/mrt/env/var/delete.d.ts +1 -0
  342. package/dist/commands/mrt/env/var/list.d.ts +1 -0
  343. package/dist/commands/mrt/env/var/push.d.ts +1 -0
  344. package/dist/commands/mrt/env/var/set.d.ts +1 -0
  345. package/dist/commands/mrt/org/b2c.d.ts +1 -0
  346. package/dist/commands/mrt/org/cert/create.d.ts +1 -0
  347. package/dist/commands/mrt/org/cert/delete.d.ts +1 -0
  348. package/dist/commands/mrt/org/cert/get.d.ts +1 -0
  349. package/dist/commands/mrt/org/cert/list.d.ts +1 -0
  350. package/dist/commands/mrt/org/cert/restart-validation.d.ts +1 -0
  351. package/dist/commands/mrt/org/list.d.ts +1 -0
  352. package/dist/commands/mrt/org/member/add.d.ts +1 -0
  353. package/dist/commands/mrt/org/member/get.d.ts +1 -0
  354. package/dist/commands/mrt/org/member/list.d.ts +1 -0
  355. package/dist/commands/mrt/org/member/remove.d.ts +1 -0
  356. package/dist/commands/mrt/org/member/update.d.ts +1 -0
  357. package/dist/commands/mrt/project/create.d.ts +1 -0
  358. package/dist/commands/mrt/project/delete.d.ts +1 -0
  359. package/dist/commands/mrt/project/get.d.ts +1 -0
  360. package/dist/commands/mrt/project/list.d.ts +1 -0
  361. package/dist/commands/mrt/project/member/add.d.ts +1 -0
  362. package/dist/commands/mrt/project/member/get.d.ts +1 -0
  363. package/dist/commands/mrt/project/member/list.d.ts +1 -0
  364. package/dist/commands/mrt/project/member/remove.d.ts +1 -0
  365. package/dist/commands/mrt/project/member/update.d.ts +1 -0
  366. package/dist/commands/mrt/project/notification/delete.d.ts +1 -0
  367. package/dist/commands/mrt/project/notification/get.d.ts +1 -0
  368. package/dist/commands/mrt/project/update.d.ts +1 -0
  369. package/dist/commands/mrt/save-credentials.d.ts +1 -0
  370. package/dist/commands/mrt/tail-logs.d.ts +1 -0
  371. package/dist/commands/mrt/user/api-key.d.ts +1 -0
  372. package/dist/commands/mrt/user/email-prefs.d.ts +1 -0
  373. package/dist/commands/mrt/user/profile.d.ts +1 -0
  374. package/dist/commands/scaffold/init.js +2 -1
  375. package/dist/commands/scaffold/init.js.map +1 -1
  376. package/dist/commands/scapi/custom/status.d.ts +1 -0
  377. package/dist/commands/scapi/schemas/get.d.ts +1 -0
  378. package/dist/commands/scapi/schemas/list.d.ts +1 -0
  379. package/dist/commands/setup/ide/tsserver-plugin.d.ts +1 -0
  380. package/dist/commands/setup/ide/vscode-types.d.ts +1 -0
  381. package/dist/commands/setup/index.js +4 -3
  382. package/dist/commands/setup/index.js.map +1 -1
  383. package/dist/commands/setup/inspect.d.ts +1 -0
  384. package/dist/commands/setup/inspect.js +17 -2
  385. package/dist/commands/setup/inspect.js.map +1 -1
  386. package/dist/commands/setup/instance/create.d.ts +1 -0
  387. package/dist/commands/setup/instance/list.d.ts +1 -0
  388. package/dist/commands/setup/instance/remove.d.ts +1 -0
  389. package/dist/commands/setup/instance/set-active.d.ts +1 -0
  390. package/dist/commands/setup/openshell.d.ts +1 -0
  391. package/dist/commands/setup/skills.d.ts +1 -0
  392. package/dist/commands/slas/client/create.d.ts +1 -0
  393. package/dist/commands/slas/client/delete.d.ts +1 -0
  394. package/dist/commands/slas/client/get.d.ts +1 -0
  395. package/dist/commands/slas/client/list.d.ts +1 -0
  396. package/dist/commands/slas/client/open.d.ts +1 -0
  397. package/dist/commands/slas/client/update.d.ts +1 -0
  398. package/dist/commands/slas/token.d.ts +1 -0
  399. package/dist/commands/slas/token.js +2 -1
  400. package/dist/commands/slas/token.js.map +1 -1
  401. package/dist/commands/webdav/get.d.ts +1 -0
  402. package/dist/commands/webdav/rm.d.ts +1 -0
  403. package/dist/help.d.ts +25 -0
  404. package/dist/help.js +96 -0
  405. package/dist/help.js.map +1 -0
  406. package/dist/lib/scaffold/generate-helper.js +3 -2
  407. package/dist/lib/scaffold/generate-helper.js.map +1 -1
  408. package/dist/lib/skills.d.ts +19 -0
  409. package/dist/lib/skills.js +75 -0
  410. package/dist/lib/skills.js.map +1 -0
  411. package/dist/utils/cip/command.d.ts +1 -0
  412. package/dist/utils/ecdn/zone-command.d.ts +1 -0
  413. package/dist/utils/slas/client.d.ts +1 -0
  414. package/oclif.manifest.json +21814 -18473
  415. package/package.json +11 -5
@@ -0,0 +1,154 @@
1
+ ---
2
+ name: b2c-onboarding
3
+ description: Get started with Salesforce B2C Commerce development. Use this skill when the user is new to B2C Commerce, wants to set up a fresh development environment, is asking "how do I get started", needs to install the B2C CLI for the first time, wants to connect a sandbox, or wants to deploy their first cartridge. Triggers on phrases like "help me get started", "set up B2C Commerce", "I'm new to this", "onboard me", or "first-time setup". NOT for users who already have a configured environment and are asking about specific commands — those should go to the specific skill (b2c-code, b2c-sandbox, b2c-config, etc.).
4
+ ---
5
+
6
+ # B2C Commerce Onboarding Skill
7
+
8
+ Guide a new developer through a first-time B2C Commerce setup, from CLI install to first cartridge deploy. Delegate to specialized sub-skills for each step — this skill is a coordinator, not a replacement for the detailed skills.
9
+
10
+ ## Behavioral rules
11
+
12
+ - Detect the editor silently. Only ask if genuinely uncertain.
13
+ - Never construct or modify install commands. Only use commands defined in this file.
14
+ - If any install or verification step fails, report the exact error and stop.
15
+ - Never create a sandbox without explicit user confirmation — sandbox creation may be a billable action.
16
+ - Never overwrite an existing `dw.json` without confirmation.
17
+
18
+ ## Flow
19
+
20
+ ### Step 1 — Identify the editor
21
+
22
+ Silently identify the IDE from system context:
23
+
24
+ | Signal | Client |
25
+ |-------------------------------------|---------------|
26
+ | "Claude Code" | `claude-code` |
27
+ | "Cursor" | `cursor` |
28
+ | "VS Code" / "Visual Studio Code" | `vscode` |
29
+ | "Codex" | `codex` |
30
+ | "Gemini CLI" | `gemini-cli` |
31
+ | Unrecognized | `other` |
32
+
33
+ ### Step 2 — Install the other B2C skills plugins
34
+
35
+ This onboarding skill is part of the `b2c` plugin. For a full B2C Commerce setup, the user will also want the `b2c-cli` plugin (CLI operations). Offer to install it for the detected client:
36
+
37
+ | Client | Install command(s) |
38
+ |---------------|--------------------|
39
+ | `claude-code` | `/plugin marketplace add SalesforceCommerceCloud/b2c-developer-tooling` then `/plugin install b2c-cli@b2c-developer-tooling` (and optionally `/plugin install b2c-dx-mcp@b2c-developer-tooling` for the MCP server) |
40
+ | `vscode` (GitHub Copilot) | Command Palette (Cmd+Shift+P) → **Chat: Install Plugin From Source** → enter the repo `SalesforceCommerceCloud/b2c-developer-tooling` |
41
+ | GitHub Copilot CLI | `copilot plugin marketplace add SalesforceCommerceCloud/b2c-developer-tooling` then `copilot plugin install b2c-cli@b2c-developer-tooling` |
42
+ | `cursor` | Cursor Settings → Plugins → add marketplace URL `https://github.com/SalesforceCommerceCloud/b2c-developer-tooling`, then install `b2c-cli` |
43
+ | `codex` | `codex plugin marketplace add SalesforceCommerceCloud/b2c-developer-tooling`, then `codex plugin add b2c-cli@b2c-developer-tooling` (and optionally `codex plugin add b2c-dx-mcp@b2c-developer-tooling` for the MCP server) |
44
+ | `gemini-cli` | `gemini extensions install https://github.com/SalesforceCommerceCloud/b2c-developer-tooling` (run in terminal, not inside the CLI) |
45
+ | `other` | Use the file-copy installer below |
46
+
47
+ For clients without MCP-enabled plugin support, the `b2c-dx-mcp` server can be installed directly — see the [MCP installation docs](https://salesforcecommercecloud.github.io/b2c-developer-tooling/mcp/installation.md).
48
+
49
+ **Alternative — file-copy installer for any IDE** (also the right command to **update** already-installed skills or add a specific skill set):
50
+
51
+ ```bash
52
+ # Interactive: select skill sets and IDEs
53
+ b2c setup skills
54
+
55
+ # Install a specific skill set to a specific IDE
56
+ b2c setup skills b2c-cli --ide cursor
57
+ b2c setup skills b2c --ide vscode
58
+
59
+ # Update existing skills to the latest release
60
+ b2c setup skills b2c-cli --ide cursor --update
61
+ b2c setup skills b2c --ide cursor --update
62
+
63
+ # Install globally (all projects)
64
+ b2c setup skills b2c-cli --ide cursor --global
65
+ ```
66
+
67
+ If the user already has some skills installed and is asking how to upgrade, point them at `b2c setup skills <set> --ide <ide> --update`.
68
+
69
+ ### Step 3 — Verify the B2C CLI is available
70
+
71
+ Run `b2c --version`. If the command is not found:
72
+
73
+ - For a one-off invocation: `npx @salesforce/b2c-cli <command>`.
74
+ - For a persistent install: `npm install -g @salesforce/b2c-cli` (or the pnpm / yarn equivalent).
75
+
76
+ Do not block on the global install — `npx` is sufficient for the rest of this flow.
77
+
78
+ ### Step 4 — Account Manager access check
79
+
80
+ B2C Commerce has **no self-service signup**. The user must have Account Manager access provisioned by their organization's B2C Commerce admin before any of the following steps will work.
81
+
82
+ Ask (if not already clear from context): *"Do you have a Salesforce B2C Commerce Account Manager login and a target instance (sandbox or PIG)?"*
83
+
84
+ - If **no**: stop here. Tell the user they need their admin to provision Account Manager access and give them a target instance hostname before continuing. Do not proceed.
85
+ - If **yes**: continue.
86
+
87
+ ### Step 5 — Check for existing configuration
88
+
89
+ Run `b2c setup inspect` to see whether a `dw.json` or credentials are already configured.
90
+
91
+ - If configuration exists and points at a reachable instance, skip to Step 7.
92
+ - If no configuration is found, proceed to Step 6.
93
+
94
+ For deep troubleshooting (wrong instance, profile switching, token inspection), delegate to the `b2c-config` skill.
95
+
96
+ ### Step 6 — Initialize configuration
97
+
98
+ Guide the user to create a `dw.json` in the project root:
99
+
100
+ ```bash
101
+ b2c setup
102
+ ```
103
+
104
+ This prompts for hostname, client ID/secret (or username/password), and code version. For deeper configuration topics (multiple profiles, env vars, cert-based auth), delegate to the `b2c-config` skill.
105
+
106
+ ### Step 7 — Sandbox
107
+
108
+ If the user wants to work against an existing sandbox, confirm it is reachable:
109
+
110
+ ```bash
111
+ b2c setup inspect
112
+ b2c sandbox list # requires API access
113
+ ```
114
+
115
+ If the user needs a fresh sandbox, delegate to the `b2c-sandbox` skill for the full create flow. **Only create a sandbox when explicitly asked.**
116
+
117
+ ### Step 8 — First cartridge deploy (if applicable)
118
+
119
+ If the user has cartridges locally:
120
+
121
+ ```bash
122
+ b2c code deploy
123
+ ```
124
+
125
+ For selective deploys, watch mode, or reload, delegate to the `b2c-code` skill.
126
+
127
+ If the user does not yet have cartridges, point them at the canonical starting points:
128
+
129
+ - **SFRA** (Storefront Reference Architecture): https://github.com/SalesforceCommerceCloud/storefront-reference-architecture
130
+ - **PWA Kit / MRT** (headless) — delegate to the `b2c-mrt` skill on request.
131
+
132
+ ### Step 9 — Route to the user's goal
133
+
134
+ Once setup is working, ask a single directing question to hand off to the right skill:
135
+
136
+ > "What do you want to work on first?
137
+ >
138
+ > 1. **Build or modify a storefront** (SFRA cartridges, ISML, controllers)
139
+ > 2. **Build a Custom API** (SCAPI)
140
+ > 3. **Operate an existing instance** (deploy, run jobs, tail logs, manage sites)
141
+ >
142
+ > Or if you have something else in mind, tell me."
143
+
144
+ Route by the answer:
145
+
146
+ - **Storefront** → `b2c-controllers`, `b2c-isml`, `b2c-forms`, `b2c-hooks`
147
+ - **Custom API** → `b2c-custom-api-development`, `b2c-scapi-admin`, `b2c-scapi-shopper`
148
+ - **Operations** → `b2c-code`, `b2c-job`, `b2c-logs`, `b2c-sites`
149
+
150
+ ## Reference
151
+
152
+ - B2C CLI reference: https://salesforcecommercecloud.github.io/b2c-developer-tooling/cli/index.md
153
+ - Install guide: https://salesforcecommercecloud.github.io/b2c-developer-tooling/guide/installation.md
154
+ - Agent skills overview: https://salesforcecommercecloud.github.io/b2c-developer-tooling/guide/agent-skills.md
@@ -0,0 +1,391 @@
1
+ ---
2
+ name: b2c-ordering
3
+ description: Manage the order lifecycle in B2C Commerce including order creation, status transitions, failure handling, and checkout completion. Use this skill whenever the user needs to create an order from a basket, transition order status, handle failed or cancelled orders, implement payment authorization in checkout, or understand async order processing — even if they just say "my order is stuck" or "finish the checkout flow".
4
+ ---
5
+
6
+ # B2C Ordering
7
+
8
+ The OrderMgr API provides order creation, status management, and querying. Understanding the order lifecycle is essential for checkout implementation and order processing.
9
+
10
+ ## Order Lifecycle
11
+
12
+ Orders progress through these statuses:
13
+
14
+ ```
15
+ Basket → CREATED → NEW → (COMPLETED or CANCELLED or FAILED)
16
+ ```
17
+
18
+ | Status | Description | Can Transition To |
19
+ |--------|-------------|-------------------|
20
+ | `CREATED` | Order created, not yet placed | `NEW`, `FAILED` |
21
+ | `NEW` | Order placed, awaiting fulfillment | `OPEN`, `COMPLETED`, `CANCELLED`, `FAILED` |
22
+ | `OPEN` | Order in processing | `COMPLETED`, `CANCELLED` |
23
+ | `COMPLETED` | Order fulfilled | - |
24
+ | `CANCELLED` | Order cancelled | `NEW` (via `undoCancel`) |
25
+ | `FAILED` | Order failed (payment, validation) | - (cannot be reopened) |
26
+
27
+ **Important:** Once an order reaches `FAILED` status, it cannot be reopened or cancelled. Use `failOrder(order, true)` to reopen the basket for retry instead.
28
+
29
+ ## Creating Orders
30
+
31
+ ### Standard Flow (Synchronous)
32
+
33
+ ```javascript
34
+ var OrderMgr = require('dw/order/OrderMgr');
35
+ var Transaction = require('dw/system/Transaction');
36
+ var Status = require('dw/system/Status');
37
+
38
+ function createOrder(basket) {
39
+ var order;
40
+
41
+ Transaction.wrap(function() {
42
+ // Create order from basket (status: CREATED)
43
+ order = OrderMgr.createOrder(basket);
44
+ });
45
+
46
+ if (!order) {
47
+ return { error: true, message: 'Order creation failed' };
48
+ }
49
+
50
+ // Authorize payment
51
+ var paymentResult = authorizePayment(order);
52
+
53
+ if (!paymentResult.success) {
54
+ Transaction.wrap(function() {
55
+ OrderMgr.failOrder(order, true); // Reopen basket
56
+ });
57
+ return { error: true, message: 'Payment failed' };
58
+ }
59
+
60
+ // Place the order (status: CREATED → NEW)
61
+ var placeResult;
62
+ Transaction.wrap(function() {
63
+ placeResult = OrderMgr.placeOrder(order);
64
+ });
65
+
66
+ if (placeResult.error) {
67
+ return { error: true, message: 'Order placement failed' };
68
+ }
69
+
70
+ // Set confirmation status
71
+ Transaction.wrap(function() {
72
+ order.setConfirmationStatus(order.CONFIRMATION_STATUS_CONFIRMED);
73
+ });
74
+
75
+ return { error: false, order: order };
76
+ }
77
+ ```
78
+
79
+ ### SCAPI Flow: Create, Authorize Through Order PI, Then Place
80
+
81
+ Lead with the Shopper Orders state machine instead of manually placing from `order.afterPOST`:
82
+
83
+ ```text
84
+ POST /checkout/shopper-orders/v1/organizations/{orgId}/orders
85
+ -> commits order in CREATED
86
+
87
+ PATCH /checkout/shopper-orders/v1/organizations/{orgId}/orders/{orderNo}/payment-instruments/{piId}
88
+ -> invokes dw.order.payment.authorizeCreditCard or dw.order.payment.authorize
89
+ -> passes successfullyAuthorized to order.payment_instrument.afterPATCH
90
+ -> default afterPATCH places when authorized coverage reaches the order total
91
+
92
+ NEW -> success
93
+ CREATED -> not fully placed; authorize remaining PIs, fail safely, or reconcile
94
+ ```
95
+
96
+ Return `undefined` from a successful custom order-PI `afterPATCH` implementation so the platform's
97
+ default coverage-based placement behavior runs. A non-null `Status` ends execution and suppresses
98
+ that implementation.
99
+
100
+ On a deterministic payment failure, use the Shopper Orders fail action with `reopenBasket=true`.
101
+ On an indeterminate gateway result, retain the `CREATED` order for reconciliation rather than
102
+ risking a duplicate authorization.
103
+
104
+ Use `dw.ocapi.shop.order.afterPOST` as the alternative when checkout deliberately needs a single
105
+ server-side phase that creates, authorizes, and performs the Commerce-side place-or-fail transition,
106
+ or when the processor cannot participate in order-PI authorization. That hook runs inside order
107
+ creation's transaction: do not add a nested `Transaction.wrap`, and understand that `Status.ERROR`
108
+ rolls back the Commerce order but not an external gateway side effect. See
109
+ "Alternative: Authorize and Place in `order.afterPOST`" in the `b2c-hooks` skill.
110
+
111
+ ## OrderMgr API Reference
112
+
113
+ ### Order Creation
114
+
115
+ | Method | Description |
116
+ |--------|-------------|
117
+ | `createOrder(basket)` | Create order with auto-generated number |
118
+ | `createOrder(basket, orderNo)` | Create order with specific number |
119
+ | `createOrderNo()` | Generate next order number |
120
+ | `createOrderSequenceNo()` | Get next sequence number (for custom formatting) |
121
+
122
+ ### Order Status
123
+
124
+ | Method | Description |
125
+ |--------|-------------|
126
+ | `placeOrder(order)` | Place order (CREATED → NEW) |
127
+ | `failOrder(order, reopenBasket)` | Fail order (set to FAILED status) |
128
+ | `cancelOrder(order)` | Cancel order (set to CANCELLED status) |
129
+ | `undoCancelOrder(order)` | Revert cancelled order to NEW |
130
+
131
+ **Note:** There is no `undoFailOrder()` method. Failed orders cannot be reopened. Use `failOrder(order, true)` to reopen the basket for retry.
132
+
133
+ ### Order Queries
134
+
135
+ | Method | Description |
136
+ |--------|-------------|
137
+ | `getOrder(orderNo)` | Get order by number |
138
+ | `searchOrder(query, ...args)` | Search for single order |
139
+ | `searchOrders(query, sortString, ...args)` | Search for multiple orders |
140
+ | `queryOrder(query, ...args)` | Query single order |
141
+ | `queryOrders(query, sortString, ...args)` | Query multiple orders |
142
+
143
+ ## Querying Orders
144
+
145
+ ### Get Order by Number
146
+
147
+ ```javascript
148
+ var OrderMgr = require('dw/order/OrderMgr');
149
+
150
+ var order = OrderMgr.getOrder('00001234');
151
+
152
+ if (order) {
153
+ var status = order.status.value;
154
+ var total = order.totalGrossPrice;
155
+ }
156
+ ```
157
+
158
+ ### Search Orders
159
+
160
+ ```javascript
161
+ var OrderMgr = require('dw/order/OrderMgr');
162
+
163
+ // Search by customer email
164
+ var orders = OrderMgr.searchOrders(
165
+ 'customerEmail = {0} AND status != {1}',
166
+ 'creationDate desc',
167
+ 'customer@example.com',
168
+ dw.order.Order.ORDER_STATUS_FAILED
169
+ );
170
+
171
+ while (orders.hasNext()) {
172
+ var order = orders.next();
173
+ // Process order
174
+ }
175
+ orders.close();
176
+ ```
177
+
178
+ ### Query by Date Range
179
+
180
+ ```javascript
181
+ var OrderMgr = require('dw/order/OrderMgr');
182
+ var Calendar = require('dw/util/Calendar');
183
+
184
+ var startDate = new Calendar();
185
+ startDate.add(Calendar.DAY_OF_YEAR, -7);
186
+
187
+ var orders = OrderMgr.searchOrders(
188
+ 'creationDate >= {0} AND status = {1}',
189
+ 'creationDate desc',
190
+ startDate.time,
191
+ dw.order.Order.ORDER_STATUS_NEW
192
+ );
193
+
194
+ while (orders.hasNext()) {
195
+ var order = orders.next();
196
+ // Process order
197
+ }
198
+ orders.close();
199
+ ```
200
+
201
+ ## Order Status Management
202
+
203
+ ### Cancel Order
204
+
205
+ ```javascript
206
+ var OrderMgr = require('dw/order/OrderMgr');
207
+ var Transaction = require('dw/system/Transaction');
208
+ var Order = require('dw/order/Order');
209
+
210
+ function cancelOrder(orderNo) {
211
+ var order = OrderMgr.getOrder(orderNo);
212
+
213
+ if (!order) {
214
+ return { error: true, message: 'Order not found' };
215
+ }
216
+
217
+ // Can only cancel NEW or OPEN orders
218
+ if (order.status.value !== Order.ORDER_STATUS_NEW &&
219
+ order.status.value !== Order.ORDER_STATUS_OPEN) {
220
+ return { error: true, message: 'Order cannot be cancelled' };
221
+ }
222
+
223
+ Transaction.wrap(function() {
224
+ OrderMgr.cancelOrder(order);
225
+ });
226
+
227
+ return { error: false };
228
+ }
229
+ ```
230
+
231
+ ### Fail Order
232
+
233
+ ```javascript
234
+ var OrderMgr = require('dw/order/OrderMgr');
235
+ var Transaction = require('dw/system/Transaction');
236
+
237
+ function failOrder(order, reopenBasket) {
238
+ // reopenBasket: true = customer can retry checkout
239
+ // false = basket is lost
240
+
241
+ Transaction.wrap(function() {
242
+ OrderMgr.failOrder(order, reopenBasket);
243
+ });
244
+ }
245
+ ```
246
+
247
+ ### Handling Failed Orders
248
+
249
+ **Failed orders cannot be reopened.** Instead, use `failOrder(order, true)` to reopen the basket:
250
+
251
+ ```javascript
252
+ var OrderMgr = require('dw/order/OrderMgr');
253
+ var Transaction = require('dw/system/Transaction');
254
+
255
+ // When payment fails, fail the order and reopen basket
256
+ function handlePaymentFailure(order) {
257
+ Transaction.wrap(function() {
258
+ // reopenBasket=true allows customer to retry checkout
259
+ OrderMgr.failOrder(order, true);
260
+ });
261
+
262
+ // Basket is now available again for the customer
263
+ return { error: true, message: 'Payment failed. Please try again.' };
264
+ }
265
+ ```
266
+
267
+ ### SCAPI: Fail Order and Reopen Basket
268
+
269
+ For SCAPI integrations, use the Shopper Orders fail action after a deterministic payment failure:
270
+
271
+ ```http
272
+ POST /checkout/shopper-orders/v1/organizations/{orgId}/orders/{orderNo}/actions/fail?siteId={siteId}&reopenBasket=true
273
+ Authorization: Bearer {token}
274
+ Content-Type: application/json
275
+
276
+ {
277
+ "reasonCode": "payment_auth_failure"
278
+ }
279
+ ```
280
+
281
+ The current payment-oriented reason codes are `payment_auth_failure`, `payment_confirm_failure`, and
282
+ `payment_capture_failure`. The endpoint returns `409` when the order is no longer in a state that can
283
+ be failed. Confirm the current Shopper Orders schema before generating version-specific code.
284
+
285
+ ### Undo Cancelled Order
286
+
287
+ Cancelled orders can be reopened using `undoCancelOrder()`:
288
+
289
+ ```javascript
290
+ var OrderMgr = require('dw/order/OrderMgr');
291
+ var Transaction = require('dw/system/Transaction');
292
+ var Order = require('dw/order/Order');
293
+
294
+ function reopenCancelledOrder(orderNo) {
295
+ var order = OrderMgr.getOrder(orderNo);
296
+
297
+ if (order.status.value !== Order.ORDER_STATUS_CANCELLED) {
298
+ return { error: true, message: 'Order is not cancelled' };
299
+ }
300
+
301
+ Transaction.wrap(function() {
302
+ // Revert to NEW status
303
+ OrderMgr.undoCancelOrder(order);
304
+ });
305
+
306
+ return { error: false, order: order };
307
+ }
308
+ ```
309
+
310
+ ## Order Properties
311
+
312
+ | Property | Description |
313
+ |----------|-------------|
314
+ | `orderNo` | Order number |
315
+ | `status` | Current order status |
316
+ | `confirmationStatus` | Confirmation status |
317
+ | `exportStatus` | Export status for OMS |
318
+ | `paymentStatus` | Payment status |
319
+ | `shippingStatus` | Shipping status |
320
+ | `customerEmail` | Customer email |
321
+ | `customerName` | Customer name |
322
+ | `totalGrossPrice` | Order total (with tax) |
323
+ | `totalNetPrice` | Order total (without tax) |
324
+ | `totalTax` | Total tax amount |
325
+ | `creationDate` | Order creation date |
326
+ | `productLineItems` | Line items in order |
327
+ | `shipments` | Order shipments |
328
+ | `paymentInstruments` | Payment instruments |
329
+
330
+ ## Custom Order Numbers
331
+
332
+ Use the `dw.order.createOrderNo` hook for custom order number generation:
333
+
334
+ ```javascript
335
+ // hooks.json
336
+ {
337
+ "hooks": [
338
+ {
339
+ "name": "dw.order.createOrderNo",
340
+ "script": "./hooks/orderNo.js"
341
+ }
342
+ ]
343
+ }
344
+ ```
345
+
346
+ ```javascript
347
+ // hooks/orderNo.js
348
+ var OrderMgr = require('dw/order/OrderMgr');
349
+ var Site = require('dw/system/Site');
350
+
351
+ exports.createOrderNo = function() {
352
+ var seqNo = OrderMgr.createOrderSequenceNo();
353
+ var prefix = Site.current.ID.toUpperCase();
354
+ var year = new Date().getFullYear();
355
+
356
+ return prefix + '-' + year + '-' + seqNo;
357
+ };
358
+ ```
359
+
360
+ ## Best Practices
361
+
362
+ ### Do
363
+
364
+ - Wrap Script API order mutations in a transaction only when the caller does not already provide one
365
+ - Check order status before transitions
366
+ - Close order iterators when done
367
+ - Use `failOrder(order, true)` to let customers retry
368
+ - Implement idempotent order creation (use specific order numbers)
369
+ - Set appropriate export/confirmation status
370
+
371
+ ### Don't
372
+
373
+ - Place orders before successful payment authorization
374
+ - Cancel orders without refund processing
375
+ - Leave orders in CREATED status indefinitely
376
+ - Forget to handle concurrent order modifications
377
+ - Skip status validation before transitions
378
+
379
+ ## Error Handling
380
+
381
+ | Scenario | Solution |
382
+ |----------|----------|
383
+ | Basket is empty | Validate basket before `createOrder()` |
384
+ | Invalid basket | Check for missing shipping/billing addresses |
385
+ | Payment failed | Use `failOrder(order, true)` to reopen basket |
386
+ | Order number exists | Use auto-generated numbers or validate uniqueness |
387
+ | Status transition invalid | Check current status before calling status methods |
388
+
389
+ ## Related Skills
390
+
391
+ - `b2c-hooks` skill - Order hooks (calculate, payment, createOrderNo)