@peable.to/contracts 0.4.0 → 1.0.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 (316) hide show
  1. package/dist/cjs/common/address.js +81 -0
  2. package/dist/cjs/common/envelopes.js +101 -0
  3. package/dist/cjs/common/objects.js +85 -0
  4. package/dist/cjs/common/params.js +211 -0
  5. package/dist/cjs/common/primitives.js +39 -0
  6. package/dist/cjs/contributions.js +22 -0
  7. package/dist/cjs/index.js +40 -137
  8. package/dist/cjs/openapi/document.js +297 -0
  9. package/dist/cjs/openapi/index.js +7 -0
  10. package/dist/cjs/openapi/webhooks.js +17 -0
  11. package/dist/cjs/resources/billingEngine/billingPortal.js +237 -0
  12. package/dist/cjs/resources/billingEngine/creditNotes.js +189 -0
  13. package/dist/cjs/resources/billingEngine/customerBalanceTransactions.js +90 -0
  14. package/dist/cjs/resources/billingEngine/index.js +43 -0
  15. package/dist/cjs/resources/billingEngine/invoiceItems.js +155 -0
  16. package/dist/cjs/resources/billingEngine/invoices.js +509 -0
  17. package/dist/cjs/resources/billingEngine/params.js +43 -0
  18. package/dist/cjs/resources/billingEngine/public.js +326 -0
  19. package/dist/cjs/resources/billingEngine/subscriptions.js +476 -0
  20. package/dist/cjs/resources/catalog/billing.js +755 -0
  21. package/dist/cjs/resources/catalog/billingSettings.js +131 -0
  22. package/dist/cjs/resources/catalog/coupons.js +222 -0
  23. package/dist/cjs/resources/catalog/entitlements.js +257 -0
  24. package/dist/cjs/resources/catalog/index.js +58 -0
  25. package/dist/cjs/resources/catalog/meters.js +279 -0
  26. package/dist/cjs/resources/catalog/prices.js +423 -0
  27. package/dist/cjs/resources/catalog/products.js +228 -0
  28. package/dist/cjs/resources/catalog/promotionCodes.js +174 -0
  29. package/dist/cjs/resources/catalog/shared.js +75 -0
  30. package/dist/cjs/resources/catalog/testClocks.js +127 -0
  31. package/dist/cjs/resources/checkout/checkoutSessions.js +582 -0
  32. package/dist/cjs/resources/checkout/contributions.js +172 -0
  33. package/dist/cjs/resources/checkout/files.js +133 -0
  34. package/dist/cjs/resources/checkout/index.js +57 -0
  35. package/dist/cjs/resources/checkout/merchants.js +290 -0
  36. package/dist/cjs/resources/checkout/paymentLinks.js +330 -0
  37. package/dist/cjs/resources/checkout/paymentMethodConfigurations.js +262 -0
  38. package/dist/cjs/resources/checkout/shared.js +368 -0
  39. package/dist/cjs/resources/connect/account.js +332 -0
  40. package/dist/cjs/resources/connect/applicationFees.js +113 -0
  41. package/dist/cjs/resources/connect/balance.js +212 -0
  42. package/dist/cjs/resources/connect/connectedAccounts.js +260 -0
  43. package/dist/cjs/resources/connect/index.js +51 -0
  44. package/dist/cjs/resources/connect/onboarding.js +82 -0
  45. package/dist/cjs/resources/connect/payouts.js +196 -0
  46. package/dist/cjs/resources/connect/reporting.js +235 -0
  47. package/dist/cjs/resources/connect/requestLogs.js +110 -0
  48. package/dist/cjs/resources/connect/transfers.js +227 -0
  49. package/dist/cjs/resources/core/customers.js +194 -0
  50. package/dist/cjs/resources/core/index.js +23 -0
  51. package/dist/cjs/resources/core/paymentMethods.js +134 -0
  52. package/dist/cjs/resources/events/events.js +357 -0
  53. package/dist/cjs/resources/events/index.js +29 -0
  54. package/dist/cjs/resources/events/webhookDeliveries.js +93 -0
  55. package/dist/cjs/resources/events/webhookEndpoints.js +215 -0
  56. package/dist/cjs/resources/payments/charges.js +157 -0
  57. package/dist/cjs/resources/payments/disputes.js +204 -0
  58. package/dist/cjs/resources/payments/index.js +41 -0
  59. package/dist/cjs/resources/payments/paymentIntents.js +529 -0
  60. package/dist/cjs/resources/payments/refunds.js +245 -0
  61. package/dist/cjs/resources/payments/setupIntents.js +158 -0
  62. package/dist/cjs/resources/payments/social.js +182 -0
  63. package/dist/cjs/resources/payments/testHelpers.js +39 -0
  64. package/dist/cjs/resources/tax/assessments.js +217 -0
  65. package/dist/cjs/resources/tax/businessProfile.js +99 -0
  66. package/dist/cjs/resources/tax/calculations.js +176 -0
  67. package/dist/cjs/resources/tax/capabilities.js +42 -0
  68. package/dist/cjs/resources/tax/codes.js +37 -0
  69. package/dist/cjs/resources/tax/complianceActions.js +56 -0
  70. package/dist/cjs/resources/tax/deadlines.js +59 -0
  71. package/dist/cjs/resources/tax/documents.js +128 -0
  72. package/dist/cjs/resources/tax/index.js +80 -0
  73. package/dist/cjs/resources/tax/locationEvidence.js +131 -0
  74. package/dist/cjs/resources/tax/operatingLocations.js +98 -0
  75. package/dist/cjs/resources/tax/products.js +67 -0
  76. package/dist/cjs/resources/tax/registrationDeclarations.js +124 -0
  77. package/dist/cjs/resources/tax/registrations.js +82 -0
  78. package/dist/cjs/resources/tax/reports.js +92 -0
  79. package/dist/cjs/resources/tax/reviewItems.js +116 -0
  80. package/dist/cjs/resources/tax/ruleSet.js +68 -0
  81. package/dist/cjs/resources/tax/salesDestinations.js +94 -0
  82. package/dist/cjs/resources/tax/settings.js +104 -0
  83. package/dist/cjs/resources/tax/shared.js +62 -0
  84. package/dist/cjs/resources/tax/transactions.js +102 -0
  85. package/dist/cjs/route.js +22 -0
  86. package/dist/cjs/routes.js +31 -0
  87. package/dist/cjs/vocabulary/billingPortal.js +15 -0
  88. package/dist/cjs/vocabulary/catalog.js +110 -0
  89. package/dist/cjs/vocabulary/checkout.js +53 -0
  90. package/dist/cjs/vocabulary/connect.js +95 -0
  91. package/dist/cjs/vocabulary/errors.js +174 -0
  92. package/dist/cjs/vocabulary/events.js +176 -0
  93. package/dist/cjs/vocabulary/files.js +44 -0
  94. package/dist/cjs/vocabulary/index.js +37 -0
  95. package/dist/cjs/vocabulary/invoices.js +52 -0
  96. package/dist/cjs/vocabulary/lists.js +22 -0
  97. package/dist/cjs/vocabulary/merchants.js +23 -0
  98. package/dist/cjs/vocabulary/money.js +104 -0
  99. package/dist/cjs/vocabulary/paymentMethodConfigurations.js +36 -0
  100. package/dist/cjs/vocabulary/payments.js +195 -0
  101. package/dist/cjs/vocabulary/reporting.js +27 -0
  102. package/dist/cjs/vocabulary/subscriptions.js +60 -0
  103. package/dist/cjs/vocabulary/tax.js +237 -0
  104. package/dist/cjs/vocabulary/version.js +12 -0
  105. package/dist/esm/common/address.js +76 -0
  106. package/dist/esm/common/envelopes.js +95 -0
  107. package/dist/esm/common/objects.js +74 -0
  108. package/dist/esm/common/params.js +203 -0
  109. package/dist/esm/common/primitives.js +35 -0
  110. package/dist/esm/contributions.js +5 -0
  111. package/dist/esm/index.js +26 -134
  112. package/dist/esm/openapi/document.js +294 -0
  113. package/dist/esm/openapi/index.js +2 -0
  114. package/dist/esm/openapi/webhooks.js +14 -0
  115. package/dist/esm/resources/billingEngine/billingPortal.js +234 -0
  116. package/dist/esm/resources/billingEngine/creditNotes.js +186 -0
  117. package/dist/esm/resources/billingEngine/customerBalanceTransactions.js +87 -0
  118. package/dist/esm/resources/billingEngine/index.js +26 -0
  119. package/dist/esm/resources/billingEngine/invoiceItems.js +152 -0
  120. package/dist/esm/resources/billingEngine/invoices.js +506 -0
  121. package/dist/esm/resources/billingEngine/params.js +39 -0
  122. package/dist/esm/resources/billingEngine/public.js +323 -0
  123. package/dist/esm/resources/billingEngine/subscriptions.js +473 -0
  124. package/dist/esm/resources/catalog/billing.js +752 -0
  125. package/dist/esm/resources/catalog/billingSettings.js +128 -0
  126. package/dist/esm/resources/catalog/coupons.js +219 -0
  127. package/dist/esm/resources/catalog/entitlements.js +254 -0
  128. package/dist/esm/resources/catalog/index.js +38 -0
  129. package/dist/esm/resources/catalog/meters.js +276 -0
  130. package/dist/esm/resources/catalog/prices.js +419 -0
  131. package/dist/esm/resources/catalog/products.js +225 -0
  132. package/dist/esm/resources/catalog/promotionCodes.js +171 -0
  133. package/dist/esm/resources/catalog/shared.js +67 -0
  134. package/dist/esm/resources/catalog/testClocks.js +124 -0
  135. package/dist/esm/resources/checkout/checkoutSessions.js +579 -0
  136. package/dist/esm/resources/checkout/contributions.js +167 -0
  137. package/dist/esm/resources/checkout/files.js +130 -0
  138. package/dist/esm/resources/checkout/index.js +25 -0
  139. package/dist/esm/resources/checkout/merchants.js +287 -0
  140. package/dist/esm/resources/checkout/paymentLinks.js +327 -0
  141. package/dist/esm/resources/checkout/paymentMethodConfigurations.js +259 -0
  142. package/dist/esm/resources/checkout/shared.js +363 -0
  143. package/dist/esm/resources/connect/account.js +329 -0
  144. package/dist/esm/resources/connect/applicationFees.js +110 -0
  145. package/dist/esm/resources/connect/balance.js +209 -0
  146. package/dist/esm/resources/connect/connectedAccounts.js +257 -0
  147. package/dist/esm/resources/connect/index.js +34 -0
  148. package/dist/esm/resources/connect/onboarding.js +79 -0
  149. package/dist/esm/resources/connect/payouts.js +193 -0
  150. package/dist/esm/resources/connect/reporting.js +232 -0
  151. package/dist/esm/resources/connect/requestLogs.js +107 -0
  152. package/dist/esm/resources/connect/transfers.js +224 -0
  153. package/dist/esm/resources/core/customers.js +191 -0
  154. package/dist/esm/resources/core/index.js +6 -0
  155. package/dist/esm/resources/core/paymentMethods.js +131 -0
  156. package/dist/esm/resources/events/events.js +353 -0
  157. package/dist/esm/resources/events/index.js +12 -0
  158. package/dist/esm/resources/events/webhookDeliveries.js +90 -0
  159. package/dist/esm/resources/events/webhookEndpoints.js +212 -0
  160. package/dist/esm/resources/payments/charges.js +154 -0
  161. package/dist/esm/resources/payments/disputes.js +201 -0
  162. package/dist/esm/resources/payments/index.js +24 -0
  163. package/dist/esm/resources/payments/paymentIntents.js +526 -0
  164. package/dist/esm/resources/payments/refunds.js +242 -0
  165. package/dist/esm/resources/payments/setupIntents.js +155 -0
  166. package/dist/esm/resources/payments/social.js +179 -0
  167. package/dist/esm/resources/payments/testHelpers.js +36 -0
  168. package/dist/esm/resources/tax/assessments.js +214 -0
  169. package/dist/esm/resources/tax/businessProfile.js +96 -0
  170. package/dist/esm/resources/tax/calculations.js +173 -0
  171. package/dist/esm/resources/tax/capabilities.js +39 -0
  172. package/dist/esm/resources/tax/codes.js +34 -0
  173. package/dist/esm/resources/tax/complianceActions.js +53 -0
  174. package/dist/esm/resources/tax/deadlines.js +56 -0
  175. package/dist/esm/resources/tax/documents.js +125 -0
  176. package/dist/esm/resources/tax/index.js +63 -0
  177. package/dist/esm/resources/tax/locationEvidence.js +128 -0
  178. package/dist/esm/resources/tax/operatingLocations.js +95 -0
  179. package/dist/esm/resources/tax/products.js +64 -0
  180. package/dist/esm/resources/tax/registrationDeclarations.js +121 -0
  181. package/dist/esm/resources/tax/registrations.js +79 -0
  182. package/dist/esm/resources/tax/reports.js +89 -0
  183. package/dist/esm/resources/tax/reviewItems.js +113 -0
  184. package/dist/esm/resources/tax/ruleSet.js +65 -0
  185. package/dist/esm/resources/tax/salesDestinations.js +91 -0
  186. package/dist/esm/resources/tax/settings.js +101 -0
  187. package/dist/esm/resources/tax/shared.js +58 -0
  188. package/dist/esm/resources/tax/transactions.js +99 -0
  189. package/dist/esm/route.js +16 -0
  190. package/dist/esm/routes.js +27 -0
  191. package/dist/esm/vocabulary/billingPortal.js +12 -0
  192. package/dist/esm/vocabulary/catalog.js +106 -0
  193. package/dist/esm/vocabulary/checkout.js +50 -0
  194. package/dist/esm/vocabulary/connect.js +92 -0
  195. package/dist/esm/vocabulary/errors.js +169 -0
  196. package/dist/esm/vocabulary/events.js +173 -0
  197. package/dist/esm/vocabulary/files.js +41 -0
  198. package/dist/esm/vocabulary/index.js +21 -0
  199. package/dist/esm/vocabulary/invoices.js +49 -0
  200. package/dist/esm/vocabulary/lists.js +19 -0
  201. package/dist/esm/vocabulary/merchants.js +20 -0
  202. package/dist/esm/vocabulary/money.js +98 -0
  203. package/dist/esm/vocabulary/paymentMethodConfigurations.js +33 -0
  204. package/dist/esm/vocabulary/payments.js +192 -0
  205. package/dist/esm/vocabulary/reporting.js +24 -0
  206. package/dist/esm/vocabulary/subscriptions.js +57 -0
  207. package/dist/esm/vocabulary/tax.js +233 -0
  208. package/dist/esm/vocabulary/version.js +9 -0
  209. package/dist/types/common/address.d.ts +62 -0
  210. package/dist/types/common/envelopes.d.ts +88 -0
  211. package/dist/types/common/objects.d.ts +107 -0
  212. package/dist/types/common/params.d.ts +156 -0
  213. package/dist/types/common/primitives.d.ts +56 -0
  214. package/dist/types/contributions.d.ts +1 -0
  215. package/dist/types/index.d.ts +16 -171
  216. package/dist/types/openapi/document.d.ts +16 -0
  217. package/dist/types/openapi/index.d.ts +2 -0
  218. package/dist/types/openapi/webhooks.d.ts +15 -0
  219. package/dist/types/resources/billingEngine/billingPortal.d.ts +742 -0
  220. package/dist/types/resources/billingEngine/creditNotes.d.ts +655 -0
  221. package/dist/types/resources/billingEngine/customerBalanceTransactions.d.ts +282 -0
  222. package/dist/types/resources/billingEngine/index.d.ts +6071 -0
  223. package/dist/types/resources/billingEngine/invoiceItems.d.ts +502 -0
  224. package/dist/types/resources/billingEngine/invoices.d.ts +2547 -0
  225. package/dist/types/resources/billingEngine/params.d.ts +51 -0
  226. package/dist/types/resources/billingEngine/public.d.ts +1860 -0
  227. package/dist/types/resources/billingEngine/subscriptions.d.ts +1519 -0
  228. package/dist/types/resources/catalog/billing.d.ts +1723 -0
  229. package/dist/types/resources/catalog/billingSettings.d.ts +160 -0
  230. package/dist/types/resources/catalog/coupons.d.ts +403 -0
  231. package/dist/types/resources/catalog/entitlements.d.ts +422 -0
  232. package/dist/types/resources/catalog/index.d.ts +3155 -0
  233. package/dist/types/resources/catalog/meters.d.ts +474 -0
  234. package/dist/types/resources/catalog/prices.d.ts +1091 -0
  235. package/dist/types/resources/catalog/products.d.ts +430 -0
  236. package/dist/types/resources/catalog/promotionCodes.d.ts +369 -0
  237. package/dist/types/resources/catalog/shared.d.ts +34 -0
  238. package/dist/types/resources/catalog/testClocks.d.ts +220 -0
  239. package/dist/types/resources/checkout/checkoutSessions.d.ts +3207 -0
  240. package/dist/types/resources/checkout/contributions.d.ts +375 -0
  241. package/dist/types/resources/checkout/files.d.ts +280 -0
  242. package/dist/types/resources/checkout/index.d.ts +5678 -0
  243. package/dist/types/resources/checkout/merchants.d.ts +395 -0
  244. package/dist/types/resources/checkout/paymentLinks.d.ts +1728 -0
  245. package/dist/types/resources/checkout/paymentMethodConfigurations.d.ts +2104 -0
  246. package/dist/types/resources/checkout/shared.d.ts +419 -0
  247. package/dist/types/resources/connect/account.d.ts +483 -0
  248. package/dist/types/resources/connect/applicationFees.d.ts +198 -0
  249. package/dist/types/resources/connect/balance.d.ts +399 -0
  250. package/dist/types/resources/connect/connectedAccounts.d.ts +494 -0
  251. package/dist/types/resources/connect/index.d.ts +2094 -0
  252. package/dist/types/resources/connect/onboarding.d.ts +95 -0
  253. package/dist/types/resources/connect/payouts.d.ts +527 -0
  254. package/dist/types/resources/connect/reporting.d.ts +506 -0
  255. package/dist/types/resources/connect/requestLogs.d.ts +236 -0
  256. package/dist/types/resources/connect/transfers.d.ts +436 -0
  257. package/dist/types/resources/core/customers.d.ts +619 -0
  258. package/dist/types/resources/core/index.d.ts +679 -0
  259. package/dist/types/resources/core/paymentMethods.d.ts +336 -0
  260. package/dist/types/resources/events/events.d.ts +731 -0
  261. package/dist/types/resources/events/index.d.ts +1727 -0
  262. package/dist/types/resources/events/webhookDeliveries.d.ts +436 -0
  263. package/dist/types/resources/events/webhookEndpoints.d.ts +1502 -0
  264. package/dist/types/resources/payments/charges.d.ts +390 -0
  265. package/dist/types/resources/payments/disputes.d.ts +822 -0
  266. package/dist/types/resources/payments/index.d.ts +3517 -0
  267. package/dist/types/resources/payments/paymentIntents.d.ts +2080 -0
  268. package/dist/types/resources/payments/refunds.d.ts +684 -0
  269. package/dist/types/resources/payments/setupIntents.d.ts +391 -0
  270. package/dist/types/resources/payments/social.d.ts +266 -0
  271. package/dist/types/resources/payments/testHelpers.d.ts +178 -0
  272. package/dist/types/resources/tax/assessments.d.ts +787 -0
  273. package/dist/types/resources/tax/businessProfile.d.ts +134 -0
  274. package/dist/types/resources/tax/calculations.d.ts +261 -0
  275. package/dist/types/resources/tax/capabilities.d.ts +81 -0
  276. package/dist/types/resources/tax/codes.d.ts +29 -0
  277. package/dist/types/resources/tax/complianceActions.d.ts +97 -0
  278. package/dist/types/resources/tax/deadlines.d.ts +133 -0
  279. package/dist/types/resources/tax/documents.d.ts +257 -0
  280. package/dist/types/resources/tax/index.d.ts +1946 -0
  281. package/dist/types/resources/tax/locationEvidence.d.ts +246 -0
  282. package/dist/types/resources/tax/operatingLocations.d.ts +170 -0
  283. package/dist/types/resources/tax/products.d.ts +68 -0
  284. package/dist/types/resources/tax/registrationDeclarations.d.ts +270 -0
  285. package/dist/types/resources/tax/registrations.d.ts +103 -0
  286. package/dist/types/resources/tax/reports.d.ts +129 -0
  287. package/dist/types/resources/tax/reviewItems.d.ts +226 -0
  288. package/dist/types/resources/tax/ruleSet.d.ts +219 -0
  289. package/dist/types/resources/tax/salesDestinations.d.ts +158 -0
  290. package/dist/types/resources/tax/settings.d.ts +122 -0
  291. package/dist/types/resources/tax/shared.d.ts +43 -0
  292. package/dist/types/resources/tax/transactions.d.ts +404 -0
  293. package/dist/types/route.d.ts +86 -0
  294. package/dist/types/routes.d.ts +23 -0
  295. package/dist/types/vocabulary/billingPortal.d.ts +15 -0
  296. package/dist/types/vocabulary/catalog.d.ts +97 -0
  297. package/dist/types/vocabulary/checkout.d.ts +49 -0
  298. package/dist/types/vocabulary/connect.d.ts +62 -0
  299. package/dist/types/vocabulary/errors.d.ts +145 -0
  300. package/dist/types/vocabulary/events.d.ts +171 -0
  301. package/dist/types/vocabulary/files.d.ts +30 -0
  302. package/dist/types/vocabulary/index.d.ts +17 -0
  303. package/dist/types/vocabulary/invoices.d.ts +39 -0
  304. package/dist/types/vocabulary/lists.d.ts +9 -0
  305. package/dist/types/vocabulary/merchants.d.ts +9 -0
  306. package/dist/types/vocabulary/money.d.ts +59 -0
  307. package/dist/types/vocabulary/paymentMethodConfigurations.d.ts +22 -0
  308. package/dist/types/vocabulary/payments.d.ts +117 -0
  309. package/dist/types/vocabulary/reporting.d.ts +18 -0
  310. package/dist/types/vocabulary/subscriptions.d.ts +45 -0
  311. package/dist/types/vocabulary/tax.d.ts +163 -0
  312. package/dist/types/vocabulary/version.d.ts +10 -0
  313. package/package.json +51 -11
  314. package/dist/cjs/openapi.js +0 -165
  315. package/dist/esm/openapi.js +0 -161
  316. package/dist/types/openapi.d.ts +0 -148
