@endora-commerce/contracts 0.109.0 → 0.111.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 (385) hide show
  1. package/dist/accept-language.d.ts +31 -0
  2. package/dist/accept-language.js +64 -0
  3. package/dist/actor.d.ts +16 -0
  4. package/dist/addresses.d.ts +35 -0
  5. package/dist/addresses.js +8 -1
  6. package/dist/admin-actions.d.ts +2 -0
  7. package/dist/admin-actions.js +18 -0
  8. package/dist/admin-contributions.d.ts +99 -12
  9. package/dist/admin-contributions.js +36 -10
  10. package/dist/admin-roles.d.ts +17 -2
  11. package/dist/admin-users.d.ts +9 -0
  12. package/dist/admin.d.ts +114 -4
  13. package/dist/admin.js +98 -3
  14. package/dist/api-keys.d.ts +22 -0
  15. package/dist/api-keys.js +4 -0
  16. package/dist/assets-library.d.ts +45 -0
  17. package/dist/assets-library.js +20 -3
  18. package/dist/audit-logs.d.ts +12 -0
  19. package/dist/audit-logs.js +12 -0
  20. package/dist/auth.d.ts +9 -0
  21. package/dist/auth.js +9 -0
  22. package/dist/blog.d.ts +382 -22
  23. package/dist/blog.js +199 -17
  24. package/dist/carts.d.ts +423 -36
  25. package/dist/carts.js +150 -12
  26. package/dist/catalog.d.ts +379 -208
  27. package/dist/catalog.js +241 -163
  28. package/dist/cms-brand.d.ts +14 -14
  29. package/dist/cms.d.ts +71 -16
  30. package/dist/cms.js +15 -0
  31. package/dist/command-hooks.d.ts +301 -0
  32. package/dist/command-hooks.js +248 -0
  33. package/dist/common.d.ts +23 -6
  34. package/dist/common.js +25 -2
  35. package/dist/comparisons.d.ts +21 -14
  36. package/dist/comparisons.js +2 -1
  37. package/dist/credit-limits.d.ts +22 -0
  38. package/dist/credit-limits.js +35 -0
  39. package/dist/crm.d.ts +134 -78
  40. package/dist/crm.js +21 -5
  41. package/dist/custom-fields.d.ts +417 -49
  42. package/dist/custom-fields.js +142 -1
  43. package/dist/customer-accounts.d.ts +324 -22
  44. package/dist/customer-accounts.js +43 -0
  45. package/dist/customer-notifications.d.ts +143 -0
  46. package/dist/customer-notifications.js +41 -0
  47. package/dist/customers.d.ts +92 -73
  48. package/dist/customers.js +98 -10
  49. package/dist/dictionary.d.ts +53 -0
  50. package/dist/dictionary.js +25 -0
  51. package/dist/document-templates.d.ts +12 -12
  52. package/dist/email.d.ts +34 -0
  53. package/dist/email.js +6 -0
  54. package/dist/errors.d.ts +431 -3
  55. package/dist/errors.js +523 -3
  56. package/dist/forms-logic.d.ts +79 -0
  57. package/dist/forms-logic.fixtures.d.ts +52 -0
  58. package/dist/forms-logic.fixtures.js +610 -0
  59. package/dist/forms-logic.js +699 -0
  60. package/dist/forms.d.ts +9833 -0
  61. package/dist/forms.js +827 -0
  62. package/dist/i18n.d.ts +34 -0
  63. package/dist/i18n.js +15 -0
  64. package/dist/import-export.d.ts +180 -0
  65. package/dist/import-export.js +60 -0
  66. package/dist/index.d.ts +16 -1
  67. package/dist/index.js +30 -1
  68. package/dist/inventory.d.ts +9 -9
  69. package/dist/invoice-ledger.d.ts +13 -13
  70. package/dist/invoices.d.ts +126 -0
  71. package/dist/invoices.js +53 -0
  72. package/dist/line-bounds.d.ts +53 -0
  73. package/dist/line-bounds.js +65 -0
  74. package/dist/megamenu.d.ts +27 -27
  75. package/dist/mfa.d.ts +210 -4
  76. package/dist/mfa.js +136 -0
  77. package/dist/modules.d.ts +56 -8
  78. package/dist/modules.js +128 -3
  79. package/dist/money-decimal.d.ts +54 -0
  80. package/dist/money-decimal.js +95 -0
  81. package/dist/newsletter.d.ts +4 -4
  82. package/dist/orders.d.ts +246 -12
  83. package/dist/orders.js +140 -7
  84. package/dist/organization-hooks.d.ts +99 -0
  85. package/dist/organization-hooks.js +22 -0
  86. package/dist/organization-registry-lookup.d.ts +362 -0
  87. package/dist/organization-registry-lookup.js +196 -0
  88. package/dist/organization-roles.d.ts +341 -0
  89. package/dist/organization-roles.js +218 -0
  90. package/dist/organizations.d.ts +1074 -103
  91. package/dist/organizations.js +293 -28
  92. package/dist/page-builder-props.d.ts +56 -56
  93. package/dist/pim-connector.d.ts +7 -3
  94. package/dist/pim-connector.js +6 -2
  95. package/dist/pim-field-path.d.ts +5 -1
  96. package/dist/pim-field-path.js +37 -81
  97. package/dist/pim-locale-mapping.d.ts +131 -0
  98. package/dist/pim-locale-mapping.js +193 -0
  99. package/dist/price-books.d.ts +215 -63
  100. package/dist/price-books.js +47 -2
  101. package/dist/price-lists.d.ts +13 -10
  102. package/dist/product-feeds.d.ts +249 -100
  103. package/dist/product-feeds.js +46 -2
  104. package/dist/product-scope-model.d.ts +161 -0
  105. package/dist/product-scope-model.js +161 -0
  106. package/dist/product-scope-overrides.d.ts +0 -103
  107. package/dist/product-scope-overrides.js +0 -54
  108. package/dist/product-scoped-values.d.ts +2610 -0
  109. package/dist/product-scoped-values.js +425 -0
  110. package/dist/product-scopes.d.ts +199 -64
  111. package/dist/product-scopes.js +120 -23
  112. package/dist/product-tax-rates.d.ts +38 -0
  113. package/dist/product-tax-rates.js +45 -0
  114. package/dist/product-url-keys.d.ts +51 -45
  115. package/dist/product-url-keys.js +73 -39
  116. package/dist/product-value-resolver.d.ts +37 -60
  117. package/dist/product-value-resolver.js +36 -96
  118. package/dist/projects.d.ts +76 -28
  119. package/dist/projects.js +53 -9
  120. package/dist/promotions.d.ts +163 -11
  121. package/dist/promotions.js +23 -1
  122. package/dist/pwa.d.ts +41 -2
  123. package/dist/quick-order.d.ts +159 -9
  124. package/dist/quick-order.js +79 -4
  125. package/dist/quote-requests.d.ts +231 -17
  126. package/dist/quote-requests.js +111 -9
  127. package/dist/record-references.d.ts +15 -15
  128. package/dist/record-references.js +2 -3
  129. package/dist/record-rich-text.js +2 -1
  130. package/dist/returns.d.ts +214 -52
  131. package/dist/returns.js +143 -28
  132. package/dist/sales-channels.d.ts +34 -3
  133. package/dist/sales-channels.js +16 -1
  134. package/dist/saved-list-views.d.ts +28 -0
  135. package/dist/saved-list-views.js +14 -1
  136. package/dist/schema-extensions.d.ts +36 -0
  137. package/dist/schema-extensions.js +29 -0
  138. package/dist/scoped-write-encoding.d.ts +100 -0
  139. package/dist/scoped-write-encoding.js +135 -0
  140. package/dist/search.d.ts +18 -16
  141. package/dist/seo.d.ts +83 -30
  142. package/dist/seo.js +8 -1
  143. package/dist/settings.d.ts +173 -2
  144. package/dist/settings.js +53 -2
  145. package/dist/shopping-lists.d.ts +63 -4
  146. package/dist/shopping-lists.js +57 -3
  147. package/dist/storefront-cache-tags.d.ts +22 -0
  148. package/dist/storefront-cache-tags.js +12 -0
  149. package/dist/storefront-value-overrides.d.ts +18 -56
  150. package/dist/storefront-value-overrides.js +11 -86
  151. package/dist/tasks.d.ts +27 -27
  152. package/dist/taxes.d.ts +27 -0
  153. package/dist/taxes.js +4 -0
  154. package/dist/transactional-emails.d.ts +48 -22
  155. package/dist/webhooks.d.ts +75 -0
  156. package/dist/webhooks.js +24 -0
  157. package/package.json +5 -3
  158. package/dist/actor.d.ts.map +0 -1
  159. package/dist/actor.js.map +0 -1
  160. package/dist/addresses.d.ts.map +0 -1
  161. package/dist/addresses.js.map +0 -1
  162. package/dist/admin-actions.d.ts.map +0 -1
  163. package/dist/admin-actions.js.map +0 -1
  164. package/dist/admin-contributions.d.ts.map +0 -1
  165. package/dist/admin-contributions.js.map +0 -1
  166. package/dist/admin-feedback.d.ts.map +0 -1
  167. package/dist/admin-feedback.js.map +0 -1
  168. package/dist/admin-i18n.d.ts.map +0 -1
  169. package/dist/admin-i18n.js.map +0 -1
  170. package/dist/admin-name.d.ts.map +0 -1
  171. package/dist/admin-name.js.map +0 -1
  172. package/dist/admin-notifications.d.ts.map +0 -1
  173. package/dist/admin-notifications.js.map +0 -1
  174. package/dist/admin-preferences.d.ts.map +0 -1
  175. package/dist/admin-preferences.js.map +0 -1
  176. package/dist/admin-roles.d.ts.map +0 -1
  177. package/dist/admin-roles.js.map +0 -1
  178. package/dist/admin-search.d.ts.map +0 -1
  179. package/dist/admin-search.js.map +0 -1
  180. package/dist/admin-users.d.ts.map +0 -1
  181. package/dist/admin-users.js.map +0 -1
  182. package/dist/admin.d.ts.map +0 -1
  183. package/dist/admin.js.map +0 -1
  184. package/dist/analytics.d.ts.map +0 -1
  185. package/dist/analytics.js.map +0 -1
  186. package/dist/api-keys.d.ts.map +0 -1
  187. package/dist/api-keys.js.map +0 -1
  188. package/dist/assets-library.d.ts.map +0 -1
  189. package/dist/assets-library.js.map +0 -1
  190. package/dist/audit-logs.d.ts.map +0 -1
  191. package/dist/audit-logs.js.map +0 -1
  192. package/dist/auth.d.ts.map +0 -1
  193. package/dist/auth.js.map +0 -1
  194. package/dist/blog.d.ts.map +0 -1
  195. package/dist/blog.js.map +0 -1
  196. package/dist/capabilities.d.ts.map +0 -1
  197. package/dist/capabilities.js.map +0 -1
  198. package/dist/carts.d.ts.map +0 -1
  199. package/dist/carts.js.map +0 -1
  200. package/dist/catalog.d.ts.map +0 -1
  201. package/dist/catalog.js.map +0 -1
  202. package/dist/cms-brand.d.ts.map +0 -1
  203. package/dist/cms-brand.js.map +0 -1
  204. package/dist/cms-contact-form.d.ts.map +0 -1
  205. package/dist/cms-contact-form.js.map +0 -1
  206. package/dist/cms.d.ts.map +0 -1
  207. package/dist/cms.js.map +0 -1
  208. package/dist/common.d.ts.map +0 -1
  209. package/dist/common.js.map +0 -1
  210. package/dist/comparisons.d.ts.map +0 -1
  211. package/dist/comparisons.js.map +0 -1
  212. package/dist/credentials.d.ts.map +0 -1
  213. package/dist/credentials.js.map +0 -1
  214. package/dist/credit-limits.d.ts.map +0 -1
  215. package/dist/credit-limits.js.map +0 -1
  216. package/dist/crm-rich-text.d.ts.map +0 -1
  217. package/dist/crm-rich-text.js.map +0 -1
  218. package/dist/crm.d.ts.map +0 -1
  219. package/dist/crm.js.map +0 -1
  220. package/dist/currencies.d.ts.map +0 -1
  221. package/dist/currencies.js.map +0 -1
  222. package/dist/custom-fields.d.ts.map +0 -1
  223. package/dist/custom-fields.js.map +0 -1
  224. package/dist/customer-accounts.d.ts.map +0 -1
  225. package/dist/customer-accounts.js.map +0 -1
  226. package/dist/customers.d.ts.map +0 -1
  227. package/dist/customers.js.map +0 -1
  228. package/dist/dictionary.d.ts.map +0 -1
  229. package/dist/dictionary.js.map +0 -1
  230. package/dist/document-templates.d.ts.map +0 -1
  231. package/dist/document-templates.js.map +0 -1
  232. package/dist/document-values.d.ts.map +0 -1
  233. package/dist/document-values.js.map +0 -1
  234. package/dist/email-address.d.ts.map +0 -1
  235. package/dist/email-address.js.map +0 -1
  236. package/dist/email.d.ts.map +0 -1
  237. package/dist/email.js.map +0 -1
  238. package/dist/envelopes.d.ts.map +0 -1
  239. package/dist/envelopes.js.map +0 -1
  240. package/dist/environment-inputs.d.ts.map +0 -1
  241. package/dist/environment-inputs.js.map +0 -1
  242. package/dist/erp-connector.d.ts.map +0 -1
  243. package/dist/erp-connector.js.map +0 -1
  244. package/dist/errors.d.ts.map +0 -1
  245. package/dist/errors.js.map +0 -1
  246. package/dist/google-analytics.d.ts.map +0 -1
  247. package/dist/google-analytics.js.map +0 -1
  248. package/dist/google-tag-manager.d.ts.map +0 -1
  249. package/dist/google-tag-manager.js.map +0 -1
  250. package/dist/i18n.d.ts.map +0 -1
  251. package/dist/i18n.js.map +0 -1
  252. package/dist/import-export.d.ts.map +0 -1
  253. package/dist/import-export.js.map +0 -1
  254. package/dist/index.d.ts.map +0 -1
  255. package/dist/index.js.map +0 -1
  256. package/dist/inventory.d.ts.map +0 -1
  257. package/dist/inventory.js.map +0 -1
  258. package/dist/invoice-ledger.d.ts.map +0 -1
  259. package/dist/invoice-ledger.js.map +0 -1
  260. package/dist/invoices.d.ts.map +0 -1
  261. package/dist/invoices.js.map +0 -1
  262. package/dist/kernel.d.ts.map +0 -1
  263. package/dist/kernel.js.map +0 -1
  264. package/dist/languages.d.ts.map +0 -1
  265. package/dist/languages.js.map +0 -1
  266. package/dist/line-groups.d.ts.map +0 -1
  267. package/dist/line-groups.js.map +0 -1
  268. package/dist/linkedin-ads.d.ts.map +0 -1
  269. package/dist/linkedin-ads.js.map +0 -1
  270. package/dist/localized-name.d.ts.map +0 -1
  271. package/dist/localized-name.js.map +0 -1
  272. package/dist/megamenu.d.ts.map +0 -1
  273. package/dist/megamenu.js.map +0 -1
  274. package/dist/meta-ads.d.ts.map +0 -1
  275. package/dist/meta-ads.js.map +0 -1
  276. package/dist/mfa.d.ts.map +0 -1
  277. package/dist/mfa.js.map +0 -1
  278. package/dist/modules.d.ts.map +0 -1
  279. package/dist/modules.js.map +0 -1
  280. package/dist/money-decimal.d.ts.map +0 -1
  281. package/dist/money-decimal.js.map +0 -1
  282. package/dist/money-input.d.ts.map +0 -1
  283. package/dist/money-input.js.map +0 -1
  284. package/dist/newsletter.d.ts.map +0 -1
  285. package/dist/newsletter.js.map +0 -1
  286. package/dist/order-minimums.d.ts.map +0 -1
  287. package/dist/order-minimums.js.map +0 -1
  288. package/dist/orders.d.ts.map +0 -1
  289. package/dist/orders.js.map +0 -1
  290. package/dist/organizations.d.ts.map +0 -1
  291. package/dist/organizations.js.map +0 -1
  292. package/dist/page-builder-props.d.ts.map +0 -1
  293. package/dist/page-builder-props.js.map +0 -1
  294. package/dist/page-builder-values.d.ts.map +0 -1
  295. package/dist/page-builder-values.js.map +0 -1
  296. package/dist/pagination.d.ts.map +0 -1
  297. package/dist/pagination.js.map +0 -1
  298. package/dist/payment-methods.d.ts.map +0 -1
  299. package/dist/payment-methods.js.map +0 -1
  300. package/dist/payment-return-url.d.ts.map +0 -1
  301. package/dist/payment-return-url.js.map +0 -1
  302. package/dist/payments.d.ts.map +0 -1
  303. package/dist/payments.js.map +0 -1
  304. package/dist/pim-connector.d.ts.map +0 -1
  305. package/dist/pim-connector.js.map +0 -1
  306. package/dist/pim-field-path.d.ts.map +0 -1
  307. package/dist/pim-field-path.js.map +0 -1
  308. package/dist/platform-info.d.ts.map +0 -1
  309. package/dist/platform-info.js.map +0 -1
  310. package/dist/platform-language.d.ts.map +0 -1
  311. package/dist/platform-language.js.map +0 -1
  312. package/dist/price-book-decimal.d.ts.map +0 -1
  313. package/dist/price-book-decimal.js.map +0 -1
  314. package/dist/price-books.d.ts.map +0 -1
  315. package/dist/price-books.js.map +0 -1
  316. package/dist/price-lists.d.ts.map +0 -1
  317. package/dist/price-lists.js.map +0 -1
  318. package/dist/product-feeds.d.ts.map +0 -1
  319. package/dist/product-feeds.js.map +0 -1
  320. package/dist/product-scope-overrides.d.ts.map +0 -1
  321. package/dist/product-scope-overrides.js.map +0 -1
  322. package/dist/product-scopes.d.ts.map +0 -1
  323. package/dist/product-scopes.js.map +0 -1
  324. package/dist/product-summary-text.d.ts.map +0 -1
  325. package/dist/product-summary-text.js.map +0 -1
  326. package/dist/product-url-keys.d.ts.map +0 -1
  327. package/dist/product-url-keys.js.map +0 -1
  328. package/dist/product-value-resolver.d.ts.map +0 -1
  329. package/dist/product-value-resolver.js.map +0 -1
  330. package/dist/projects.d.ts.map +0 -1
  331. package/dist/projects.js.map +0 -1
  332. package/dist/promotions.d.ts.map +0 -1
  333. package/dist/promotions.js.map +0 -1
  334. package/dist/prompt-actions.d.ts.map +0 -1
  335. package/dist/prompt-actions.js.map +0 -1
  336. package/dist/pwa.d.ts.map +0 -1
  337. package/dist/pwa.js.map +0 -1
  338. package/dist/quick-order.d.ts.map +0 -1
  339. package/dist/quick-order.js.map +0 -1
  340. package/dist/quote-requests.d.ts.map +0 -1
  341. package/dist/quote-requests.js.map +0 -1
  342. package/dist/record-references.d.ts.map +0 -1
  343. package/dist/record-references.js.map +0 -1
  344. package/dist/record-rich-text.d.ts.map +0 -1
  345. package/dist/record-rich-text.js.map +0 -1
  346. package/dist/returns.d.ts.map +0 -1
  347. package/dist/returns.js.map +0 -1
  348. package/dist/sales-channels.d.ts.map +0 -1
  349. package/dist/sales-channels.js.map +0 -1
  350. package/dist/saved-list-views.d.ts.map +0 -1
  351. package/dist/saved-list-views.js.map +0 -1
  352. package/dist/scope-notice.d.ts.map +0 -1
  353. package/dist/scope-notice.js.map +0 -1
  354. package/dist/scoped-translations.d.ts +0 -48
  355. package/dist/scoped-translations.d.ts.map +0 -1
  356. package/dist/scoped-translations.js +0 -78
  357. package/dist/scoped-translations.js.map +0 -1
  358. package/dist/search.d.ts.map +0 -1
  359. package/dist/search.js.map +0 -1
  360. package/dist/seo.d.ts.map +0 -1
  361. package/dist/seo.js.map +0 -1
  362. package/dist/settings.d.ts.map +0 -1
  363. package/dist/settings.js.map +0 -1
  364. package/dist/shipments.d.ts.map +0 -1
  365. package/dist/shipments.js.map +0 -1
  366. package/dist/shipping-methods.d.ts.map +0 -1
  367. package/dist/shipping-methods.js.map +0 -1
  368. package/dist/shopping-lists.d.ts.map +0 -1
  369. package/dist/shopping-lists.js.map +0 -1
  370. package/dist/storefront-cache-tags.d.ts.map +0 -1
  371. package/dist/storefront-cache-tags.js.map +0 -1
  372. package/dist/storefront-language-path.d.ts.map +0 -1
  373. package/dist/storefront-language-path.js.map +0 -1
  374. package/dist/storefront-value-overrides.d.ts.map +0 -1
  375. package/dist/storefront-value-overrides.js.map +0 -1
  376. package/dist/tasks.d.ts.map +0 -1
  377. package/dist/tasks.js.map +0 -1
  378. package/dist/taxes.d.ts.map +0 -1
  379. package/dist/taxes.js.map +0 -1
  380. package/dist/text-normalization.d.ts.map +0 -1
  381. package/dist/text-normalization.js.map +0 -1
  382. package/dist/transactional-emails.d.ts.map +0 -1
  383. package/dist/transactional-emails.js.map +0 -1
  384. package/dist/webhooks.d.ts.map +0 -1
  385. package/dist/webhooks.js.map +0 -1
