@peable.to/contracts 0.3.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 -97
  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 -94
  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 -134
  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 -138
  315. package/dist/esm/openapi.js +0 -134
  316. package/dist/types/openapi.d.ts +0 -145
@@ -0,0 +1,260 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.connectedAccountRoutes = exports.createConnectedAccountLinkParams = exports.refreshConnectedAccountParams = exports.listConnectedAccountsQuery = exports.createConnectedAccountParams = exports.connectedAccountSchema = exports.connectedAccountFaircoinSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const envelopes_1 = require("../../common/envelopes");
6
+ const objects_1 = require("../../common/objects");
7
+ const params_1 = require("../../common/params");
8
+ const primitives_1 = require("../../common/primitives");
9
+ const route_1 = require("../../route");
10
+ const connect_1 = require("../../vocabulary/connect");
11
+ const money_1 = require("../../vocabulary/money");
12
+ const account_1 = require("./account");
13
+ /**
14
+ * Connected accounts (`ca_…`) — a marketplace's sellers (ADR 0012).
15
+ *
16
+ * ## The provider's own ids are not here, and that is the contract
17
+ *
18
+ * ADR 0001 D3: a merchant integrates against Peable and never learns which
19
+ * acquirer sat behind their seller, because the day that changes should be a
20
+ * Peable deploy and not a merchant migration. No `acct_…`, no provider name —
21
+ * and no seller xpub (ADR 0012 D6): an account xpub reveals every address of
22
+ * that account, so a platform holding it would learn the seller's whole history
23
+ * and balance. Nothing a platform does needs it; each payment carries its own
24
+ * address.
25
+ */
26
+ const capabilityStatus = zod_1.z.enum(connect_1.ACCOUNT_CAPABILITY_STATUSES);
27
+ /** The FairCoin half of a seller's account. The seller's xpub is deliberately ABSENT (ADR 0012 D6). */
28
+ exports.connectedAccountFaircoinSchema = (0, objects_1.defineComponent)('ConnectedAccountFaircoin', zod_1.z
29
+ .object({
30
+ network: primitives_1.network.describe('The chain the seller is paid on. Fixed when the half was opened.'),
31
+ status: zod_1.z
32
+ .enum(connect_1.CONNECTED_ACCOUNT_FAIRCOIN_STATUSES)
33
+ .describe('`pending`: the seller has not registered a key yet (an on-behalf payment is refused, `account_not_ready`). `active`: payments derive addresses from their key.'),
34
+ oxy_user_id: zod_1.z
35
+ .string()
36
+ .describe('The Oxy user who may register the key — and, once `active`, who did.'),
37
+ registered_at: primitives_1.unixSeconds
38
+ .nullable()
39
+ .describe('When the seller registered their key. `null` while `pending`.'),
40
+ })
41
+ .strict());
42
+ exports.connectedAccountSchema = (0, objects_1.defineObject)('connected_account', 'ConnectedAccount', zod_1.z
43
+ .object({
44
+ id: zod_1.z.string(),
45
+ object: zod_1.z.literal('connected_account'),
46
+ livemode: primitives_1.livemode,
47
+ external_ref: zod_1.z
48
+ .string()
49
+ .describe("The merchant's OWN id for this seller — how they address it."),
50
+ rails: zod_1.z
51
+ .array(zod_1.z.enum(connect_1.CONNECTED_ACCOUNT_RAILS))
52
+ .describe('Which halves this account has. Never empty.'),
53
+ faircoin: exports.connectedAccountFaircoinSchema
54
+ .nullable()
55
+ .describe("The FairCoin half, or `null` when the platform never opened one. Readiness for FairCoin is `faircoin.status === 'active'`; `payable` is about the CARD half."),
56
+ country: zod_1.z
57
+ .string()
58
+ .nullable()
59
+ .describe('ISO 3166-1 alpha-2, upper-case. `null` on a FairCoin-only seller, which has no card half.'),
60
+ default_currency: zod_1.z.string().nullable(),
61
+ payable: zod_1.z
62
+ .boolean()
63
+ .describe('Whether this seller can receive a CARD settlement (a transfer) right now. A convenience: every field it is derived from is here too. Always `false` on a FairCoin-only seller.'),
64
+ payouts_enabled: zod_1.z.boolean(),
65
+ charges_enabled: zod_1.z.boolean(),
66
+ transfers_capability: capabilityStatus
67
+ .nullable()
68
+ .describe('`null`: never requested — a different fact from the provider declining it.'),
69
+ card_payments_capability: capabilityStatus.nullable(),
70
+ requirements: account_1.accountRequirementsSchema,
71
+ last_synced_at: primitives_1.unixSeconds.nullable(),
72
+ created: primitives_1.unixSeconds,
73
+ updated_at: primitives_1.unixSeconds,
74
+ })
75
+ .strict(), {
76
+ examples: [
77
+ {
78
+ id: 'ca_0193b8f2d4e1aa07c3b2',
79
+ object: 'connected_account',
80
+ livemode: false,
81
+ external_ref: 'seller_4821',
82
+ rails: ['card', 'faircoin'],
83
+ faircoin: {
84
+ network: 'mainnet',
85
+ status: 'active',
86
+ oxy_user_id: '665f1c0e9a1b2c3d4e5f6a7b',
87
+ registered_at: 1793751000,
88
+ },
89
+ country: 'DE',
90
+ default_currency: 'EUR',
91
+ payable: true,
92
+ payouts_enabled: true,
93
+ charges_enabled: true,
94
+ transfers_capability: 'active',
95
+ card_payments_capability: 'active',
96
+ requirements: {
97
+ currently_due: [],
98
+ eventually_due: [],
99
+ past_due: [],
100
+ pending_verification: [],
101
+ disabled_reason: null,
102
+ },
103
+ last_synced_at: 1793751060,
104
+ created: 1793750400,
105
+ updated_at: 1793751060,
106
+ },
107
+ ],
108
+ });
109
+ /** Bounded for the reason `external_ref` is: it is stored, and it is compared. */
110
+ const OXY_USER_ID_MAX = 128;
111
+ /**
112
+ * `POST /v1/connected_accounts`: open (or return) the account for one seller.
113
+ *
114
+ * Two halves, at least one: the CARD half (`country` + `business_type`, both or
115
+ * neither) and the FAIRCOIN half (`faircoin`). There is deliberately no `xpub`
116
+ * here: the key comes from the SELLER's own session, never from the platform
117
+ * (ADR 0012 D3).
118
+ */
119
+ exports.createConnectedAccountParams = zod_1.z
120
+ .object({
121
+ // Bounded because it is a key: an unbounded string here is an unbounded
122
+ // index entry and an unbounded response field.
123
+ external_ref: zod_1.z
124
+ .string()
125
+ .min(1)
126
+ .max(255)
127
+ .describe('Your own id for the seller. Opening the same `external_ref` again answers that account (200).'),
128
+ country: zod_1.z
129
+ .string()
130
+ .length(2)
131
+ .optional()
132
+ .describe('The card half: ISO 3166-1 alpha-2 (case-insensitive). With `business_type`.'),
133
+ business_type: zod_1.z
134
+ .enum(connect_1.ACCOUNT_BUSINESS_TYPES)
135
+ .optional()
136
+ .describe('The card half: with `country`.'),
137
+ faircoin: zod_1.z
138
+ .object({
139
+ network: zod_1.z.enum(money_1.NETWORK_TYPES),
140
+ oxy_user_id: zod_1.z
141
+ .string()
142
+ .min(1)
143
+ .max(OXY_USER_ID_MAX)
144
+ .describe("The seller's Oxy user id — the only person who may register the key."),
145
+ })
146
+ .strict()
147
+ .optional()
148
+ .describe('The FairCoin half (ADR 0012 D2): the chain the seller is paid on, and who they are.'),
149
+ })
150
+ .strict()
151
+ .refine((body) => (body.country === undefined) === (body.business_type === undefined), {
152
+ message: 'a card account needs both country and business_type, or neither',
153
+ })
154
+ .refine((body) => body.country !== undefined || body.faircoin !== undefined, {
155
+ message: 'open at least one rail: country and business_type for cards, faircoin for FairCoin',
156
+ });
157
+ exports.listConnectedAccountsQuery = (0, params_1.listQuery)({});
158
+ /** `POST /v1/connected_accounts/{accountId}/refresh` takes no parameters. */
159
+ exports.refreshConnectedAccountParams = zod_1.z.object({}).strict();
160
+ /** A seller's onboarding link. */
161
+ exports.createConnectedAccountLinkParams = zod_1.z
162
+ .object({
163
+ refresh_url: zod_1.z.url().describe('Where the seller goes when the link has expired.'),
164
+ return_url: zod_1.z.url().describe('Where the seller returns when they leave the flow.'),
165
+ rail: zod_1.z
166
+ .enum(connect_1.CONNECTED_ACCOUNT_RAILS)
167
+ .optional()
168
+ .describe("Which half to onboard: `card` (the default) is the provider's hosted onboarding; `faircoin` is Peable's own page where the SELLER registers their watch-only key."),
169
+ })
170
+ .strict();
171
+ const accountIdParam = { accountId: 'The connected account (`ca_…`).' };
172
+ exports.connectedAccountRoutes = [
173
+ (0, route_1.defineRoute)({
174
+ operationId: 'createConnectedAccount',
175
+ method: 'post',
176
+ path: '/v1/connected_accounts',
177
+ tag: 'Connected accounts',
178
+ summary: 'Open a connected account',
179
+ description: 'Opens the account for one seller (201), or answers the one this `external_ref` already opened (200) — a provider account cannot be deleted, so a converged retry says so.',
180
+ auth: 'service',
181
+ scope: 'payments:write',
182
+ idempotent: true,
183
+ body: exports.createConnectedAccountParams,
184
+ response: exports.connectedAccountSchema,
185
+ status: 201,
186
+ sdk: 'connectedAccounts.create',
187
+ }),
188
+ (0, route_1.defineRoute)({
189
+ operationId: 'listConnectedAccounts',
190
+ method: 'get',
191
+ path: '/v1/connected_accounts',
192
+ tag: 'Connected accounts',
193
+ summary: 'List connected accounts',
194
+ description: 'Every seller this merchant has onboarded, newest first.',
195
+ auth: 'service',
196
+ scope: 'payments:read',
197
+ query: exports.listConnectedAccountsQuery,
198
+ response: (0, envelopes_1.listOf)(exports.connectedAccountSchema),
199
+ sdk: 'connectedAccounts.list',
200
+ expandable: 'connected_account',
201
+ }),
202
+ (0, route_1.defineRoute)({
203
+ operationId: 'retrieveConnectedAccountByRef',
204
+ method: 'get',
205
+ path: '/v1/connected_accounts/by_ref/{externalRef}',
206
+ tag: 'Connected accounts',
207
+ summary: 'Retrieve a connected account by your id',
208
+ description: 'By `external_ref`, the durable address you already hold — so a create whose answer never arrived is recoverable without a list scan.',
209
+ auth: 'service',
210
+ scope: 'payments:read',
211
+ params: { externalRef: 'Your own id for the seller.' },
212
+ query: params_1.expandOnlyQuery,
213
+ response: exports.connectedAccountSchema,
214
+ sdk: 'connectedAccounts.retrieveByRef',
215
+ }),
216
+ (0, route_1.defineRoute)({
217
+ operationId: 'retrieveConnectedAccount',
218
+ method: 'get',
219
+ path: '/v1/connected_accounts/{accountId}',
220
+ tag: 'Connected accounts',
221
+ summary: 'Retrieve a connected account',
222
+ auth: 'service',
223
+ scope: 'payments:read',
224
+ params: accountIdParam,
225
+ query: params_1.expandOnlyQuery,
226
+ response: exports.connectedAccountSchema,
227
+ sdk: 'connectedAccounts.retrieve',
228
+ }),
229
+ (0, route_1.defineRoute)({
230
+ operationId: 'refreshConnectedAccount',
231
+ method: 'post',
232
+ path: '/v1/connected_accounts/{accountId}/refresh',
233
+ tag: 'Connected accounts',
234
+ summary: 'Refresh a connected account',
235
+ description: 'Re-reads the account from the provider now. The sweep and the inbound event keep it fresh on their own; this is for a seller watching a screen.',
236
+ auth: 'service',
237
+ scope: 'payments:write',
238
+ idempotent: true,
239
+ params: accountIdParam,
240
+ body: exports.refreshConnectedAccountParams,
241
+ response: exports.connectedAccountSchema,
242
+ sdk: 'connectedAccounts.refresh',
243
+ }),
244
+ (0, route_1.defineRoute)({
245
+ operationId: 'createConnectedAccountLink',
246
+ method: 'post',
247
+ path: '/v1/connected_accounts/{accountId}/account_links',
248
+ tag: 'Connected accounts',
249
+ summary: "Create a seller's onboarding link",
250
+ description: 'Minted on demand and never stored: single-use and short-lived. A visit to `return_url` proves nothing about verification — read the account back.',
251
+ auth: 'service',
252
+ scope: 'payments:write',
253
+ idempotent: true,
254
+ params: accountIdParam,
255
+ body: exports.createConnectedAccountLinkParams,
256
+ response: account_1.accountLinkSchema,
257
+ status: 201,
258
+ sdk: 'connectedAccounts.createAccountLink',
259
+ }),
260
+ ];
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.connectRoutes = void 0;
18
+ const account_1 = require("./account");
19
+ const applicationFees_1 = require("./applicationFees");
20
+ const balance_1 = require("./balance");
21
+ const connectedAccounts_1 = require("./connectedAccounts");
22
+ const onboarding_1 = require("./onboarding");
23
+ const payouts_1 = require("./payouts");
24
+ const reporting_1 = require("./reporting");
25
+ const requestLogs_1 = require("./requestLogs");
26
+ const transfers_1 = require("./transfers");
27
+ __exportStar(require("./account"), exports);
28
+ __exportStar(require("./applicationFees"), exports);
29
+ __exportStar(require("./balance"), exports);
30
+ __exportStar(require("./connectedAccounts"), exports);
31
+ __exportStar(require("./onboarding"), exports);
32
+ __exportStar(require("./payouts"), exports);
33
+ __exportStar(require("./reporting"), exports);
34
+ __exportStar(require("./requestLogs"), exports);
35
+ __exportStar(require("./transfers"), exports);
36
+ /**
37
+ * Connect and money (ADR 0012, ADR 0015): connected accounts and their
38
+ * onboarding, the merchant's account, balance, payouts, application fees,
39
+ * transfers, reporting and the request log.
40
+ */
41
+ exports.connectRoutes = [
42
+ ...connectedAccounts_1.connectedAccountRoutes,
43
+ ...account_1.accountRoutes,
44
+ ...balance_1.balanceRoutes,
45
+ ...payouts_1.payoutRoutes,
46
+ ...applicationFees_1.applicationFeeRoutes,
47
+ ...onboarding_1.connectOnboardingRoutes,
48
+ ...transfers_1.transferRoutes,
49
+ ...reporting_1.reportingRoutes,
50
+ ...requestLogs_1.requestLogRoutes,
51
+ ];
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.connectOnboardingRoutes = exports.registerFaircoinKeyParams = exports.connectOnboardingCompleteSchema = exports.connectOnboardingSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const objects_1 = require("../../common/objects");
6
+ const primitives_1 = require("../../common/primitives");
7
+ const route_1 = require("../../route");
8
+ const shared_1 = require("../checkout/shared");
9
+ /**
10
+ * The SELLER-facing half of FairCoin connected accounts (ADR 0012 D3).
11
+ *
12
+ * A platform mints an onboarding link for a seller's account; the SELLER opens
13
+ * it signed in with Oxy and registers the watch-only key their FairCoin will be
14
+ * paid to. These routes are `auth: 'user'` — the seller's own session, never a
15
+ * service token — because the key that decides who receives a seller's money is
16
+ * accepted only from the seller. A platform cannot reach them at all, and the
17
+ * link token alone is not enough without the session it names.
18
+ */
19
+ exports.connectOnboardingSchema = (0, objects_1.defineObject)('connect_onboarding', 'ConnectOnboarding', zod_1.z
20
+ .object({
21
+ object: zod_1.z.literal('connect_onboarding'),
22
+ account_id: zod_1.z.string().describe('The `ca_…` being onboarded.'),
23
+ // The platform's public display, as a payer would see it: never a
24
+ // webhook secret, never a key.
25
+ platform: shared_1.merchantDisplaySchema.describe("Who is asking: the PLATFORM's public display, as a payer would see it."),
26
+ network: primitives_1.network.describe('The chain the seller will be paid on. Their key must be for it.'),
27
+ expires_at: primitives_1.unixSeconds.describe('When this link stops working.'),
28
+ return_url: zod_1.z.string().describe('Where to send the seller once the key is registered.'),
29
+ })
30
+ .strict());
31
+ /** The answer to a successful registration. */
32
+ exports.connectOnboardingCompleteSchema = (0, objects_1.defineComponent)('ConnectOnboardingComplete', zod_1.z
33
+ .object({
34
+ object: zod_1.z.literal('connect_onboarding'),
35
+ account_id: zod_1.z.string(),
36
+ status: zod_1.z.literal('active'),
37
+ return_url: zod_1.z.string(),
38
+ })
39
+ .strict());
40
+ /**
41
+ * An extended public key is 111 characters in base58check; the bound is a
42
+ * request-size guard with headroom, not a format check — the non-custody
43
+ * firewall (`assertWatchOnly`) is.
44
+ */
45
+ const XPUB_MAX_LENGTH = 200;
46
+ /** `POST /v1/connect/onboarding/{token}/faircoin` — the seller's watch-only ACCOUNT xpub. */
47
+ exports.registerFaircoinKeyParams = zod_1.z
48
+ .object({
49
+ xpub: zod_1.z
50
+ .string()
51
+ .trim()
52
+ .min(1)
53
+ .max(XPUB_MAX_LENGTH)
54
+ .describe('A watch-only extended PUBLIC key. A private extended key is refused (`watch_only_violation`) and never stored.'),
55
+ })
56
+ .strict();
57
+ const tokenParam = { token: 'The onboarding link token (the last segment of its `url`).' };
58
+ exports.connectOnboardingRoutes = [
59
+ (0, route_1.defineRoute)({
60
+ operationId: 'retrieveConnectOnboarding',
61
+ method: 'get',
62
+ path: '/v1/connect/onboarding/{token}',
63
+ tag: 'Connect onboarding',
64
+ summary: 'Retrieve an onboarding link',
65
+ description: 'What the seller is being asked to do. Looking consumes nothing. An expired link answers 410 `link_expired` with the platform’s `refresh_url`.',
66
+ auth: 'user',
67
+ params: tokenParam,
68
+ response: exports.connectOnboardingSchema,
69
+ }),
70
+ (0, route_1.defineRoute)({
71
+ operationId: 'registerConnectOnboardingFaircoinKey',
72
+ method: 'post',
73
+ path: '/v1/connect/onboarding/{token}/faircoin',
74
+ tag: 'Connect onboarding',
75
+ summary: "Register the seller's FairCoin key",
76
+ description: 'The ONLY way a key reaches a connected account: runs the non-custody firewall, consumes the link and tells the platform (`connected_account.updated`), in one transaction. The key is immutable once registered and never appears on any response.',
77
+ auth: 'user',
78
+ params: tokenParam,
79
+ body: exports.registerFaircoinKeyParams,
80
+ response: exports.connectOnboardingCompleteSchema,
81
+ }),
82
+ ];
@@ -0,0 +1,196 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.payoutRoutes = exports.payoutReconciliationQuery = exports.cancelPayoutParams = exports.listPayoutsQuery = exports.createPayoutParams = exports.payoutReconciliationReportSchema = exports.payoutSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const envelopes_1 = require("../../common/envelopes");
6
+ const objects_1 = require("../../common/objects");
7
+ const params_1 = require("../../common/params");
8
+ const primitives_1 = require("../../common/primitives");
9
+ const route_1 = require("../../route");
10
+ const connect_1 = require("../../vocabulary/connect");
11
+ const money_1 = require("../../vocabulary/money");
12
+ const balance_1 = require("./balance");
13
+ /**
14
+ * Payouts (`po_…`) — the provider moving the merchant's balance to the
15
+ * merchant's bank (ADR 0015 §4). Executed by the provider, always; Orbit
16
+ * instructs (a manual payout) or mirrors (a scheduled one). The bank account
17
+ * itself stays at the provider and is never on this object.
18
+ */
19
+ exports.payoutSchema = (0, objects_1.defineObject)('payout', 'Payout', zod_1.z
20
+ .object({
21
+ id: zod_1.z.string(),
22
+ object: zod_1.z.literal('payout'),
23
+ livemode: primitives_1.livemode,
24
+ account: zod_1.z.string().describe('The account (`ca_…`) paid out.'),
25
+ amount: primitives_1.amount,
26
+ currency: zod_1.z.string().describe('Upper-case ISO 4217 code.'),
27
+ status: zod_1.z.enum(connect_1.PAYOUT_STATUSES),
28
+ arrival_date: primitives_1.unixSeconds
29
+ .nullable()
30
+ .describe('When the funds are expected in the bank, as the provider estimates.'),
31
+ automatic: zod_1.z
32
+ .boolean()
33
+ .describe("`true` when the provider's schedule created it, `false` for `POST /v1/payouts`."),
34
+ method: zod_1.z.enum(connect_1.PAYOUT_METHODS),
35
+ type: zod_1.z.enum(connect_1.PAYOUT_DESTINATION_TYPES),
36
+ description: zod_1.z.string().nullable(),
37
+ statement_descriptor: zod_1.z.string().nullable(),
38
+ failure_code: zod_1.z
39
+ .string()
40
+ .nullable()
41
+ .describe("The provider's failure code when `failed`; never its prose."),
42
+ balance_transaction: zod_1.z
43
+ .string()
44
+ .nullable()
45
+ .describe("The payout's own `txn_…` once ingested."),
46
+ metadata: primitives_1.metadata,
47
+ created: primitives_1.unixSeconds,
48
+ })
49
+ .strict(), {
50
+ examples: [
51
+ {
52
+ id: 'po_0193b8f31e2d4c5a9b60',
53
+ object: 'payout',
54
+ livemode: false,
55
+ account: 'ca_0193b8f2c1a87d3e9f4a',
56
+ amount: '150000',
57
+ currency: 'EUR',
58
+ status: 'in_transit',
59
+ arrival_date: 1793923200,
60
+ automatic: false,
61
+ method: 'standard',
62
+ type: 'bank_account',
63
+ description: 'November payout',
64
+ statement_descriptor: 'ROSEN PAYOUT',
65
+ failure_code: null,
66
+ balance_transaction: 'txn_0193b8f31f0a7e3d2c41',
67
+ metadata: {},
68
+ created: 1793750400,
69
+ },
70
+ ],
71
+ });
72
+ /**
73
+ * `GET /v1/reports/payout_reconciliation?payout=po_…` — the balance
74
+ * transactions one payout paid out, with their totals. A list page with the
75
+ * report's fields beside it.
76
+ */
77
+ exports.payoutReconciliationReportSchema = (0, objects_1.defineComponent)('PayoutReconciliationReport', zod_1.z
78
+ .object({
79
+ object: zod_1.z.literal('list'),
80
+ data: zod_1.z.array(balance_1.balanceTransactionSchema),
81
+ has_more: zod_1.z.boolean(),
82
+ url: zod_1.z.string(),
83
+ payout: zod_1.z.string().describe('The payout (`po_…`) reconciled.'),
84
+ status: zod_1.z
85
+ .enum(connect_1.PAYOUT_RECONCILIATION_STATUSES)
86
+ .describe('`complete` once the payout is `paid` and its transactions were read from the provider; `pending` before — the set is not final and the totals may grow.'),
87
+ currency: zod_1.z.string(),
88
+ summary: zod_1.z
89
+ .object({
90
+ count: zod_1.z.number().int().nonnegative(),
91
+ amount: primitives_1.signedAmount,
92
+ fee: primitives_1.signedAmount,
93
+ net: primitives_1.signedAmount,
94
+ })
95
+ .strict()
96
+ .describe('Over EVERY transaction of the payout, not just this page.'),
97
+ })
98
+ .strict());
99
+ /** `POST /v1/payouts` — a payout instruction for an account on a manual schedule. */
100
+ exports.createPayoutParams = zod_1.z
101
+ .object({
102
+ amount: zod_1.z
103
+ .string()
104
+ .refine(money_1.isBaseUnitString, 'amount must be a minor-unit integer string')
105
+ .refine((value) => value !== '0', 'amount must be positive'),
106
+ currency: zod_1.z.enum(money_1.CURRENCY_CODES),
107
+ description: zod_1.z.string().max(1000).optional(),
108
+ statement_descriptor: zod_1.z.string().min(1).max(22).optional(),
109
+ method: zod_1.z.enum(connect_1.PAYOUT_METHODS).optional().describe('Defaults to `standard`.'),
110
+ metadata: params_1.metadataCreateParam.optional(),
111
+ })
112
+ .strict();
113
+ exports.listPayoutsQuery = (0, params_1.listQuery)({ status: zod_1.z.enum(connect_1.PAYOUT_STATUSES).optional() });
114
+ /** `POST /v1/payouts/{id}/cancel` takes no parameters. */
115
+ exports.cancelPayoutParams = zod_1.z.object({}).strict();
116
+ exports.payoutReconciliationQuery = (0, params_1.listQuery)({
117
+ payout: params_1.idParam.describe('The payout (`po_…`) to reconcile.'),
118
+ });
119
+ const payoutIdParam = { id: 'The payout (`po_…`).' };
120
+ exports.payoutRoutes = [
121
+ (0, route_1.defineRoute)({
122
+ operationId: 'listPayouts',
123
+ method: 'get',
124
+ path: '/v1/payouts',
125
+ tag: 'Payouts',
126
+ summary: 'List payouts',
127
+ auth: 'service',
128
+ scope: 'payments:read',
129
+ peableAccount: true,
130
+ query: exports.listPayoutsQuery,
131
+ response: (0, envelopes_1.listOf)(exports.payoutSchema),
132
+ sdk: 'payouts.list',
133
+ expandable: 'payout',
134
+ }),
135
+ (0, route_1.defineRoute)({
136
+ operationId: 'createPayout',
137
+ method: 'post',
138
+ path: '/v1/payouts',
139
+ tag: 'Payouts',
140
+ summary: 'Create a payout',
141
+ description: 'An instruction to the provider, for an account on a `manual` payout schedule. The provider executes it; Orbit never moves the money itself.',
142
+ auth: 'service',
143
+ scope: 'payments:write',
144
+ idempotent: true,
145
+ peableAccount: true,
146
+ body: exports.createPayoutParams,
147
+ response: exports.payoutSchema,
148
+ status: 201,
149
+ sdk: 'payouts.create',
150
+ }),
151
+ (0, route_1.defineRoute)({
152
+ operationId: 'retrievePayout',
153
+ method: 'get',
154
+ path: '/v1/payouts/{id}',
155
+ tag: 'Payouts',
156
+ summary: 'Retrieve a payout',
157
+ auth: 'service',
158
+ scope: 'payments:read',
159
+ peableAccount: true,
160
+ params: payoutIdParam,
161
+ query: params_1.expandOnlyQuery,
162
+ response: exports.payoutSchema,
163
+ sdk: 'payouts.retrieve',
164
+ }),
165
+ (0, route_1.defineRoute)({
166
+ operationId: 'cancelPayout',
167
+ method: 'post',
168
+ path: '/v1/payouts/{id}/cancel',
169
+ tag: 'Payouts',
170
+ summary: 'Cancel a payout',
171
+ description: 'Only a manual payout the provider still allows to be canceled.',
172
+ auth: 'service',
173
+ scope: 'payments:write',
174
+ idempotent: true,
175
+ peableAccount: true,
176
+ params: payoutIdParam,
177
+ body: exports.cancelPayoutParams,
178
+ response: exports.payoutSchema,
179
+ sdk: 'payouts.cancel',
180
+ }),
181
+ (0, route_1.defineRoute)({
182
+ operationId: 'retrievePayoutReconciliation',
183
+ method: 'get',
184
+ path: '/v1/reports/payout_reconciliation',
185
+ tag: 'Payouts',
186
+ summary: 'Reconcile a payout',
187
+ description: 'The balance transactions one payout paid out, a page at a time, with totals over all of them.',
188
+ auth: 'service',
189
+ scope: 'payments:read',
190
+ peableAccount: true,
191
+ query: exports.payoutReconciliationQuery,
192
+ response: exports.payoutReconciliationReportSchema,
193
+ sdk: 'reports.payoutReconciliation',
194
+ expandable: 'balance_transaction',
195
+ }),
196
+ ];