@@ -0,0 +1,128 @@
1
+ import { z } from 'zod';
2
+ import { defineObject } from '../../common/objects.js';
3
+ import { expandOnlyQuery } from '../../common/params.js';
4
+ import { livemode, unixSeconds } from '../../common/primitives.js';
5
+ import { defineRoute } from '../../route.js';
6
+ import { BILLING_SETTINGS_LIMITS, DUNNING_FINAL_ACTIONS, DUNNING_INVOICE_ACTIONS, } from '../../vocabulary/catalog.js';
7
+ /**
8
+ * The merchant's billing settings (ADR 0018 §5; one per merchant and mode).
9
+ * Every field has a default, so a merchant that never opens the screen bills
10
+ * correctly:
11
+ *
12
+ * - `invoice_prefix`: derived from the merchant id; numbers are
13
+ * `PREFIX-0001`, gapless per merchant.
14
+ * - `dunning.retry_schedule_days`: `[1, 3, 5, 7]` — each retry so many days
15
+ * after the previous attempt (16 days, four retries, Stripe's default
16
+ * window).
17
+ * - `dunning.final_action`: `cancel` — the subscription ends when the last
18
+ * retry fails; `dunning.invoice_action`: `mark_uncollectible`.
19
+ * - emails on: the payer is told when an invoice is finalized for them
20
+ * (`send_invoice`) and when a payment fails.
21
+ */
22
+ export const billingSettingsSchema = defineObject('billing_settings', 'BillingSettings', z
23
+ .object({
24
+ object: z.literal('billing_settings'),
25
+ livemode,
26
+ invoice_prefix: z.string().describe('Invoice numbers are `PREFIX-0001`, gapless.'),
27
+ next_invoice_sequence: z
28
+ .number()
29
+ .int()
30
+ .describe('The next invoice number that will be assigned.'),
31
+ default_days_until_due: z.number().int(),
32
+ dunning: z
33
+ .object({
34
+ retry_schedule_days: z
35
+ .array(z.number().int())
36
+ .describe('Each retry so many days after the previous attempt.'),
37
+ final_action: z
38
+ .enum(DUNNING_FINAL_ACTIONS)
39
+ .describe('What happens to the subscription once the last retry fails.'),
40
+ invoice_action: z
41
+ .enum(DUNNING_INVOICE_ACTIONS)
42
+ .describe('What happens to the invoice once the last retry fails.'),
43
+ })
44
+ .strict(),
45
+ emails: z
46
+ .object({
47
+ invoice_finalized: z.boolean(),
48
+ payment_failed: z.boolean(),
49
+ })
50
+ .strict(),
51
+ updated: unixSeconds,
52
+ })
53
+ .strict(), {
54
+ examples: [
55
+ {
56
+ object: 'billing_settings',
57
+ livemode: false,
58
+ invoice_prefix: 'MENTION',
59
+ next_invoice_sequence: 1,
60
+ default_days_until_due: 30,
61
+ dunning: {
62
+ retry_schedule_days: [1, 3, 5, 7],
63
+ final_action: 'cancel',
64
+ invoice_action: 'mark_uncollectible',
65
+ },
66
+ emails: { invoice_finalized: true, payment_failed: true },
67
+ updated: 1793750400,
68
+ },
69
+ ],
70
+ });
71
+ export const updateBillingSettingsParams = z
72
+ .object({
73
+ invoice_prefix: z
74
+ .string()
75
+ .regex(new RegExp(BILLING_SETTINGS_LIMITS.invoicePrefixPattern))
76
+ .optional()
77
+ .describe('3–12 uppercase letters and digits.'),
78
+ default_days_until_due: z
79
+ .number()
80
+ .int()
81
+ .min(0)
82
+ .max(BILLING_SETTINGS_LIMITS.daysUntilDueMax)
83
+ .optional(),
84
+ dunning: z
85
+ .object({
86
+ retry_schedule_days: z
87
+ .array(z.number().int().min(1).max(BILLING_SETTINGS_LIMITS.retryDaysMax))
88
+ .max(BILLING_SETTINGS_LIMITS.retriesMax)
89
+ .optional(),
90
+ final_action: z.enum(DUNNING_FINAL_ACTIONS).optional(),
91
+ invoice_action: z.enum(DUNNING_INVOICE_ACTIONS).optional(),
92
+ })
93
+ .strict()
94
+ .optional(),
95
+ emails: z
96
+ .object({ invoice_finalized: z.boolean().optional(), payment_failed: z.boolean().optional() })
97
+ .strict()
98
+ .optional(),
99
+ })
100
+ .strict();
101
+ export const billingSettingsRoutes = [
102
+ defineRoute({
103
+ operationId: 'retrieveBillingSettings',
104
+ method: 'get',
105
+ path: '/v1/billing_settings',
106
+ tag: 'Billing settings',
107
+ summary: 'Retrieve the billing settings',
108
+ auth: 'service',
109
+ scope: 'payments:read',
110
+ query: expandOnlyQuery,
111
+ response: billingSettingsSchema,
112
+ sdk: 'billingSettings.retrieve',
113
+ }),
114
+ defineRoute({
115
+ operationId: 'updateBillingSettings',
116
+ method: 'post',
117
+ path: '/v1/billing_settings',
118
+ tag: 'Billing settings',
119
+ summary: 'Update the billing settings',
120
+ description: 'Invoice numbering, the default payment term, dunning and the payer emails.',
121
+ auth: 'service',
122
+ scope: 'payments:write',
123
+ idempotent: true,
124
+ body: updateBillingSettingsParams,
125
+ response: billingSettingsSchema,
126
+ sdk: 'billingSettings.update',
127
+ }),
128
+ ];
@@ -0,0 +1,219 @@
1
+ import { z } from 'zod';
2
+ import { deletedOf, listOf } from '../../common/envelopes.js';
3
+ import { defineComponent, defineObject } from '../../common/objects.js';
4
+ import { expandOnlyQuery, expandParam, listQuery, metadataCreateParam, metadataUpdateParam, } from '../../common/params.js';
5
+ import { amount, currency, livemode, metadata, unixSeconds } from '../../common/primitives.js';
6
+ import { defineRoute } from '../../route.js';
7
+ import { CATALOG_LIMITS, COUPON_DURATIONS } from '../../vocabulary/catalog.js';
8
+ import { baseUnitAmountParam, checkAmountBound, clearing, countParam, positiveUnixSecondsParam, } from './shared.js';
9
+ /**
10
+ * Coupons (ADR 0018) — a discount, by percentage or by a fixed amount in one
11
+ * currency. Its `id` is the merchant's own (`SUMMER25`) or generated
12
+ * (`coupon_…`), and names that one coupon forever: a deleted coupon's id is
13
+ * never reused. Only `name` and `metadata` change; the terms of a discount a
14
+ * customer already holds cannot.
15
+ */
16
+ export const couponSchema = defineObject('coupon', 'Coupon', z
17
+ .object({
18
+ id: z.string(),
19
+ object: z.literal('coupon'),
20
+ livemode,
21
+ name: z.string().nullable(),
22
+ percent_off: z
23
+ .number()
24
+ .nullable()
25
+ .describe('0 < x ≤ 100, at most two decimals. Set exactly when `amount_off` is not.'),
26
+ amount_off: amount.nullable().describe('Base units taken off, in `currency`.'),
27
+ currency: currency.nullable(),
28
+ duration: z.enum(COUPON_DURATIONS),
29
+ duration_in_months: z
30
+ .number()
31
+ .int()
32
+ .nullable()
33
+ .describe('Months a `repeating` coupon lasts; `null` otherwise.'),
34
+ max_redemptions: z.number().int().nullable(),
35
+ redeem_by: unixSeconds.nullable().describe('The last instant it can be redeemed.'),
36
+ times_redeemed: z.number().int(),
37
+ valid: z
38
+ .boolean()
39
+ .describe('Whether it can still be redeemed: not past `redeem_by` and not used up.'),
40
+ applies_to: z
41
+ .object({ products: z.array(z.string()) })
42
+ .strict()
43
+ .nullable()
44
+ .describe('The products (`prod_…`) it is restricted to, or `null` for every product.'),
45
+ metadata,
46
+ created: unixSeconds,
47
+ })
48
+ .strict(), {
49
+ examples: [
50
+ {
51
+ id: 'SUMMER25',
52
+ object: 'coupon',
53
+ livemode: false,
54
+ name: 'Summer sale',
55
+ percent_off: 25,
56
+ amount_off: null,
57
+ currency: null,
58
+ duration: 'repeating',
59
+ duration_in_months: 3,
60
+ max_redemptions: 100,
61
+ redeem_by: null,
62
+ times_redeemed: 0,
63
+ valid: true,
64
+ applies_to: null,
65
+ metadata: {},
66
+ created: 1793750400,
67
+ },
68
+ ],
69
+ });
70
+ /** What `DELETE /v1/coupons/{id}` answers. Existing discounts are not affected. */
71
+ export const deletedCouponSchema = defineComponent('DeletedCoupon', deletedOf('coupon'));
72
+ /**
73
+ * A percentage with at most two decimals, as basis points (12.5 → 1250). The
74
+ * check is on the scaled value, so 33.333 is refused rather than rounded.
75
+ */
76
+ const percentOff = z
77
+ .number()
78
+ .gt(0)
79
+ .max(100)
80
+ .refine((value) => Math.abs(value * 100 - Math.round(value * 100)) < 1e-9, 'percent_off has at most two decimals')
81
+ .transform((value) => Math.round(value * 100));
82
+ const couponId = z
83
+ .string()
84
+ .regex(new RegExp(`^[A-Za-z0-9_-]{1,${CATALOG_LIMITS.couponIdMax}}$`), `a coupon id is 1–${CATALOG_LIMITS.couponIdMax} letters, digits, '_' or '-'`);
85
+ const name = z.string().min(1).max(CATALOG_LIMITS.couponNameMax);
86
+ export const createCouponParams = z
87
+ .object({
88
+ id: couponId
89
+ .optional()
90
+ .describe('Your own id (`SUMMER25`); generated (`coupon_…`) when absent.'),
91
+ name: name.optional(),
92
+ percent_off: percentOff.optional(),
93
+ amount_off: baseUnitAmountParam.optional(),
94
+ currency: currency.optional().describe('Required with `amount_off`.'),
95
+ duration: z.enum(COUPON_DURATIONS).optional().describe('Default `once`.'),
96
+ duration_in_months: z
97
+ .number()
98
+ .int()
99
+ .min(1)
100
+ .max(CATALOG_LIMITS.couponDurationInMonthsMax)
101
+ .optional()
102
+ .describe('Required for `repeating`.'),
103
+ max_redemptions: countParam.optional(),
104
+ redeem_by: positiveUnixSecondsParam.optional().describe('Unix seconds, in the future.'),
105
+ applies_to: z
106
+ .object({
107
+ products: z
108
+ .array(z.string().min(1).max(255))
109
+ .min(1)
110
+ .max(CATALOG_LIMITS.couponAppliesToProductsMax),
111
+ })
112
+ .strict()
113
+ .optional(),
114
+ metadata: metadataCreateParam.optional(),
115
+ expand: expandParam.optional(),
116
+ })
117
+ .strict()
118
+ .superRefine((body, ctx) => {
119
+ const issue = (path, message) => ctx.addIssue({ code: 'custom', path: [path], message });
120
+ if ((body.percent_off === undefined) === (body.amount_off === undefined)) {
121
+ issue('percent_off', 'a coupon takes exactly one of percent_off and amount_off');
122
+ }
123
+ if (body.amount_off !== undefined && body.currency === undefined) {
124
+ issue('currency', 'amount_off needs a currency');
125
+ }
126
+ if (body.amount_off === undefined && body.currency !== undefined) {
127
+ issue('currency', 'currency is only for an amount_off coupon');
128
+ }
129
+ if (body.amount_off === '0')
130
+ issue('amount_off', 'amount_off must be positive');
131
+ checkAmountBound(ctx, body.amount_off, body.currency, ['amount_off']);
132
+ const duration = body.duration ?? 'once';
133
+ if (duration === 'repeating' && body.duration_in_months === undefined) {
134
+ issue('duration_in_months', 'a repeating coupon needs duration_in_months');
135
+ }
136
+ if (duration !== 'repeating' && body.duration_in_months !== undefined) {
137
+ issue('duration_in_months', 'duration_in_months is only for a repeating coupon');
138
+ }
139
+ });
140
+ export const updateCouponParams = z
141
+ .object({
142
+ name: clearing(name).optional().describe('`""` clears it.'),
143
+ metadata: metadataUpdateParam.optional(),
144
+ expand: expandParam.optional(),
145
+ })
146
+ .strict();
147
+ export const listCouponsQuery = listQuery({});
148
+ export const couponRoutes = [
149
+ defineRoute({
150
+ operationId: 'createCoupon',
151
+ method: 'post',
152
+ path: '/v1/coupons',
153
+ tag: 'Coupons',
154
+ summary: 'Create a coupon',
155
+ auth: 'service',
156
+ scope: 'payments:write',
157
+ idempotent: true,
158
+ body: createCouponParams,
159
+ response: couponSchema,
160
+ sdk: 'coupons.create',
161
+ expandable: 'coupon',
162
+ }),
163
+ defineRoute({
164
+ operationId: 'listCoupons',
165
+ method: 'get',
166
+ path: '/v1/coupons',
167
+ tag: 'Coupons',
168
+ summary: 'List coupons',
169
+ auth: 'service',
170
+ scope: 'payments:read',
171
+ query: listCouponsQuery,
172
+ response: listOf(couponSchema),
173
+ sdk: 'coupons.list',
174
+ expandable: 'coupon',
175
+ }),
176
+ defineRoute({
177
+ operationId: 'retrieveCoupon',
178
+ method: 'get',
179
+ path: '/v1/coupons/{id}',
180
+ tag: 'Coupons',
181
+ summary: 'Retrieve a coupon',
182
+ auth: 'service',
183
+ scope: 'payments:read',
184
+ params: { id: 'The coupon (`SUMMER25`, `coupon_…`).' },
185
+ query: expandOnlyQuery,
186
+ response: couponSchema,
187
+ sdk: 'coupons.retrieve',
188
+ expandable: 'coupon',
189
+ }),
190
+ defineRoute({
191
+ operationId: 'updateCoupon',
192
+ method: 'post',
193
+ path: '/v1/coupons/{id}',
194
+ tag: 'Coupons',
195
+ summary: 'Update a coupon',
196
+ description: 'Only `name` and `metadata` change.',
197
+ auth: 'service',
198
+ scope: 'payments:write',
199
+ idempotent: true,
200
+ params: { id: 'The coupon (`SUMMER25`, `coupon_…`).' },
201
+ body: updateCouponParams,
202
+ response: couponSchema,
203
+ sdk: 'coupons.update',
204
+ expandable: 'coupon',
205
+ }),
206
+ defineRoute({
207
+ operationId: 'deleteCoupon',
208
+ method: 'delete',
209
+ path: '/v1/coupons/{id}',
210
+ tag: 'Coupons',
211
+ summary: 'Delete a coupon',
212
+ description: 'Discounts customers already hold are not affected; the id is never reused.',
213
+ auth: 'service',
214
+ scope: 'payments:write',
215
+ params: { id: 'The coupon (`SUMMER25`, `coupon_…`).' },
216
+ response: deletedCouponSchema,
217
+ sdk: 'coupons.del',
218
+ }),
219
+ ];
@@ -0,0 +1,254 @@
1
+ import { z } from 'zod';
2
+ import { deletedOf, listOf } from '../../common/envelopes.js';
3
+ import { defineComponent, defineObject } from '../../common/objects.js';
4
+ import { expandOnlyQuery, idParam, listQuery, metadataCreateParam, metadataUpdateParam, } from '../../common/params.js';
5
+ import { livemode, metadata, unixSeconds } from '../../common/primitives.js';
6
+ import { defineRoute } from '../../route.js';
7
+ import { queryFlag } from './shared.js';
8
+ /**
9
+ * Entitlements (ADR 0018 §8): features (`feat_…`) a product grants, and what a
10
+ * customer may access NOW. `lookup_key` is what an app checks access by.
11
+ */
12
+ /** A feature (`feat_…`) a product grants — `lookup_key` is what an app checks. */
13
+ export const entitlementFeatureSchema = defineObject('entitlements.feature', 'EntitlementFeature', z
14
+ .object({
15
+ id: z.string(),
16
+ object: z.literal('entitlements.feature'),
17
+ livemode,
18
+ lookup_key: z.string().describe('What an app checks access by; unique per merchant.'),
19
+ name: z.string(),
20
+ active: z
21
+ .boolean()
22
+ .describe('`false`: archived, and withdrawn from every customer that held it.'),
23
+ metadata,
24
+ created: unixSeconds,
25
+ })
26
+ .strict(), {
27
+ examples: [
28
+ {
29
+ id: 'feat_0193b8f2c1a87d3e9f4f',
30
+ object: 'entitlements.feature',
31
+ livemode: false,
32
+ lookup_key: 'mention_plus',
33
+ name: 'Mention Plus',
34
+ active: true,
35
+ metadata: {},
36
+ created: 1793750400,
37
+ },
38
+ ],
39
+ });
40
+ /** A feature attached to a product (`prodft_…`). */
41
+ export const productFeatureSchema = defineObject('product_feature', 'ProductFeature', z
42
+ .object({
43
+ id: z.string(),
44
+ object: z.literal('product_feature'),
45
+ livemode,
46
+ product: z.string().describe('The product (`prod_…`) that grants it.'),
47
+ entitlement_feature: entitlementFeatureSchema,
48
+ })
49
+ .strict(), {
50
+ examples: [
51
+ {
52
+ id: 'prodft_0193b8f2c1a87d3e9f50',
53
+ object: 'product_feature',
54
+ livemode: false,
55
+ product: 'prod_0193b8f2c1a87d3e9f4a',
56
+ entitlement_feature: {
57
+ id: 'feat_0193b8f2c1a87d3e9f4f',
58
+ object: 'entitlements.feature',
59
+ livemode: false,
60
+ lookup_key: 'mention_plus',
61
+ name: 'Mention Plus',
62
+ active: true,
63
+ metadata: {},
64
+ created: 1793750400,
65
+ },
66
+ },
67
+ ],
68
+ });
69
+ /** What `DELETE /v1/products/{id}/features/{feature}` answers. */
70
+ export const deletedProductFeatureSchema = defineComponent('DeletedProductFeature', deletedOf('product_feature'));
71
+ /**
72
+ * One feature a customer is entitled to right now: some product granting it is
73
+ * on a `trialing`, `active` or `past_due` subscription of theirs. Several
74
+ * products granting the same feature give ONE entitlement — Mention Plus
75
+ * through the Plus product or through Oxy One is the same access.
76
+ */
77
+ export const activeEntitlementSchema = defineObject('entitlements.active_entitlement', 'ActiveEntitlement', z
78
+ .object({
79
+ id: z.string().describe('Stable per customer and feature.'),
80
+ object: z.literal('entitlements.active_entitlement'),
81
+ livemode,
82
+ feature: z.string().describe('The feature (`feat_…`).'),
83
+ lookup_key: z.string(),
84
+ })
85
+ .strict(), {
86
+ examples: [
87
+ {
88
+ id: 'ent_5f1c0a9e2b7d4c3a8e6f1b2d',
89
+ object: 'entitlements.active_entitlement',
90
+ livemode: false,
91
+ feature: 'feat_0193b8f2c1a87d3e9f4f',
92
+ lookup_key: 'mention_plus',
93
+ },
94
+ ],
95
+ });
96
+ /** What `entitlements.active_entitlement_summary.updated` carries: a customer's complete set. */
97
+ export const activeEntitlementSummarySchema = defineObject('entitlements.active_entitlement_summary', 'ActiveEntitlementSummary', z
98
+ .object({
99
+ object: z.literal('entitlements.active_entitlement_summary'),
100
+ livemode,
101
+ customer: z.string().describe('The customer (`cus_…`).'),
102
+ entitlements: z
103
+ .object({
104
+ object: z.literal('list'),
105
+ data: z.array(activeEntitlementSchema),
106
+ has_more: z.literal(false),
107
+ url: z.string(),
108
+ })
109
+ .strict()
110
+ .describe('The complete set: never paged.'),
111
+ })
112
+ .strict());
113
+ const name = z.string().min(1).max(80);
114
+ export const createEntitlementFeatureParams = z
115
+ .object({
116
+ lookup_key: z.string().regex(/^[A-Za-z0-9_.:-]{1,80}$/),
117
+ name,
118
+ metadata: metadataCreateParam.optional(),
119
+ })
120
+ .strict();
121
+ export const updateEntitlementFeatureParams = z
122
+ .object({
123
+ name: name.optional(),
124
+ active: z
125
+ .boolean()
126
+ .optional()
127
+ .describe('`false` archives it and withdraws it from every customer that held it.'),
128
+ metadata: metadataUpdateParam.optional(),
129
+ })
130
+ .strict();
131
+ export const listEntitlementFeaturesQuery = listQuery({
132
+ lookup_key: z.string().min(1).max(80).optional(),
133
+ archived: queryFlag.optional(),
134
+ });
135
+ export const attachProductFeatureParams = z
136
+ .object({ entitlement_feature: idParam.describe('The feature (`feat_…`) to grant.') })
137
+ .strict();
138
+ export const listProductFeaturesQuery = listQuery({});
139
+ export const listActiveEntitlementsQuery = listQuery({
140
+ customer: idParam.describe('The customer (`cus_…`).'),
141
+ });
142
+ const featureId = { id: 'The feature (`feat_…`).' };
143
+ export const entitlementRoutes = [
144
+ defineRoute({
145
+ operationId: 'createEntitlementFeature',
146
+ method: 'post',
147
+ path: '/v1/entitlements/features',
148
+ tag: 'Entitlements',
149
+ summary: 'Create a feature',
150
+ auth: 'service',
151
+ scope: 'payments:write',
152
+ idempotent: true,
153
+ body: createEntitlementFeatureParams,
154
+ response: entitlementFeatureSchema,
155
+ sdk: 'entitlements.features.create',
156
+ }),
157
+ defineRoute({
158
+ operationId: 'listEntitlementFeatures',
159
+ method: 'get',
160
+ path: '/v1/entitlements/features',
161
+ tag: 'Entitlements',
162
+ summary: 'List features',
163
+ auth: 'service',
164
+ scope: 'payments:read',
165
+ query: listEntitlementFeaturesQuery,
166
+ response: listOf(entitlementFeatureSchema),
167
+ sdk: 'entitlements.features.list',
168
+ expandable: 'entitlements.feature',
169
+ }),
170
+ defineRoute({
171
+ operationId: 'retrieveEntitlementFeature',
172
+ method: 'get',
173
+ path: '/v1/entitlements/features/{id}',
174
+ tag: 'Entitlements',
175
+ summary: 'Retrieve a feature',
176
+ auth: 'service',
177
+ scope: 'payments:read',
178
+ params: featureId,
179
+ query: expandOnlyQuery,
180
+ response: entitlementFeatureSchema,
181
+ sdk: 'entitlements.features.retrieve',
182
+ }),
183
+ defineRoute({
184
+ operationId: 'updateEntitlementFeature',
185
+ method: 'post',
186
+ path: '/v1/entitlements/features/{id}',
187
+ tag: 'Entitlements',
188
+ summary: 'Update a feature',
189
+ description: '`active: false` archives it and withdraws it from every customer that held it.',
190
+ auth: 'service',
191
+ scope: 'payments:write',
192
+ idempotent: true,
193
+ params: featureId,
194
+ body: updateEntitlementFeatureParams,
195
+ response: entitlementFeatureSchema,
196
+ sdk: 'entitlements.features.update',
197
+ }),
198
+ defineRoute({
199
+ operationId: 'attachProductFeature',
200
+ method: 'post',
201
+ path: '/v1/products/{id}/features',
202
+ tag: 'Entitlements',
203
+ summary: 'Attach a feature to a product',
204
+ auth: 'service',
205
+ scope: 'payments:write',
206
+ idempotent: true,
207
+ params: { id: 'The product (`prod_…`).' },
208
+ body: attachProductFeatureParams,
209
+ response: productFeatureSchema,
210
+ sdk: 'entitlements.productFeatures.attach',
211
+ }),
212
+ defineRoute({
213
+ operationId: 'listProductFeatures',
214
+ method: 'get',
215
+ path: '/v1/products/{id}/features',
216
+ tag: 'Entitlements',
217
+ summary: "List a product's features",
218
+ auth: 'service',
219
+ scope: 'payments:read',
220
+ params: { id: 'The product (`prod_…`).' },
221
+ query: listProductFeaturesQuery,
222
+ response: listOf(productFeatureSchema),
223
+ sdk: 'entitlements.productFeatures.list',
224
+ expandable: 'product_feature',
225
+ }),
226
+ defineRoute({
227
+ operationId: 'detachProductFeature',
228
+ method: 'delete',
229
+ path: '/v1/products/{id}/features/{feature}',
230
+ tag: 'Entitlements',
231
+ summary: 'Detach a feature from a product',
232
+ auth: 'service',
233
+ scope: 'payments:write',
234
+ params: {
235
+ id: 'The product (`prod_…`).',
236
+ feature: 'The attachment (`prodft_…`).',
237
+ },
238
+ response: deletedProductFeatureSchema,
239
+ sdk: 'entitlements.productFeatures.detach',
240
+ }),
241
+ defineRoute({
242
+ operationId: 'listActiveEntitlements',
243
+ method: 'get',
244
+ path: '/v1/entitlements/active_entitlements',
245
+ tag: 'Entitlements',
246
+ summary: "List a customer's active entitlements",
247
+ description: 'What the customer may access NOW: one entitlement per feature, however many products grant it. A complete set, never paged (`has_more` is always `false`).',
248
+ auth: 'service',
249
+ scope: 'payments:read',
250
+ query: listActiveEntitlementsQuery,
251
+ response: listOf(activeEntitlementSchema),
252
+ sdk: 'entitlements.activeEntitlements.list',
253
+ }),
254
+ ];
@@ -0,0 +1,38 @@
1
+ // Contracts of this group: one module per resource, re-exported here, and
2
+ // their routes concatenated into `catalogRoutes`.
3
+ import { billingRoutes } from './billing.js';
4
+ import { billingSettingsRoutes } from './billingSettings.js';
5
+ import { couponRoutes } from './coupons.js';
6
+ import { entitlementRoutes } from './entitlements.js';
7
+ import { meterRoutes } from './meters.js';
8
+ import { priceRoutes } from './prices.js';
9
+ import { productRoutes } from './products.js';
10
+ import { promotionCodeRoutes } from './promotionCodes.js';
11
+ import { testClockRoutes } from './testClocks.js';
12
+ export * from './billing.js';
13
+ export * from './billingSettings.js';
14
+ export * from './coupons.js';
15
+ export * from './entitlements.js';
16
+ export * from './meters.js';
17
+ export * from './prices.js';
18
+ export * from './products.js';
19
+ export * from './promotionCodes.js';
20
+ export * from './testClocks.js';
21
+ // The request pieces every body naming an amount, an inline price or a filter reuses.
22
+ export { baseUnitAmountParam, queryFlag, queryIdList } from './shared.js';
23
+ /**
24
+ * The catalog (products, prices, coupons, promotion codes), entitlements, the
25
+ * billing engine's platform objects (test clocks, billing settings, meters)
26
+ * and the recurring billing transport (`/v1/billing/*`).
27
+ */
28
+ export const catalogRoutes = [
29
+ ...productRoutes,
30
+ ...priceRoutes,
31
+ ...couponRoutes,
32
+ ...promotionCodeRoutes,
33
+ ...entitlementRoutes,
34
+ ...testClockRoutes,
35
+ ...billingSettingsRoutes,
36
+ ...meterRoutes,
37
+ ...billingRoutes,
38
+ ];