package/dist/errors.js CHANGED
@@ -20,6 +20,10 @@ export const ERROR_CODES = {
20
20
  // Owner ruling of 2026-10-25 — a typed unit price with more than four decimal
21
21
  // places (`money-input.ts`). Refused, never rounded.
22
22
  UNIT_PRICE_PRECISION_EXCEEDED: 'UNIT_PRICE_PRECISION_EXCEEDED',
23
+ // Issue #351 — a line quantity past `LINE_QUANTITY_MAX` (`line-bounds.ts`):
24
+ // a request schema's tagged issue (400), or a line a merge or a packaging unit
25
+ // would take past the bound (422). Refused, never clamped.
26
+ LINE_QUANTITY_EXCEEDED: 'LINE_QUANTITY_EXCEEDED',
23
27
  // Catalog
24
28
  FILTER_NOT_ALLOWED: 'FILTER_NOT_ALLOWED',
25
29
  PRODUCT_NOT_FOUND: 'PRODUCT_NOT_FOUND',
@@ -77,6 +81,19 @@ export const ERROR_CODES = {
77
81
  URL_KEY_TAKEN: 'URL_KEY_TAKEN',
78
82
  URL_KEY_REDIRECT_TAKEOVER_REQUIRED: 'URL_KEY_REDIRECT_TAKEOVER_REQUIRED',
79
83
  URL_REDIRECT_NOT_FOUND: 'URL_REDIRECT_NOT_FOUND',
84
+ // Catalog 174 — the three-level scope model and the one write encoding (owned by `catalog`)
85
+ FIELD_NOT_AT_SCOPE: 'FIELD_NOT_AT_SCOPE',
86
+ SCOPED_VALUE_INVALID: 'SCOPED_VALUE_INVALID',
87
+ GLOBAL_ONLY_FIELD: 'GLOBAL_ONLY_FIELD',
88
+ // Import/export 174 — import profiles (owned by `import_export`)
89
+ IMPORT_PROFILE_REQUIRED: 'IMPORT_PROFILE_REQUIRED',
90
+ IMPORT_PROFILE_NOT_FOUND: 'IMPORT_PROFILE_NOT_FOUND',
91
+ IMPORT_PROFILE_NAME_TAKEN: 'IMPORT_PROFILE_NAME_TAKEN',
92
+ /**
93
+ * 405 — the entity is export-only, so its adapter accepts no import
94
+ * (`details.entity`). Raised as `VALIDATION_FAILED` until issue #644 (#86).
95
+ */
96
+ IMPORT_NOT_SUPPORTED: 'IMPORT_NOT_SUPPORTED',
80
97
  // Catalog 002 — Product Links (US4)
81
98
  SELF_LINK_NOT_ALLOWED: 'SELF_LINK_NOT_ALLOWED',
82
99
  LINK_ALREADY_EXISTS: 'LINK_ALREADY_EXISTS',
@@ -93,6 +110,57 @@ export const ERROR_CODES = {
93
110
  MIN_NOT_MET: 'MIN_NOT_MET',
94
111
  MAX_EXCEEDED: 'MAX_EXCEEDED',
95
112
  UNKNOWN_OPTION: 'UNKNOWN_OPTION',
113
+ // Catalog refusals the stored state makes, raised as `VALIDATION_FAILED`
114
+ // until issue #624 (#86). Declared by the `catalog` manifest. Three more
115
+ // sites reuse a code above with a token: `SKU_ALREADY_EXISTS`
116
+ // (`held_by_product`, `held_by_variant`), `PRODUCT_TYPE_MISMATCH`
117
+ // (`variants_need_configurable`) and `SELF_LINK_NOT_ALLOWED` (`grouped`).
118
+ /** 409 — another attribute already has this key (`details.attributeKey`). */
119
+ ATTRIBUTE_KEY_TAKEN: 'ATTRIBUTE_KEY_TAKEN',
120
+ /**
121
+ * 409 — the value type cannot change while products hold values (`details.attributeKey`);
122
+ * token `page_builder` — never to or from Page Builder content (issue #1218).
123
+ */
124
+ ATTRIBUTE_VALUE_TYPE_LOCKED: 'ATTRIBUTE_VALUE_TYPE_LOCKED',
125
+ /**
126
+ * 409 — the attribute is still in use, so it is not deleted: token `attribute_sets`
127
+ * (`details.attributeSetCount`) or `products` (`details.productCount`), with `attributeKey`.
128
+ */
129
+ ATTRIBUTE_IN_USE: 'ATTRIBUTE_IN_USE',
130
+ /** 409 — the attribute already has an option with this value (`details.attributeKey`, `value`). */
131
+ ATTRIBUTE_OPTION_VALUE_TAKEN: 'ATTRIBUTE_OPTION_VALUE_TAKEN',
132
+ /** 409 — a second default option where one is allowed (`details.attributeKey`, `value`). */
133
+ ATTRIBUTE_DEFAULT_OPTION_TAKEN: 'ATTRIBUTE_DEFAULT_OPTION_TAKEN',
134
+ /** 400 — the attribute's type takes no options (`details.attributeKey`, `valueType`). */
135
+ ATTRIBUTE_OPTIONS_NOT_SUPPORTED: 'ATTRIBUTE_OPTIONS_NOT_SUPPORTED',
136
+ /**
137
+ * 409 — products carry the option, so it is not deleted (`details.attributeKey`, `value`;
138
+ * token `products` with `productCount`).
139
+ */
140
+ ATTRIBUTE_OPTION_IN_USE: 'ATTRIBUTE_OPTION_IN_USE',
141
+ /** 400 — the attribute's stored type cannot be shown as a slider (`details.attributeKey`, `valueType`). */
142
+ ATTRIBUTE_SLIDER_NOT_SUPPORTED: 'ATTRIBUTE_SLIDER_NOT_SUPPORTED',
143
+ /** 400 — the product's attribute set requires values it lacks (`details.attributeKeys`, joined). */
144
+ ATTRIBUTE_VALUES_REQUIRED: 'ATTRIBUTE_VALUES_REQUIRED',
145
+ /**
146
+ * 422 — the product's type takes no minimum order quantity (`details.field`
147
+ * `minOrderQuantity`, `productType`; per channel also `channelId`).
148
+ */
149
+ MIN_ORDER_QUANTITY_NOT_SUPPORTED_FOR_TYPE: 'MIN_ORDER_QUANTITY_NOT_SUPPORTED_FOR_TYPE',
150
+ /** 409 — a sibling category already has this slug (`details.slug`, `parentCategoryId`). */
151
+ CATEGORY_SLUG_TAKEN: 'CATEGORY_SLUG_TAKEN',
152
+ /** 409 — the category still has subcategories, so it is not deleted (`details.categoryId`, `childCount`). */
153
+ CATEGORY_HAS_CHILDREN: 'CATEGORY_HAS_CHILDREN',
154
+ /** 409 — a category is moved beneath its own descendant (`details.categoryId`, `parentCategoryId`). */
155
+ CATEGORY_MOVE_CYCLE: 'CATEGORY_MOVE_CYCLE',
156
+ /** 409 — the child is already in the group (`details.parentProductId`, `childProductId`, `childSku`). */
157
+ GROUPED_ITEM_ALREADY_EXISTS: 'GROUPED_ITEM_ALREADY_EXISTS',
158
+ /**
159
+ * 400 — a stored Page Builder content attribute is patched to switch on a capability it
160
+ * holds off (`details.attributeKey`, `capabilities` joined). Issue #1218 (#86); on create
161
+ * the same rule judges the request and stays `VALIDATION_FAILED`.
162
+ */
163
+ CONTENT_ATTRIBUTE_CAPABILITY_LOCKED: 'CONTENT_ATTRIBUTE_CAPABILITY_LOCKED',
96
164
  // Quote Requests (RFQ)
97
165
  RFQ_NOT_DRAFT: 'RFQ_NOT_DRAFT',
98
166
  RFQ_EMPTY: 'RFQ_EMPTY',
@@ -113,6 +181,14 @@ export const ERROR_CODES = {
113
181
  // request resolved when none is named (owner decision 2026-10-29 "A") — is not
114
182
  // one of the Organization's active channels.
115
183
  RFQ_SALES_CHANNEL_NOT_ALLOWED: 'RFQ_SALES_CHANNEL_NOT_ALLOWED',
184
+ // Quick order — one-click buy (issue #641, #86). `422 VALIDATION_FAILED` with
185
+ // `details.code: 'one_click_unavailable'` until then.
186
+ /**
187
+ * 422 — one-click buy is not available to the buyer. `details.code` is the
188
+ * eligibility reason (`setting_disabled`, `missing_defaults`), repeated as
189
+ * `details.reason`.
190
+ */
191
+ ONE_CLICK_UNAVAILABLE: 'ONE_CLICK_UNAVAILABLE',
116
192
  QUOTE_INCOMPLETE: 'QUOTE_INCOMPLETE',
117
193
  QUOTE_VALIDITY_ENDED: 'QUOTE_VALIDITY_ENDED',
118
194
  // Quote PDF by e-mail (`specs/153-quote-request-pdf-template/`, owner answer
@@ -131,11 +207,39 @@ export const ERROR_CODES = {
131
207
  SHOPPING_LIST_CANNOT_DELETE_LAST: 'SHOPPING_LIST_CANNOT_DELETE_LAST',
132
208
  // Organizations / customer accounts
133
209
  ORGANIZATION_TAX_ID_EXISTS: 'ORGANIZATION_TAX_ID_EXISTS',
210
+ // `specs/177-tax-id-scope/` — switching the tax-ID scope to `global` while a
211
+ // tax ID is on more than one organization (409, `details.code = 'shared_tax_ids'`).
212
+ ORGANIZATION_TAX_ID_SCOPE_DUPLICATES: 'ORGANIZATION_TAX_ID_SCOPE_DUPLICATES',
213
+ // `specs/177-tax-id-scope/` — a personal → company conversion refused (409,
214
+ // `details.code` = `not_personal` | `deleted` | `owner_not_administrator`).
215
+ ORGANIZATION_CONVERSION_REFUSED: 'ORGANIZATION_CONVERSION_REFUSED',
216
+ // Issue #1040 — an operator's tax-ID correction refused (409, `details.code` =
217
+ // `not_company` | `deleted`).
218
+ ORGANIZATION_TAX_ID_CHANGE_REFUSED: 'ORGANIZATION_TAX_ID_CHANGE_REFUSED',
219
+ // `specs/177-tax-id-scope/` — a write of organizations lost a lock to a
220
+ // concurrent one (the tax-ID scope swap, or a racing writer); retry (409).
221
+ ORGANIZATION_WRITE_CONTENDED: 'ORGANIZATION_WRITE_CONTENDED',
134
222
  // Feature 056 — deletion of a parent with children is blocked (reassign /
135
223
  // remove children first). Backed by the `parent_id ON DELETE RESTRICT` FK.
136
224
  ORGANIZATION_HAS_CHILDREN: 'ORGANIZATION_HAS_CHILDREN',
137
225
  // Feature 056 — a re-parent would create a cycle or exceed the depth bound.
138
226
  ORGANIZATION_TREE_INVALID: 'ORGANIZATION_TREE_INVALID',
227
+ // Feature 170 — organization roles and permissions (`specs/170-organization-roles/`,
228
+ // `contracts/organization-permission-port.md` §3). Declared by `organizations`.
229
+ // A member's role lacks the organization permission a buyer action needs (403).
230
+ ORGANIZATION_PERMISSION_REQUIRED: 'ORGANIZATION_PERMISSION_REQUIRED',
231
+ // A custom role's name is another role's, or a predefined role's label (409).
232
+ ORGANIZATION_ROLE_NAME_TAKEN: 'ORGANIZATION_ROLE_NAME_TAKEN',
233
+ // A role write carried an `expectedVersion` that is no longer current (409).
234
+ ORGANIZATION_ROLE_STALE: 'ORGANIZATION_ROLE_STALE',
235
+ // The Organization already holds the maximum number of custom roles (422).
236
+ ORGANIZATION_ROLE_LIMIT_REACHED: 'ORGANIZATION_ROLE_LIMIT_REACHED',
237
+ // An edit, rename or delete a predefined role does not allow (409).
238
+ ORGANIZATION_ROLE_PROTECTED: 'ORGANIZATION_ROLE_PROTECTED',
239
+ // Deleting a role somebody holds needs a different replacement role (422).
240
+ ORGANIZATION_ROLE_REPLACEMENT_REQUIRED: 'ORGANIZATION_ROLE_REPLACEMENT_REQUIRED',
241
+ // A submitted permission code no module declares (422).
242
+ ORGANIZATION_PERMISSION_UNKNOWN: 'ORGANIZATION_PERMISSION_UNKNOWN',
139
243
  EMAIL_ALREADY_REGISTERED: 'EMAIL_ALREADY_REGISTERED',
140
244
  EMAIL_ALREADY_IN_ORGANIZATION: 'EMAIL_ALREADY_IN_ORGANIZATION',
141
245
  EMAIL_BELONGS_TO_ANOTHER_ORGANIZATION: 'EMAIL_BELONGS_TO_ANOTHER_ORGANIZATION',
@@ -158,11 +262,22 @@ export const ERROR_CODES = {
158
262
  REGISTRATION_REQUIRES_ORGANIZATION: 'REGISTRATION_REQUIRES_ORGANIZATION',
159
263
  ACCOUNT_BLOCKED: 'ACCOUNT_BLOCKED',
160
264
  CUSTOMER_NOT_FOUND: 'CUSTOMER_NOT_FOUND',
161
- CUSTOMER_ADDRESS_NOT_FOUND: 'CUSTOMER_ADDRESS_NOT_FOUND',
265
+ /**
266
+ * `specs/173-b2c-address-book-merge/` release 1 (OD-8): every former
267
+ * personal-address-book endpoint answers `410 Gone` with this code. The one
268
+ * address book is the customer's Organization's. Removed in release 2.
269
+ */
270
+ CUSTOMER_ADDRESS_BOOK_RETIRED: 'CUSTOMER_ADDRESS_BOOK_RETIRED',
162
271
  CUSTOMER_ALREADY_DELETED: 'CUSTOMER_ALREADY_DELETED',
163
272
  CUSTOMER_NOT_DELETED: 'CUSTOMER_NOT_DELETED',
164
273
  CUSTOMER_RESTORE_WINDOW_ELAPSED: 'CUSTOMER_RESTORE_WINDOW_ELAPSED',
165
274
  ORG_OWNER_DEPLETION: 'ORG_OWNER_DEPLETION',
275
+ /**
276
+ * Issue #652 (D-292): `PATCH /api/v1/me/customer/preferred-language` names a
277
+ * language the request's sales channel does not offer (422). Owned by
278
+ * `customers`.
279
+ */
280
+ PREFERRED_LANGUAGE_NOT_OFFERED: 'PREFERRED_LANGUAGE_NOT_OFFERED',
166
281
  // Orders + Carts (feature 027)
167
282
  CART_EMPTY: 'CART_EMPTY',
168
283
  CART_LINE_CAP_EXCEEDED: 'CART_LINE_CAP_EXCEEDED',
@@ -179,13 +294,106 @@ export const ERROR_CODES = {
179
294
  * the buyer reviews it before placing again.
180
295
  */
181
296
  CART_PRICE_CHANGED: 'CART_PRICE_CHANGED',
297
+ // Issue #86 — the cart-approval and admin-reject refusals, raised as
298
+ // `VALIDATION_FAILED` with a machine token as the message until then.
299
+ /**
300
+ * The buyer's role holds `carts.order_without_approval`, so the cart is not
301
+ * sent for approval (`specs/170-organization-roles/`; was: the Organization
302
+ * requires no approval).
303
+ */
304
+ CART_APPROVAL_NOT_REQUIRED: 'CART_APPROVAL_NOT_REQUIRED',
305
+ /** The cart has already been sent for approval (`details.approvalStatus`). */
306
+ CART_APPROVAL_ALREADY_SUBMITTED: 'CART_APPROVAL_ALREADY_SUBMITTED',
307
+ /**
308
+ * An approver may not approve or reject their own pending cart
309
+ * (`specs/170-organization-roles/` FR-032, R-36; `details.cartId`). A cart that
310
+ * is not pending is refused `CART_APPROVAL_NOT_PENDING` first.
311
+ */
312
+ CART_APPROVAL_SELF_APPROVE: 'CART_APPROVAL_SELF_APPROVE',
313
+ /** The cart is not awaiting approval, so it cannot be approved or rejected (`details.approvalStatus`). */
314
+ CART_APPROVAL_NOT_PENDING: 'CART_APPROVAL_NOT_PENDING',
315
+ /** The cart is already completed or rejected, so it cannot be rejected (`details.status`). */
316
+ CART_ALREADY_TERMINAL: 'CART_ALREADY_TERMINAL',
182
317
  STOCK_UNAVAILABLE: 'STOCK_UNAVAILABLE',
183
318
  PROMOTION_INVALID: 'PROMOTION_INVALID',
319
+ // Seven `promotions` refusals raised as `VALIDATION_FAILED` with a machine token
320
+ // glued to an English message until issue #628 (#86). Declared by the
321
+ // `promotions` manifest.
322
+ /**
323
+ * 409 — a promotion's usage limit was reached between the cart and placement
324
+ * (`details.promotionId`; with a coupon, token `with_coupon` and `couponCode`).
325
+ */
326
+ PROMOTION_USAGE_LIMIT_REACHED: 'PROMOTION_USAGE_LIMIT_REACHED',
327
+ /** 409 — another coupon already has this code (`details.couponCode`). */
328
+ PROMOTION_COUPON_CODE_TAKEN: 'PROMOTION_COUPON_CODE_TAKEN',
329
+ /** 400 — the length and format hold fewer unique codes than asked for (`details.requested`, `generated`). */
330
+ PROMOTION_COUPON_SPACE_EXHAUSTED: 'PROMOTION_COUPON_SPACE_EXHAUSTED',
331
+ /** 409 — another named promotion rule already has this name (`details.name`). */
332
+ PROMOTION_RULE_NAME_TAKEN: 'PROMOTION_RULE_NAME_TAKEN',
333
+ /** 409 — a named rule promotions use is not deleted (`details.ruleId`, `promotionCount`). */
334
+ PROMOTION_RULE_IN_USE: 'PROMOTION_RULE_IN_USE',
335
+ /** 400 — a criterion names an attribute not flagged usable in promotion rules (`details.attributeKey`). */
336
+ PROMOTION_ATTRIBUTE_NOT_ELIGIBLE: 'PROMOTION_ATTRIBUTE_NOT_ELIGIBLE',
184
337
  ORGANIZATION_SUSPENDED: 'ORGANIZATION_SUSPENDED',
185
338
  ORDER_NOT_FOUND: 'ORDER_NOT_FOUND',
186
339
  ORDER_NOT_CANCELLABLE: 'ORDER_NOT_CANCELLABLE',
340
+ // Issue #86 — order-path refusals raised as `VALIDATION_FAILED` with an
341
+ // English sentence until then.
342
+ /**
343
+ * The chosen delivery method cannot be used for this order: not active, not
344
+ * usable on this surface, outside the Organization's allow-list
345
+ * (`details.code = 'delivery_method_not_allowed_for_organization'`) or not
346
+ * offered in the order's sales channel (`'delivery_method_not_in_sales_channel'`).
347
+ */
348
+ ORDER_DELIVERY_METHOD_UNAVAILABLE: 'ORDER_DELIVERY_METHOD_UNAVAILABLE',
349
+ /** The payment twin of `ORDER_DELIVERY_METHOD_UNAVAILABLE`, with the `payment_method_…` tokens. */
350
+ ORDER_PAYMENT_METHOD_UNAVAILABLE: 'ORDER_PAYMENT_METHOD_UNAVAILABLE',
351
+ /** The basket is below the channel's minimum order value (`details.minimum`, `subtotal`, `currency`). */
352
+ ORDER_BELOW_MINIMUM_VALUE: 'ORDER_BELOW_MINIMUM_VALUE',
353
+ /** The order is in a terminal status, so it takes no more comments. */
354
+ ORDER_COMMENTS_CLOSED: 'ORDER_COMMENTS_CLOSED',
355
+ /** The order has no lines, so there is nothing to copy into a quote request. */
356
+ ORDER_CLONE_NO_LINES: 'ORDER_CLONE_NO_LINES',
357
+ // The admin's order-status configuration and the external API intake (issue
358
+ // #627, #86), raised as `VALIDATION_FAILED` with an English sentence until
359
+ // then. The status code travels as `details.statusCode`: `details.code` is the
360
+ // envelope's refusal-token slot. `returns` mints the `RETURN_STATUS_*` twins.
361
+ /** 409 — another order status already has this code (`details.statusCode`). */
362
+ ORDER_STATUS_CODE_TAKEN: 'ORDER_STATUS_CODE_TAKEN',
363
+ /**
364
+ * 409 / 422 — a terminal status cannot have outgoing transitions: marking a
365
+ * status with them terminal (token `mark_terminal`, `details.outgoingCount`) or
366
+ * adding one from a terminal status (token `add_transition`, `details.toStatusCode`).
367
+ */
368
+ ORDER_STATUS_TERMINAL_HAS_TRANSITIONS: 'ORDER_STATUS_TERMINAL_HAS_TRANSITIONS',
369
+ /** 409 — the initial (token `initial`) or a system (token `system`) status is not deleted. */
370
+ ORDER_STATUS_NOT_DELETABLE: 'ORDER_STATUS_NOT_DELETABLE',
371
+ /** 409 — orders are in the status, so it is not deleted (`details.statusCode`, `orderCount`). */
372
+ ORDER_STATUS_IN_USE: 'ORDER_STATUS_IN_USE',
373
+ /**
374
+ * 422 — the external API intake refused one or more lines; `details` stays the
375
+ * per-line array of `{ path, issue, sku }` (`SKU_NOT_IN_ASSORTMENT`, `PRICE_UNAVAILABLE`).
376
+ */
377
+ ORDER_INTAKE_LINES_REFUSED: 'ORDER_INTAKE_LINES_REFUSED',
378
+ /** 409 — another intake for the same API key holds its lock; retry with the same Idempotency-Key. */
379
+ ORDER_INTAKE_BUSY: 'ORDER_INTAKE_BUSY',
187
380
  /** 422 — the basket handed to placement belongs to another sales channel (feature 154). */
188
381
  ORDER_SALES_CHANNEL_MISMATCH: 'ORDER_SALES_CHANNEL_MISMATCH',
382
+ /**
383
+ * 422 — the sales channel of an order an operator creates on a customer's
384
+ * behalf (`POST /api/v1/admin/orders`, and its `/preview`) is not one of the
385
+ * customer's Organization's active assigned channels — an unassigned, an
386
+ * inactive or a nonexistent one alike (issue #515).
387
+ */
388
+ ORDER_SALES_CHANNEL_NOT_ALLOWED: 'ORDER_SALES_CHANNEL_NOT_ALLOWED',
389
+ /**
390
+ * 409 — the basket's Organization requires cart approval, its owner is not
391
+ * the Organization administrator and the basket is not `approved` (issue
392
+ * #648). `details: { code, cartId, approvalStatus }`, the token
393
+ * `cart_approval_not_submitted`, `cart_approval_pending` or
394
+ * `cart_approval_rejected`.
395
+ */
396
+ ORDER_CART_APPROVAL_REQUIRED: 'ORDER_CART_APPROVAL_REQUIRED',
189
397
  // Saved list views (`specs/147-saved-views/`, FR-022) — an admin already
190
398
  // holds a view on the order list whose name differs only by case or
191
399
  // surrounding spaces.
@@ -202,11 +410,92 @@ export const ERROR_CODES = {
202
410
  // invoiced has no sale left to document (issue #417, owner ruling of
203
411
  // 2026-10-24), so issuance refuses it.
204
412
  INVOICE_ORDER_REFUNDED: 'INVOICE_ORDER_REFUNDED',
413
+ // Invoices — business refusals of issuance and correction (issue #633, #86),
414
+ // `VALIDATION_FAILED` with an English sentence until then.
415
+ /** 422 — the seller's VAT number and company data are not configured (`details.setting`). */
416
+ INVOICE_SELLER_DATA_MISSING: 'INVOICE_SELLER_DATA_MISSING',
417
+ /**
418
+ * 422 — a correction asked for in another currency than the corrected
419
+ * invoice's (`details.requestedCurrency`, `invoiceCurrency`, `originalInvoiceId`).
420
+ */
421
+ INVOICE_CORRECTION_CURRENCY_MISMATCH: 'INVOICE_CORRECTION_CURRENCY_MISMATCH',
422
+ /**
423
+ * 400 — the correction total is more than its lines add up to, or (token
424
+ * `below_charges`) less than the charges it credits (`details.total`,
425
+ * `linesTotal`, `currency`).
426
+ */
427
+ INVOICE_CORRECTION_TOTAL_EXCEEDS_LINES: 'INVOICE_CORRECTION_TOTAL_EXCEEDS_LINES',
428
+ /**
429
+ * 422 — the correction credits more goods at one VAT rate than the invoice
430
+ * still charges there (`details.taxRate`, `vatRatePercent`, `remaining`, `currency`).
431
+ */
432
+ INVOICE_CORRECTION_EXCEEDS_RATE_REMAINING: 'INVOICE_CORRECTION_EXCEEDS_RATE_REMAINING',
433
+ /**
434
+ * 422 — the correction credits more of an order charge than the invoice still
435
+ * charges for it; the token is the charge, `delivery` or `payment_surcharge`
436
+ * (`details.chargeKind`, `remaining`, `currency`).
437
+ */
438
+ INVOICE_CORRECTION_EXCEEDS_CHARGE_REMAINING: 'INVOICE_CORRECTION_EXCEEDS_CHARGE_REMAINING',
205
439
  INVALID_TRANSITION: 'INVALID_TRANSITION',
206
440
  // Returns 155 — a `return`-kind case naming an order line recorded as not
207
441
  // returnable at purchase (owned and raised by `returns`; complaints are
208
442
  // never refused by it).
209
443
  RETURN_LINE_NOT_RETURNABLE: 'RETURN_LINE_NOT_RETURNABLE',
444
+ // Saved list views (#312, the rules of `specs/147-saved-views/` FR-022) — an
445
+ // admin already holds a view on the return list whose name differs only by
446
+ // case or surrounding spaces.
447
+ RETURN_SAVED_VIEW_NAME_TAKEN: 'RETURN_SAVED_VIEW_NAME_TAKEN',
448
+ // Shipments (issue #637, #86) — the module's first code. Generating a shipment
449
+ // for an order that already has a successful one, and marking a successful
450
+ // shipment failed, were `409 VALIDATION_FAILED` with an English literal.
451
+ /**
452
+ * 409 — the shipment, or the order's latest one, was already generated
453
+ * successfully. `details.code` names the refused write: `generate`
454
+ * (`details.orderId`, `shipmentId`) or `mark_failed` (`details.shipmentId`,
455
+ * `orderId`, `status`).
456
+ */
457
+ SHIPMENT_ALREADY_GENERATED: 'SHIPMENT_ALREADY_GENERATED',
458
+ // Issue #905 — a consumer withdrawal settled as a credit, a replacement or a
459
+ // repair without the consumer's consent to that resolution on record.
460
+ RETURN_ALTERNATIVE_RESOLUTION_CONSENT_REQUIRED: 'RETURN_ALTERNATIVE_RESOLUTION_CONSENT_REQUIRED',
461
+ // Returns — business-state refusals raised as `VALIDATION_FAILED` until issue
462
+ // #625 (#86): the buyer's request, the closed case, settlement and the
463
+ // admin's return-status configuration. The status code travels as
464
+ // `details.statusCode`: `details.code` is the envelope's refusal-token slot.
465
+ /** 422 — the order is not completed yet, so it takes no return (`details.orderId`). */
466
+ RETURN_ORDER_NOT_ELIGIBLE: 'RETURN_ORDER_NOT_ELIGIBLE',
467
+ /** 422 — more is asked for than the line can still return (`details.orderItemId`, `requested`, `remaining`). */
468
+ RETURN_QUANTITY_EXCEEDS_RETURNABLE: 'RETURN_QUANTITY_EXCEEDS_RETURNABLE',
469
+ /** 422 — the chosen reason exists but is switched off (`details.reasonId`); an unknown one stays `VALIDATION_FAILED`. */
470
+ RETURN_REASON_INACTIVE: 'RETURN_REASON_INACTIVE',
471
+ /** 409 — the case is in a terminal status, so it takes no more comments (`details.returnCaseId`, `statusCode`). */
472
+ RETURN_COMMENTS_CLOSED: 'RETURN_COMMENTS_CLOSED',
473
+ /** 409 — the case is in a terminal status, so it takes no delivery method (`details.returnCaseId`, `statusCode`). */
474
+ RETURN_CASE_CLOSED: 'RETURN_CASE_CLOSED',
475
+ /** 422 — the return delivery method is not offered (`details.returnDeliveryMethodId`). */
476
+ RETURN_DELIVERY_METHOD_UNAVAILABLE: 'RETURN_DELIVERY_METHOD_UNAVAILABLE',
477
+ /** 409 — another return of the order is being settled; retryable (`details.orderId`). */
478
+ RETURN_SETTLEMENT_IN_PROGRESS: 'RETURN_SETTLEMENT_IN_PROGRESS',
479
+ /**
480
+ * 422 — a refund above what may be refunded, for a line (`details.returnCaseItemId`)
481
+ * or a charge (token `delivery` / `surcharge`); `requested`, `maximum` as
482
+ * two-decimal strings and `currency`.
483
+ */
484
+ RETURN_REFUND_EXCEEDS_PAID: 'RETURN_REFUND_EXCEEDS_PAID',
485
+ /** 502 — the payment gateway refused the refund (`details.settlementState`, `failureReason`, `providerDetails`). */
486
+ RETURN_REFUND_GATEWAY_FAILED: 'RETURN_REFUND_GATEWAY_FAILED',
487
+ /** 409 — another return status already has this code (`details.statusCode`). */
488
+ RETURN_STATUS_CODE_TAKEN: 'RETURN_STATUS_CODE_TAKEN',
489
+ /**
490
+ * 409 / 422 — a terminal status cannot have outgoing transitions: marking a
491
+ * status with them terminal (token `mark_terminal`, `details.outgoingCount`) or
492
+ * adding one from a terminal status (token `add_transition`, `details.toStatusCode`).
493
+ */
494
+ RETURN_STATUS_TERMINAL_HAS_TRANSITIONS: 'RETURN_STATUS_TERMINAL_HAS_TRANSITIONS',
495
+ /** 409 — the initial status (token `initial`) is not deleted (`details.statusCode`). */
496
+ RETURN_STATUS_NOT_DELETABLE: 'RETURN_STATUS_NOT_DELETABLE',
497
+ /** 409 — cases are in the status, so it is not deleted (`details.statusCode`, `caseCount`). */
498
+ RETURN_STATUS_IN_USE: 'RETURN_STATUS_IN_USE',
210
499
  // Credit Limit
211
500
  CREDIT_LIMIT_NOT_GRANTED: 'CREDIT_LIMIT_NOT_GRANTED',
212
501
  CREDIT_LIMIT_ALREADY_GRANTED: 'CREDIT_LIMIT_ALREADY_GRANTED',
@@ -216,6 +505,27 @@ export const ERROR_CODES = {
216
505
  ACTIVE_RESERVATIONS_EXIST: 'ACTIVE_RESERVATIONS_EXIST',
217
506
  ALREADY_SUBSCRIBED: 'ALREADY_SUBSCRIBED',
218
507
  PRODUCT_IN_STOCK: 'PRODUCT_IN_STOCK',
508
+ // Newsletter — the admin refusals that were `VALIDATION_FAILED` with an
509
+ // English literal until issue #626 (#86). None carries a `details.code`
510
+ // token: each code is one refusal.
511
+ /** 422 — an active automation cannot be edited; pause it first (`details.automationId`, `status`). */
512
+ NEWSLETTER_AUTOMATION_ACTIVE: 'NEWSLETTER_AUTOMATION_ACTIVE',
513
+ /** 422 — only a draft or scheduled campaign can be edited (`details.campaignId`, `status`). */
514
+ NEWSLETTER_CAMPAIGN_NOT_EDITABLE: 'NEWSLETTER_CAMPAIGN_NOT_EDITABLE',
515
+ /** 422 — only a draft or scheduled campaign can be cancelled (`details.campaignId`, `status`). */
516
+ NEWSLETTER_CAMPAIGN_NOT_CANCELLABLE: 'NEWSLETTER_CAMPAIGN_NOT_CANCELLABLE',
517
+ /** 422 — a campaign cannot be sent while no sending provider is configured. */
518
+ NEWSLETTER_PROVIDER_NOT_CONFIGURED: 'NEWSLETTER_PROVIDER_NOT_CONFIGURED',
519
+ /** 409 — a custom field with this key already exists (`details.key`). */
520
+ NEWSLETTER_CUSTOM_FIELD_KEY_TAKEN: 'NEWSLETTER_CUSTOM_FIELD_KEY_TAKEN',
521
+ /** 409 — an email block with this code already exists (`details.blockCode`). */
522
+ NEWSLETTER_EMAIL_BLOCK_CODE_TAKEN: 'NEWSLETTER_EMAIL_BLOCK_CODE_TAKEN',
523
+ /** 422 — a system email block cannot be deleted (`details.blockId`, `blockCode`). */
524
+ NEWSLETTER_EMAIL_BLOCK_SYSTEM: 'NEWSLETTER_EMAIL_BLOCK_SYSTEM',
525
+ /** 409 — a tag with this code already exists (`details.tagCode`). */
526
+ NEWSLETTER_TAG_CODE_TAKEN: 'NEWSLETTER_TAG_CODE_TAKEN',
527
+ /** 409 — a campaign or an automation uses the tag, so it cannot be deleted (`details.tagId`, `tagCode`). */
528
+ NEWSLETTER_TAG_IN_USE: 'NEWSLETTER_TAG_IN_USE',
219
529
  // API keys / webhooks / integrations
220
530
  API_KEY_OUT_OF_SCOPE: 'API_KEY_OUT_OF_SCOPE',
221
531
  /** An administrator asked for an API key scope their own role does not hold. */
@@ -229,6 +539,14 @@ export const ERROR_CODES = {
229
539
  // Distributor API (feature 062)
230
540
  API_KEY_NOT_BOUND: 'API_KEY_NOT_BOUND',
231
541
  API_KEY_CHANNEL_MISMATCH: 'API_KEY_CHANNEL_MISMATCH',
542
+ /**
543
+ * 422 — the bound key's service account exists in the bound organization but
544
+ * is blocked (token `blocked`) or deleted / anonymized (token `removed`)
545
+ * (`details.field`, `customerAccountId`, `organizationId`). Raised only when
546
+ * it is the sole binding problem; otherwise the aggregate `VALIDATION_FAILED`
547
+ * lists it (issue #644, #86).
548
+ */
549
+ API_KEY_SERVICE_ACCOUNT_INACTIVE: 'API_KEY_SERVICE_ACCOUNT_INACTIVE',
232
550
  IDEMPOTENCY_KEY_REQUIRED: 'IDEMPOTENCY_KEY_REQUIRED',
233
551
  IDEMPOTENCY_KEY_REUSED: 'IDEMPOTENCY_KEY_REUSED',
234
552
  SKU_NOT_IN_ASSORTMENT: 'SKU_NOT_IN_ASSORTMENT',
@@ -356,7 +674,6 @@ export const ERROR_CODES = {
356
674
  ASSET_LEGACY_LOCATOR_CANNOT_HARDEN: 'ASSET_LEGACY_LOCATOR_CANNOT_HARDEN',
357
675
  ASSET_FILE_MISSING: 'ASSET_FILE_MISSING',
358
676
  ASSET_GONE: 'ASSET_GONE',
359
- ASSET_ACCESS_DENIED: 'ASSET_ACCESS_DENIED',
360
677
  // Assets Library — stable asset URLs (specs/156-asset-stable-url/)
361
678
  ASSET_REPLACE_KIND_MISMATCH: 'ASSET_REPLACE_KIND_MISMATCH',
362
679
  ASSET_LEGACY_CANNOT_REPLACE: 'ASSET_LEGACY_CANNOT_REPLACE',
@@ -404,6 +721,12 @@ export const ERROR_CODES = {
404
721
  MEGAMENU_LANGUAGE_NOT_IN_CHANNEL_SCOPE: 'MEGAMENU_LANGUAGE_NOT_IN_CHANNEL_SCOPE',
405
722
  MEGAMENU_TARGET_OUT_OF_SCOPE: 'MEGAMENU_TARGET_OUT_OF_SCOPE',
406
723
  MEGAMENU_ASSET_KIND_MISMATCH: 'MEGAMENU_ASSET_KIND_MISMATCH',
724
+ /**
725
+ * 400 — a free-URL asset item: importing an asset from a URL is not supported
726
+ * yet, so the asset is uploaded to the Assets Library and referenced by id
727
+ * (`details.itemId`). `VALIDATION_FAILED` until issue #640 (#86).
728
+ */
729
+ MEGAMENU_ASSET_URL_UNSUPPORTED: 'MEGAMENU_ASSET_URL_UNSUPPORTED',
407
730
  MEGAMENU_REFERENCED: 'MEGAMENU_REFERENCED',
408
731
  MEGAMENU_DEPTH_EXCEEDED: 'MEGAMENU_DEPTH_EXCEEDED',
409
732
  // Feature 168 — the navigation bar's tree rules (data-model §3).
@@ -427,6 +750,18 @@ export const ERROR_CODES = {
427
750
  BLOG_TAG_IN_USE: 'BLOG_TAG_IN_USE',
428
751
  BLOG_URL_PREFIX_INVALID: 'BLOG_URL_PREFIX_INVALID',
429
752
  BLOG_URL_PREFIX_RESERVED: 'BLOG_URL_PREFIX_RESERVED',
753
+ // Feature 171 — a prefix equal to a language prefix or a CMS page's first segment; a former prefix to forget that is not one.
754
+ BLOG_URL_PREFIX_CONFLICT: 'BLOG_URL_PREFIX_CONFLICT',
755
+ BLOG_URL_PREFIX_NOT_FOUND: 'BLOG_URL_PREFIX_NOT_FOUND',
756
+ // Feature 171 — a post or category not written in every language assigned to it.
757
+ BLOG_LANGUAGE_INCOMPLETE: 'BLOG_LANGUAGE_INCOMPLETE',
758
+ // Feature 171 — an author's avatar names no library asset, and a post's author no active administrator.
759
+ ADMIN_USER_AVATAR_NOT_FOUND: 'ADMIN_USER_AVATAR_NOT_FOUND',
760
+ BLOG_AUTHOR_NOT_FOUND: 'BLOG_AUTHOR_NOT_FOUND',
761
+ // Feature 171 — per-language URL keys of posts and categories.
762
+ BLOG_URL_KEY_TAKEN: 'BLOG_URL_KEY_TAKEN',
763
+ BLOG_URL_KEY_REDIRECT_TAKEOVER_REQUIRED: 'BLOG_URL_KEY_REDIRECT_TAKEOVER_REQUIRED',
764
+ BLOG_URL_REDIRECT_NOT_FOUND: 'BLOG_URL_REDIRECT_NOT_FOUND',
430
765
  BLOG_DISABLED: 'BLOG_DISABLED',
431
766
  BLOG_ASSET_KIND_MISMATCH: 'BLOG_ASSET_KIND_MISMATCH',
432
767
  BLOG_RELATED_POST_SELF_REFERENCE: 'BLOG_RELATED_POST_SELF_REFERENCE',
@@ -441,8 +776,23 @@ export const ERROR_CODES = {
441
776
  DICTIONARY_FALLBACK_CYCLE: 'DICTIONARY_FALLBACK_CYCLE',
442
777
  DICTIONARY_CODE_IMMUTABLE: 'DICTIONARY_CODE_IMMUTABLE',
443
778
  DICTIONARY_TRANSLATION_LANGUAGE_INACTIVE: 'DICTIONARY_TRANSLATION_LANGUAGE_INACTIVE',
779
+ // Issue #643 (#86) — raised by `dictionaries` (countries), `currencies` and
780
+ // `languages`, `409 VALIDATION_FAILED` until then. `details.code` names the
781
+ // dictionary (`country`, `currency`, `language`); the entry's own code is
782
+ // `details.entryCode`.
783
+ /** 409 — an entry with this code already exists in the dictionary. */
784
+ DICTIONARY_ENTRY_CODE_TAKEN: 'DICTIONARY_ENTRY_CODE_TAKEN',
785
+ /** 409 — an inactive entry cannot be made the dictionary's default. */
786
+ DICTIONARY_DEFAULT_ENTRY_INACTIVE: 'DICTIONARY_DEFAULT_ENTRY_INACTIVE',
444
787
  // Module Lifecycle (feature 018)
445
788
  MODULE_DISABLED: 'MODULE_DISABLED',
789
+ // Command hooks (`specs/176-command-hooks-outbox/` P2) — the platform's answer
790
+ // to a misused hook seam; `command-hooks.ts` documents each.
791
+ COMMAND_EXTENSION_UNCLAIMED: 'COMMAND_EXTENSION_UNCLAIMED',
792
+ COMMAND_HOOK_CYCLE: 'COMMAND_HOOK_CYCLE',
793
+ COMMAND_HOOK_DATA_MISSING: 'COMMAND_HOOK_DATA_MISSING',
794
+ /** A retry of a command outbox row that is not dead (176 P4): only a failed delivery can be retried. */
795
+ COMMAND_OUTBOX_NOT_DEAD: 'COMMAND_OUTBOX_NOT_DEAD',
446
796
  // Module Lifecycle (feature 073 — operator activation)
447
797
  /** No manifest and no registry row answer to this module id. */
448
798
  MODULE_NOT_FOUND: 'MODULE_NOT_FOUND',
@@ -481,8 +831,19 @@ export const ERROR_CODES = {
481
831
  * same "there is nothing here to switch, ever", same carried reason.
482
832
  */
483
833
  TRANSACTIONAL_EMAIL_NOT_DEACTIVATABLE: 'TRANSACTIONAL_EMAIL_NOT_DEACTIVATABLE',
834
+ // A system block or template that cannot be deleted (issue #638, #86).
835
+ // Raised as `VALIDATION_FAILED` with an English sentence until then.
836
+ /** 409 — a system email block cannot be deleted (`details.blockId`, `blockCode`). */
837
+ TRANSACTIONAL_EMAIL_SYSTEM_BLOCK: 'TRANSACTIONAL_EMAIL_SYSTEM_BLOCK',
838
+ /** 409 — a system email template cannot be deleted (`details.templateId`, `templateCode`). */
839
+ TRANSACTIONAL_EMAIL_SYSTEM_TEMPLATE: 'TRANSACTIONAL_EMAIL_SYSTEM_TEMPLATE',
484
840
  // Catalog (feature 022 — Products Bulk Edit)
485
841
  BULK_TOO_LARGE: 'BULK_TOO_LARGE',
842
+ // Issue #501 — why an undo of a bulk operation is refused (409), one code per
843
+ // reason: still in flight, already undone, or nothing it can restore.
844
+ BULK_OPERATION_RUNNING: 'BULK_OPERATION_RUNNING',
845
+ BULK_OPERATION_ALREADY_REVERTED: 'BULK_OPERATION_ALREADY_REVERTED',
846
+ BULK_OPERATION_NOT_REVERSIBLE: 'BULK_OPERATION_NOT_REVERSIBLE',
486
847
  ATTRIBUTE_NOT_MASS_EDITABLE: 'ATTRIBUTE_NOT_MASS_EDITABLE',
487
848
  // Catalog (feature 033 — Products collection selection)
488
849
  SELECTION_TOO_LARGE: 'SELECTION_TOO_LARGE',
@@ -492,6 +853,19 @@ export const ERROR_CODES = {
492
853
  * with a second factor; the requirement is turned off first.
493
854
  */
494
855
  MFA_DEACTIVATION_BLOCKED: 'MFA_DEACTIVATION_BLOCKED',
856
+ /**
857
+ * A role cannot start requiring a second factor that this instance cannot
858
+ * enrol: `mfa` is off, or has no encryption key (issue #349). Raised by
859
+ * `admin_users`' role write; `details.reason` says which.
860
+ */
861
+ MFA_REQUIRED_FOR_ROLE_TWO_FACTOR: 'MFA_REQUIRED_FOR_ROLE_TWO_FACTOR',
862
+ /**
863
+ * Administrators cannot be required to use a second factor that this
864
+ * instance cannot enrol: `mfa` has no encryption key (issue #930). Raised by
865
+ * the `mfa.admin.totp_enforced` write; `details.reason` is
866
+ * `encryption_key_missing`.
867
+ */
868
+ MFA_ENFORCEMENT_UNAVAILABLE: 'MFA_ENFORCEMENT_UNAVAILABLE',
495
869
  MFA_INVALID_CODE: 'MFA_INVALID_CODE',
496
870
  MFA_INVALID_CHALLENGE: 'MFA_INVALID_CHALLENGE',
497
871
  MFA_TOO_MANY_ATTEMPTS: 'MFA_TOO_MANY_ATTEMPTS',
@@ -505,6 +879,21 @@ export const ERROR_CODES = {
505
879
  // credential is refused: an account created by a social sign-in holds a
506
880
  // random password nobody knows, so the link is the way back in.
507
881
  MFA_SOCIAL_LAST_CREDENTIAL: 'MFA_SOCIAL_LAST_CREDENTIAL',
882
+ /**
883
+ * Issue #935 — removing the account's last second factor is refused while
884
+ * a requirement is in force: `mfa.admin.totp_enforced` or a role's
885
+ * `requiresTwoFactor` for an administrator, `mfa.storefront.totp_enforced`
886
+ * at the request's sales channel or the organization's policy for a
887
+ * customer. Raised by the self-service `POST …/mfa/disable`.
888
+ */
889
+ MFA_LAST_FACTOR_REQUIRED: 'MFA_LAST_FACTOR_REQUIRED',
890
+ /**
891
+ * Issue #1279 — the one answer of `POST /api/v1/auth/customer/oauth/exchange`
892
+ * for a hand-off code it will not redeem: unknown, expired, already used,
893
+ * presented with another browser's binding or on another sales channel, or
894
+ * withdrawn with the account's pending sign-ins.
895
+ */
896
+ MFA_FEDERATED_HANDOFF_INVALID: 'MFA_FEDERATED_HANDOFF_INVALID',
508
897
  // Feature 055 — Custom Fields Layer.
509
898
  CUSTOM_FIELD_NOT_FOUND: 'CUSTOM_FIELD_NOT_FOUND',
510
899
  CUSTOM_FIELD_KEY_CONFLICT: 'CUSTOM_FIELD_KEY_CONFLICT',
@@ -573,6 +962,23 @@ export const ERROR_CODES = {
573
962
  * from `PRODUCT_FEED_ERROR_CODES` (feature 067, FR-087, FR-095, FR-096).
574
963
  */
575
964
  PRODUCT_FEED_TAXONOMY_CONFLICT: 'PRODUCT_FEED_TAXONOMY_CONFLICT',
965
+ // The feed form's state refusals (issue #631, #86). Raised as
966
+ // `VALIDATION_FAILED` with an English `field: message` literal until then.
967
+ // Unlike the five above, `product_feeds` declares these itself, and each
968
+ // keeps `details.field` so the form can place the sentence.
969
+ /**
970
+ * 400 — the language exists on the installation but is switched off
971
+ * (`details.field`, `languageCode`).
972
+ */
973
+ PRODUCT_FEED_LANGUAGE_INACTIVE: 'PRODUCT_FEED_LANGUAGE_INACTIVE',
974
+ /**
975
+ * 400 — the feed's sales channel does not offer the currency
976
+ * (`details.field`, `currencyCode`, `salesChannelId`, `allowed` as a
977
+ * comma-joined string).
978
+ */
979
+ PRODUCT_FEED_CURRENCY_NOT_OFFERED: 'PRODUCT_FEED_CURRENCY_NOT_OFFERED',
980
+ /** 400 — another feed already uses the slug (`details.field`, `slug`). */
981
+ PRODUCT_FEED_SLUG_TAKEN: 'PRODUCT_FEED_SLUG_TAKEN',
576
982
  /**
577
983
  * A price binding named a price list that does not exist. Named after the
578
984
  * resource rather than the module (admin-api.md § Price bindings): the caller
@@ -598,6 +1004,19 @@ export const ERROR_CODES = {
598
1004
  PRICE_BOOK_ROW_LIMIT: 'PRICE_BOOK_ROW_LIMIT',
599
1005
  /** Feature 160 — the book changed since the version the write was made against; `details.currentVersion`. */
600
1006
  PRICE_BOOK_STALE: 'PRICE_BOOK_STALE',
1007
+ /** Issue #1028 — a base book's rows are base prices, written through `priceBookWritePort` or the base-price API. */
1008
+ PRICE_BOOK_BASE_BOOK: 'PRICE_BOOK_BASE_BOOK',
1009
+ /** Issue #1028 — an expired book prices nothing and takes no row write from another module. */
1010
+ PRICE_BOOK_EXPIRED: 'PRICE_BOOK_EXPIRED',
1011
+ // Two `price_lists` refusals raised as `VALIDATION_FAILED` until issue #636
1012
+ // (#86). Declared by the `price_lists` manifest.
1013
+ /**
1014
+ * 400 — a variant's percentage or amount adjustment would lose the product's own
1015
+ * base price in that currency (`details.productId`, `currency`, `issues`).
1016
+ */
1017
+ PRICE_BOOK_BASE_PRICE_REQUIRED: 'PRICE_BOOK_BASE_PRICE_REQUIRED',
1018
+ /** 400 — a base book is channel-independent and takes no channel set (`details.priceBookId`, `currency`). */
1019
+ PRICE_BOOK_BASE_HAS_NO_CHANNELS: 'PRICE_BOOK_BASE_HAS_NO_CHANNELS',
601
1020
  /** Feature 160 — the precedence is read-only until the change flow ships (FR-023). */
602
1021
  PRECEDENCE_CHANGE_UNAVAILABLE: 'PRECEDENCE_CHANGE_UNAVAILABLE',
603
1022
  // Shared PIM connector layer (feature 089).
@@ -610,8 +1029,30 @@ export const ERROR_CODES = {
610
1029
  INVOICE_LEDGER_CREDENTIALS_MISSING: 'INVOICE_LEDGER_CREDENTIALS_MISSING',
611
1030
  /** Delivery is succeeded or otherwise not eligible for operator retry. */
612
1031
  INVOICE_LEDGER_DELIVERY_NOT_RETRYABLE: 'INVOICE_LEDGER_DELIVERY_NOT_RETRYABLE',
1032
+ /**
1033
+ * 400 — a routing write changes the stored numbering mode without
1034
+ * `confirm: true` (`details.field: 'confirm'`, `from`, `to`). Raised as
1035
+ * `VALIDATION_FAILED` until issue #644 (#86).
1036
+ */
1037
+ INVOICE_LEDGER_NUMBERING_CHANGE_UNCONFIRMED: 'INVOICE_LEDGER_NUMBERING_CHANGE_UNCONFIRMED',
613
1038
  // `INFAKT_CONNECTION_FAILED` and `INFAKT_WEBHOOK_UNAUTHORIZED` left with the
614
1039
  // `infakt` module (feature 134, T069), which declares them as `infaktErrorCodes`.
1040
+ // Delivery methods — a method shipments were created against (issue #632, #86).
1041
+ // Raised as `VALIDATION_FAILED` with an English sentence until then. The
1042
+ // `details.code` token names the write that was refused: `delete` or
1043
+ // `change_adapter`.
1044
+ /**
1045
+ * 409 — shipments reference the method, so it cannot be deleted or rebound to
1046
+ * another adapter (`details.deliveryMethodId`, `deliveryMethodCode`,
1047
+ * `shipmentCount`; `adapter` for `change_adapter`).
1048
+ */
1049
+ DELIVERY_METHOD_IN_USE: 'DELIVERY_METHOD_IN_USE',
1050
+ /**
1051
+ * 409 — the `shipments` module is off, so nobody can count the shipments that
1052
+ * may reference the method, and the delete or the adapter change is refused
1053
+ * (`details.deliveryMethodId`, `module`).
1054
+ */
1055
+ DELIVERY_METHOD_USAGE_UNKNOWN: 'DELIVERY_METHOD_USAGE_UNKNOWN',
615
1056
  // Shared ERP connector layer (feature 119).
616
1057
  /** Another ERP connector is operator-active; activation refused (FR-006). */
617
1058
  ERP_CONNECTOR_ALREADY_ACTIVE: 'ERP_CONNECTOR_ALREADY_ACTIVE',
@@ -632,6 +1073,32 @@ export const ERROR_CODES = {
632
1073
  * neither claimant.
633
1074
  */
634
1075
  PAYMENT_ADAPTER_UNAVAILABLE: 'PAYMENT_ADAPTER_UNAVAILABLE',
1076
+ // Payments — the payment's own state refuses an admin retry or the
1077
+ // `receive_payment` ingress (issue #630, #86). Raised as `VALIDATION_FAILED`
1078
+ // with an English literal until then.
1079
+ /**
1080
+ * 409 — the payment is already paid: a retry (token `retry`) or the ingress
1081
+ * marking it failed (token `mark_failed`); `details.orderId`, `paymentId`, `status`.
1082
+ */
1083
+ PAYMENT_ALREADY_PAID: 'PAYMENT_ALREADY_PAID',
1084
+ /** 409 — the payment was refunded, so it cannot be retried (`details.orderId`, `paymentId`, `status`). */
1085
+ PAYMENT_REFUNDED: 'PAYMENT_REFUNDED',
1086
+ /** 409 — the order is settled out of band, so there is nothing to retry (`details.orderId`, `paymentId`). */
1087
+ PAYMENT_SETTLED_OUT_OF_BAND: 'PAYMENT_SETTLED_OUT_OF_BAND',
1088
+ // Payment methods — a method payments reference (issue #635, #86). Raised as
1089
+ // `VALIDATION_FAILED` with an English sentence until then; issue #632 gives
1090
+ // the delivery-method guard the same pair.
1091
+ /**
1092
+ * 409 — payments reference the method, so it cannot be deleted
1093
+ * (`details.paymentMethodId`, `paymentMethodCode`, `paymentCount`).
1094
+ */
1095
+ PAYMENT_METHOD_IN_USE: 'PAYMENT_METHOD_IN_USE',
1096
+ /**
1097
+ * 409 — the `payments` module is off, so nobody can count the payments that
1098
+ * may reference the method, and the delete is refused
1099
+ * (`details.paymentMethodId`, `module`).
1100
+ */
1101
+ PAYMENT_METHOD_USAGE_UNKNOWN: 'PAYMENT_METHOD_USAGE_UNKNOWN',
635
1102
  // CRM — Sales Opportunities (`specs/143-crm-sales-opportunities/`,
636
1103
  // `contracts/admin-api.md` §13). Each is declared by the `crm` module's
637
1104
  // manifest and joins this block in the change that adds its first raise site.
@@ -660,6 +1127,12 @@ export const ERROR_CODES = {
660
1127
  CRM_ASSIGNEE_INVALID: 'CRM_ASSIGNEE_INVALID',
661
1128
  /** The uploaded file is larger than an Opportunity attachment may be. */
662
1129
  CRM_ATTACHMENT_TOO_LARGE: 'CRM_ATTACHMENT_TOO_LARGE',
1130
+ /**
1131
+ * 422 — an attachment must be a private file of the library (`details.assetId`, `visibility`).
1132
+ * `VALIDATION_FAILED` until issue #639 (#86); the twin of `projects`'
1133
+ * `PROJECT_ATTACHMENT_NOT_PRIVATE` (issue #634).
1134
+ */
1135
+ CRM_ATTACHMENT_NOT_PRIVATE: 'CRM_ATTACHMENT_NOT_PRIVATE',
663
1136
  /** Another CRM tag already has this name, whatever its case. */
664
1137
  CRM_TAG_NAME_TAKEN: 'CRM_TAG_NAME_TAKEN',
665
1138
  /** A message on an Opportunity cannot be edited or deleted once sent. */
@@ -695,7 +1168,11 @@ export const ERROR_CODES = {
695
1168
  TASK_TAG_UNKNOWN: 'TASK_TAG_UNKNOWN',
696
1169
  /** A Task tag name already taken, case-insensitively (R-10). */
697
1170
  TASK_TAG_NAME_TAKEN: 'TASK_TAG_NAME_TAKEN',
698
- /** A Task attachment refused: too large, or a document a browser would run (R-7). */
1171
+ /**
1172
+ * A Task attachment refused: too large, or a document a browser would run (R-7) — or, since
1173
+ * issue #642, a library file that is not private (422, refusal token `not_private`,
1174
+ * `details.assetId`, `visibility`).
1175
+ */
699
1176
  TASK_ATTACHMENT_REFUSED: 'TASK_ATTACHMENT_REFUSED',
700
1177
  /** A saved Tasks list view name its owner already uses, case-insensitively (R-13). */
701
1178
  TASK_VIEW_NAME_TAKEN: 'TASK_VIEW_NAME_TAKEN',
@@ -763,6 +1240,17 @@ export const ERROR_CODES = {
763
1240
  PROJECT_MESSAGE_IMMUTABLE: 'PROJECT_MESSAGE_IMMUTABLE',
764
1241
  /** The uploaded file is larger than an attachment of a Project may be; `details.maxMb` names the limit. */
765
1242
  PROJECT_ATTACHMENT_TOO_LARGE: 'PROJECT_ATTACHMENT_TOO_LARGE',
1243
+ // Three state refusals raised as `VALIDATION_FAILED` with an English literal
1244
+ // until issue #634 (#86).
1245
+ /** 422 — the Project already has the most Stages it may have (`details.projectId`, `maximum`). */
1246
+ PROJECT_STAGE_LIMIT: 'PROJECT_STAGE_LIMIT',
1247
+ /**
1248
+ * 422 — an attachment must be a private file of the library (`details.assetId`, `visibility`).
1249
+ * `crm`'s twin is to be `CRM_ATTACHMENT_NOT_PRIVATE` (issue #639).
1250
+ */
1251
+ PROJECT_ATTACHMENT_NOT_PRIVATE: 'PROJECT_ATTACHMENT_NOT_PRIVATE',
1252
+ /** 422 — an archived Role is not added to a Template that does not hold it (`details.roleId`). */
1253
+ PROJECT_TEMPLATE_ROLE_ARCHIVED: 'PROJECT_TEMPLATE_ROLE_ARCHIVED',
766
1254
  // SEO — search engine robots (`specs/144-seo-search-engine-robots/`, FR-006).
767
1255
  // Declared by the `seo` module's manifest.
768
1256
  /**
@@ -791,6 +1279,38 @@ export const ERROR_CODES = {
791
1279
  ADMIN_FEEDBACK_NOT_CONFIGURED: 'ADMIN_FEEDBACK_NOT_CONFIGURED',
792
1280
  /** The relay could not be reached in time, refused the message, or redirected. */
793
1281
  ADMIN_FEEDBACK_DELIVERY_FAILED: 'ADMIN_FEEDBACK_DELIVERY_FAILED',
1282
+ // Forms (`specs/170-forms-module/`, research R-25) — the spellings of
1283
+ // `FORMS_ERROR_CODES`. Each is declared by the `forms` module's manifest and
1284
+ // joins this block in the change that adds its first raise site.
1285
+ /** No such form (or form version) — a malformed id answers the same. */
1286
+ FORM_NOT_FOUND: 'FORM_NOT_FOUND',
1287
+ /** Another form already uses this key. */
1288
+ FORM_KEY_TAKEN: 'FORM_KEY_TAKEN',
1289
+ /** The definition breaks a publish rule; `details.issues` lists `{ code, elementId, path }`. */
1290
+ FORM_DEFINITION_INVALID: 'FORM_DEFINITION_INVALID',
1291
+ /** The form changed since the caller read it (`expectedRevision`, R-26). */
1292
+ FORM_REVISION_CONFLICT: 'FORM_REVISION_CONFLICT',
1293
+ /** The form has entries; deleting it needs the confirmation (`details.entryCount`). */
1294
+ FORM_HAS_ENTRIES: 'FORM_HAS_ENTRIES',
1295
+ /**
1296
+ * The form takes no submission now; `details.code` says why: `closed`, `not_yet_open`, `full`,
1297
+ * `sign_in_required` or `unavailable` (a draft, a deleted form or one that never existed).
1298
+ */
1299
+ FORM_NOT_ACCEPTING: 'FORM_NOT_ACCEPTING',
1300
+ /** A submission body over the 256 KiB limit (FR-036). */
1301
+ FORM_SUBMISSION_TOO_LARGE: 'FORM_SUBMISSION_TOO_LARGE',
1302
+ /** Some answers break the rules of the served version; `details.fields` lists `{ fieldKey, code, message }`. */
1303
+ FORM_SUBMISSION_INVALID: 'FORM_SUBMISSION_INVALID',
1304
+ /** No such entry — or one outside the caller's organisations, or a malformed id: all answered the same. */
1305
+ FORM_ENTRY_NOT_FOUND: 'FORM_ENTRY_NOT_FOUND',
1306
+ /** The entry is no longer in the status the caller named (`expectedStatus`); `details.status` is its status now. */
1307
+ FORM_ENTRY_STATUS_CONFLICT: 'FORM_ENTRY_STATUS_CONFLICT',
1308
+ /** A write that removes entries across organisations — deleting a form with entries, changing its retention — needs an unrestricted administrator. */
1309
+ FORM_SCOPE_REQUIRED: 'FORM_SCOPE_REQUIRED',
1310
+ /** The CAPTCHA provider did not verify the submission, or no CAPTCHA response was sent (feature 170, R-14). */
1311
+ FORM_CAPTCHA_FAILED: 'FORM_CAPTCHA_FAILED',
1312
+ /** The CAPTCHA provider could not be reached to verify a submission; retryable (feature 170, R-14). */
1313
+ FORM_CAPTCHA_UNAVAILABLE: 'FORM_CAPTCHA_UNAVAILABLE',
794
1314
  };
795
1315
  /**
796
1316
  * The shape of every error code on the wire — the platform's own and a