mollie-api-typescript 1.6.10 → 1.7.1

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 (195) hide show
  1. package/README.md +11 -0
  2. package/dist/commonjs/funcs/payoutsCancel.d.ts +22 -0
  3. package/dist/commonjs/funcs/payoutsCancel.d.ts.map +1 -0
  4. package/dist/commonjs/funcs/payoutsCancel.js +147 -0
  5. package/dist/commonjs/funcs/payoutsCancel.js.map +1 -0
  6. package/dist/commonjs/funcs/payoutsCreate.d.ts +54 -0
  7. package/dist/commonjs/funcs/payoutsCreate.d.ts.map +1 -0
  8. package/dist/commonjs/funcs/payoutsCreate.js +174 -0
  9. package/dist/commonjs/funcs/payoutsCreate.js.map +1 -0
  10. package/dist/commonjs/funcs/payoutsGet.d.ts +19 -0
  11. package/dist/commonjs/funcs/payoutsGet.d.ts.map +1 -0
  12. package/dist/commonjs/funcs/payoutsGet.js +144 -0
  13. package/dist/commonjs/funcs/payoutsGet.js.map +1 -0
  14. package/dist/commonjs/funcs/payoutsList.d.ts +29 -0
  15. package/dist/commonjs/funcs/payoutsList.d.ts.map +1 -0
  16. package/dist/commonjs/funcs/payoutsList.js +182 -0
  17. package/dist/commonjs/funcs/payoutsList.js.map +1 -0
  18. package/dist/commonjs/hooks/mollie-auth-utils.js +1 -1
  19. package/dist/commonjs/hooks/mollie-auth-utils.js.map +1 -1
  20. package/dist/commonjs/lib/config.d.ts +2 -2
  21. package/dist/commonjs/lib/config.js +2 -2
  22. package/dist/commonjs/lib/config.js.map +1 -1
  23. package/dist/commonjs/models/entitypayoutresponse.d.ts +102 -0
  24. package/dist/commonjs/models/entitypayoutresponse.d.ts.map +1 -0
  25. package/dist/commonjs/models/entitypayoutresponse.js +82 -0
  26. package/dist/commonjs/models/entitypayoutresponse.js.map +1 -0
  27. package/dist/commonjs/models/entitywebhookevent.d.ts +8 -2
  28. package/dist/commonjs/models/entitywebhookevent.d.ts.map +1 -1
  29. package/dist/commonjs/models/entitywebhookevent.js +8 -0
  30. package/dist/commonjs/models/entitywebhookevent.js.map +1 -1
  31. package/dist/commonjs/models/index.d.ts +6 -0
  32. package/dist/commonjs/models/index.d.ts.map +1 -1
  33. package/dist/commonjs/models/index.js +6 -0
  34. package/dist/commonjs/models/index.js.map +1 -1
  35. package/dist/commonjs/models/listentitypayout.d.ts +98 -0
  36. package/dist/commonjs/models/listentitypayout.d.ts.map +1 -0
  37. package/dist/commonjs/models/listentitypayout.js +81 -0
  38. package/dist/commonjs/models/listentitypayout.js.map +1 -0
  39. package/dist/commonjs/models/operations/cancelpayout.d.ts +43 -0
  40. package/dist/commonjs/models/operations/cancelpayout.d.ts.map +1 -0
  41. package/dist/commonjs/models/operations/cancelpayout.js +57 -0
  42. package/dist/commonjs/models/operations/cancelpayout.js.map +1 -0
  43. package/dist/commonjs/models/operations/createpayout.d.ts +41 -0
  44. package/dist/commonjs/models/operations/createpayout.d.ts.map +1 -0
  45. package/dist/commonjs/models/operations/createpayout.js +59 -0
  46. package/dist/commonjs/models/operations/createpayout.js.map +1 -0
  47. package/dist/commonjs/models/operations/getpayout.d.ts +43 -0
  48. package/dist/commonjs/models/operations/getpayout.d.ts.map +1 -0
  49. package/dist/commonjs/models/operations/getpayout.js +57 -0
  50. package/dist/commonjs/models/operations/getpayout.js.map +1 -0
  51. package/dist/commonjs/models/operations/index.d.ts +4 -0
  52. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  53. package/dist/commonjs/models/operations/index.js +4 -0
  54. package/dist/commonjs/models/operations/index.js.map +1 -1
  55. package/dist/commonjs/models/operations/listpayouts.d.ts +114 -0
  56. package/dist/commonjs/models/operations/listpayouts.d.ts.map +1 -0
  57. package/dist/commonjs/models/operations/listpayouts.js +97 -0
  58. package/dist/commonjs/models/operations/listpayouts.js.map +1 -0
  59. package/dist/commonjs/models/payoutrequest.d.ts +45 -0
  60. package/dist/commonjs/models/payoutrequest.d.ts.map +1 -0
  61. package/dist/commonjs/models/payoutrequest.js +54 -0
  62. package/dist/commonjs/models/payoutrequest.js.map +1 -0
  63. package/dist/commonjs/models/payoutstatus.d.ts +20 -0
  64. package/dist/commonjs/models/payoutstatus.d.ts.map +1 -0
  65. package/dist/commonjs/models/payoutstatus.js +55 -0
  66. package/dist/commonjs/models/payoutstatus.js.map +1 -0
  67. package/dist/commonjs/models/payoutstatusreason.d.ts +21 -0
  68. package/dist/commonjs/models/payoutstatusreason.d.ts.map +1 -0
  69. package/dist/commonjs/models/payoutstatusreason.js +53 -0
  70. package/dist/commonjs/models/payoutstatusreason.js.map +1 -0
  71. package/dist/commonjs/models/payoutstatusreasoncode.d.ts +28 -0
  72. package/dist/commonjs/models/payoutstatusreasoncode.d.ts.map +1 -0
  73. package/dist/commonjs/models/payoutstatusreasoncode.js +63 -0
  74. package/dist/commonjs/models/payoutstatusreasoncode.js.map +1 -0
  75. package/dist/commonjs/models/webhookeventtypes.d.ts +5 -0
  76. package/dist/commonjs/models/webhookeventtypes.d.ts.map +1 -1
  77. package/dist/commonjs/models/webhookeventtypes.js +5 -0
  78. package/dist/commonjs/models/webhookeventtypes.js.map +1 -1
  79. package/dist/commonjs/sdk/payouts.d.ts +81 -0
  80. package/dist/commonjs/sdk/payouts.d.ts.map +1 -0
  81. package/dist/commonjs/sdk/payouts.js +98 -0
  82. package/dist/commonjs/sdk/payouts.js.map +1 -0
  83. package/dist/commonjs/sdk/sdk.d.ts +3 -0
  84. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  85. package/dist/commonjs/sdk/sdk.js +4 -0
  86. package/dist/commonjs/sdk/sdk.js.map +1 -1
  87. package/dist/esm/funcs/payoutsCancel.d.ts +22 -0
  88. package/dist/esm/funcs/payoutsCancel.d.ts.map +1 -0
  89. package/dist/esm/funcs/payoutsCancel.js +111 -0
  90. package/dist/esm/funcs/payoutsCancel.js.map +1 -0
  91. package/dist/esm/funcs/payoutsCreate.d.ts +54 -0
  92. package/dist/esm/funcs/payoutsCreate.d.ts.map +1 -0
  93. package/dist/esm/funcs/payoutsCreate.js +138 -0
  94. package/dist/esm/funcs/payoutsCreate.js.map +1 -0
  95. package/dist/esm/funcs/payoutsGet.d.ts +19 -0
  96. package/dist/esm/funcs/payoutsGet.d.ts.map +1 -0
  97. package/dist/esm/funcs/payoutsGet.js +108 -0
  98. package/dist/esm/funcs/payoutsGet.js.map +1 -0
  99. package/dist/esm/funcs/payoutsList.d.ts +29 -0
  100. package/dist/esm/funcs/payoutsList.d.ts.map +1 -0
  101. package/dist/esm/funcs/payoutsList.js +146 -0
  102. package/dist/esm/funcs/payoutsList.js.map +1 -0
  103. package/dist/esm/hooks/mollie-auth-utils.js +1 -1
  104. package/dist/esm/hooks/mollie-auth-utils.js.map +1 -1
  105. package/dist/esm/lib/config.d.ts +2 -2
  106. package/dist/esm/lib/config.js +2 -2
  107. package/dist/esm/lib/config.js.map +1 -1
  108. package/dist/esm/models/entitypayoutresponse.d.ts +102 -0
  109. package/dist/esm/models/entitypayoutresponse.d.ts.map +1 -0
  110. package/dist/esm/models/entitypayoutresponse.js +44 -0
  111. package/dist/esm/models/entitypayoutresponse.js.map +1 -0
  112. package/dist/esm/models/entitywebhookevent.d.ts +8 -2
  113. package/dist/esm/models/entitywebhookevent.d.ts.map +1 -1
  114. package/dist/esm/models/entitywebhookevent.js +8 -0
  115. package/dist/esm/models/entitywebhookevent.js.map +1 -1
  116. package/dist/esm/models/index.d.ts +6 -0
  117. package/dist/esm/models/index.d.ts.map +1 -1
  118. package/dist/esm/models/index.js +6 -0
  119. package/dist/esm/models/index.js.map +1 -1
  120. package/dist/esm/models/listentitypayout.d.ts +98 -0
  121. package/dist/esm/models/listentitypayout.d.ts.map +1 -0
  122. package/dist/esm/models/listentitypayout.js +43 -0
  123. package/dist/esm/models/listentitypayout.js.map +1 -0
  124. package/dist/esm/models/operations/cancelpayout.d.ts +43 -0
  125. package/dist/esm/models/operations/cancelpayout.d.ts.map +1 -0
  126. package/dist/esm/models/operations/cancelpayout.js +20 -0
  127. package/dist/esm/models/operations/cancelpayout.js.map +1 -0
  128. package/dist/esm/models/operations/createpayout.d.ts +41 -0
  129. package/dist/esm/models/operations/createpayout.d.ts.map +1 -0
  130. package/dist/esm/models/operations/createpayout.js +22 -0
  131. package/dist/esm/models/operations/createpayout.js.map +1 -0
  132. package/dist/esm/models/operations/getpayout.d.ts +43 -0
  133. package/dist/esm/models/operations/getpayout.d.ts.map +1 -0
  134. package/dist/esm/models/operations/getpayout.js +20 -0
  135. package/dist/esm/models/operations/getpayout.js.map +1 -0
  136. package/dist/esm/models/operations/index.d.ts +4 -0
  137. package/dist/esm/models/operations/index.d.ts.map +1 -1
  138. package/dist/esm/models/operations/index.js +4 -0
  139. package/dist/esm/models/operations/index.js.map +1 -1
  140. package/dist/esm/models/operations/listpayouts.d.ts +114 -0
  141. package/dist/esm/models/operations/listpayouts.d.ts.map +1 -0
  142. package/dist/esm/models/operations/listpayouts.js +57 -0
  143. package/dist/esm/models/operations/listpayouts.js.map +1 -0
  144. package/dist/esm/models/payoutrequest.d.ts +45 -0
  145. package/dist/esm/models/payoutrequest.d.ts.map +1 -0
  146. package/dist/esm/models/payoutrequest.js +17 -0
  147. package/dist/esm/models/payoutrequest.js.map +1 -0
  148. package/dist/esm/models/payoutstatus.d.ts +20 -0
  149. package/dist/esm/models/payoutstatus.d.ts.map +1 -0
  150. package/dist/esm/models/payoutstatus.js +19 -0
  151. package/dist/esm/models/payoutstatus.js.map +1 -0
  152. package/dist/esm/models/payoutstatusreason.d.ts +21 -0
  153. package/dist/esm/models/payoutstatusreason.d.ts.map +1 -0
  154. package/dist/esm/models/payoutstatusreason.js +16 -0
  155. package/dist/esm/models/payoutstatusreason.js.map +1 -0
  156. package/dist/esm/models/payoutstatusreasoncode.d.ts +28 -0
  157. package/dist/esm/models/payoutstatusreasoncode.d.ts.map +1 -0
  158. package/dist/esm/models/payoutstatusreasoncode.js +27 -0
  159. package/dist/esm/models/payoutstatusreasoncode.js.map +1 -0
  160. package/dist/esm/models/webhookeventtypes.d.ts +5 -0
  161. package/dist/esm/models/webhookeventtypes.d.ts.map +1 -1
  162. package/dist/esm/models/webhookeventtypes.js +5 -0
  163. package/dist/esm/models/webhookeventtypes.js.map +1 -1
  164. package/dist/esm/sdk/payouts.d.ts +81 -0
  165. package/dist/esm/sdk/payouts.d.ts.map +1 -0
  166. package/dist/esm/sdk/payouts.js +94 -0
  167. package/dist/esm/sdk/payouts.js.map +1 -0
  168. package/dist/esm/sdk/sdk.d.ts +3 -0
  169. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  170. package/dist/esm/sdk/sdk.js +4 -0
  171. package/dist/esm/sdk/sdk.js.map +1 -1
  172. package/jsr.json +1 -1
  173. package/package.json +1 -1
  174. package/src/funcs/payoutsCancel.ts +204 -0
  175. package/src/funcs/payoutsCreate.ts +231 -0
  176. package/src/funcs/payoutsGet.ts +201 -0
  177. package/src/funcs/payoutsList.ts +278 -0
  178. package/src/hooks/mollie-auth-utils.ts +3 -3
  179. package/src/lib/config.ts +2 -2
  180. package/src/models/entitypayoutresponse.ts +165 -0
  181. package/src/models/entitywebhookevent.ts +13 -0
  182. package/src/models/index.ts +6 -0
  183. package/src/models/listentitypayout.ts +160 -0
  184. package/src/models/operations/cancelpayout.ts +71 -0
  185. package/src/models/operations/createpayout.ts +70 -0
  186. package/src/models/operations/getpayout.ts +71 -0
  187. package/src/models/operations/index.ts +4 -0
  188. package/src/models/operations/listpayouts.ts +208 -0
  189. package/src/models/payoutrequest.ts +68 -0
  190. package/src/models/payoutstatus.ts +31 -0
  191. package/src/models/payoutstatusreason.ts +47 -0
  192. package/src/models/payoutstatusreasoncode.ts +39 -0
  193. package/src/models/webhookeventtypes.ts +5 -0
  194. package/src/sdk/payouts.ts +128 -0
  195. package/src/sdk/sdk.ts +6 -0
@@ -0,0 +1,68 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 39795b6f75e2
4
+ */
5
+
6
+ import * as z from "zod/v3";
7
+ import {
8
+ AmountNullable,
9
+ AmountNullable$Outbound,
10
+ AmountNullable$outboundSchema,
11
+ } from "./amountnullable.js";
12
+
13
+ export type PayoutRequest = {
14
+ /**
15
+ * The identifier of the balance that will be paid out. Example: `bal_gVMhHKqSSRYJyPsuoPNFH`.
16
+ */
17
+ balanceId: string;
18
+ /**
19
+ * The amount to pay out. When omitted from the request, the full available balance minus any configured
20
+ *
21
+ * @remarks
22
+ * balance reserve is paid out.
23
+ *
24
+ * Merchants registered in the United Kingdom cannot specify a custom amount — omit this field to pay out
25
+ * the full available balance.
26
+ *
27
+ * The value in the response reflects the amount paid out, excluding any applicable fees.
28
+ */
29
+ amount?: AmountNullable | null | undefined;
30
+ /**
31
+ * The description that will appear on the bank statement for this payout.
32
+ */
33
+ description?: string | undefined;
34
+ /**
35
+ * Whether to create the entity in test mode or live mode.
36
+ *
37
+ * @remarks
38
+ *
39
+ * Most API credentials are specifically created for either live mode or test mode, in which case this parameter must
40
+ * not be sent. For organization-level credentials such as OAuth access tokens, you can enable test mode by setting
41
+ * `testmode` to `true`.
42
+ */
43
+ testmode?: boolean | null | undefined;
44
+ };
45
+
46
+ /** @internal */
47
+ export type PayoutRequest$Outbound = {
48
+ balanceId: string;
49
+ amount?: AmountNullable$Outbound | null | undefined;
50
+ description?: string | undefined;
51
+ testmode?: boolean | null | undefined;
52
+ };
53
+
54
+ /** @internal */
55
+ export const PayoutRequest$outboundSchema: z.ZodType<
56
+ PayoutRequest$Outbound,
57
+ z.ZodTypeDef,
58
+ PayoutRequest
59
+ > = z.object({
60
+ balanceId: z.string(),
61
+ amount: z.nullable(AmountNullable$outboundSchema).optional(),
62
+ description: z.string().optional(),
63
+ testmode: z.nullable(z.boolean()).optional(),
64
+ });
65
+
66
+ export function payoutRequestToJSON(payoutRequest: PayoutRequest): string {
67
+ return JSON.stringify(PayoutRequest$outboundSchema.parse(payoutRequest));
68
+ }
@@ -0,0 +1,31 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: c35fe9ae063d
4
+ */
5
+
6
+ import * as z from "zod/v3";
7
+ import * as openEnums from "../types/enums.js";
8
+ import { OpenEnum } from "../types/enums.js";
9
+
10
+ /**
11
+ * The status of the payout.
12
+ */
13
+ export const PayoutStatus = {
14
+ Requested: "requested",
15
+ Initiated: "initiated",
16
+ ProcessingAtBank: "processing-at-bank",
17
+ Completed: "completed",
18
+ Failed: "failed",
19
+ Canceled: "canceled",
20
+ } as const;
21
+ /**
22
+ * The status of the payout.
23
+ */
24
+ export type PayoutStatus = OpenEnum<typeof PayoutStatus>;
25
+
26
+ /** @internal */
27
+ export const PayoutStatus$inboundSchema: z.ZodType<
28
+ PayoutStatus,
29
+ z.ZodTypeDef,
30
+ unknown
31
+ > = openEnums.inboundSchema(PayoutStatus);
@@ -0,0 +1,47 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: c4c4247c41f9
4
+ */
5
+
6
+ import * as z from "zod/v3";
7
+ import { safeParse } from "../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../types/fp.js";
9
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
10
+ import {
11
+ PayoutStatusReasonCode,
12
+ PayoutStatusReasonCode$inboundSchema,
13
+ } from "./payoutstatusreasoncode.js";
14
+
15
+ /**
16
+ * The reason for the payout's current status.
17
+ */
18
+ export type PayoutStatusReason = {
19
+ /**
20
+ * A machine-readable code describing the reason for the payout's current status.
21
+ */
22
+ code: PayoutStatusReasonCode;
23
+ /**
24
+ * A human-readable description of the status reason.
25
+ */
26
+ message: string;
27
+ };
28
+
29
+ /** @internal */
30
+ export const PayoutStatusReason$inboundSchema: z.ZodType<
31
+ PayoutStatusReason,
32
+ z.ZodTypeDef,
33
+ unknown
34
+ > = z.object({
35
+ code: PayoutStatusReasonCode$inboundSchema,
36
+ message: z.string(),
37
+ });
38
+
39
+ export function payoutStatusReasonFromJSON(
40
+ jsonString: string,
41
+ ): SafeParseResult<PayoutStatusReason, SDKValidationError> {
42
+ return safeParse(
43
+ jsonString,
44
+ (x) => PayoutStatusReason$inboundSchema.parse(JSON.parse(x)),
45
+ `Failed to parse 'PayoutStatusReason' from JSON`,
46
+ );
47
+ }
@@ -0,0 +1,39 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 1ee305eaa864
4
+ */
5
+
6
+ import * as z from "zod/v3";
7
+ import * as openEnums from "../types/enums.js";
8
+ import { OpenEnum } from "../types/enums.js";
9
+
10
+ /**
11
+ * A machine-readable code describing the reason for the payout's current status.
12
+ */
13
+ export const PayoutStatusReasonCode = {
14
+ Requested: "requested",
15
+ Initiated: "initiated",
16
+ ProcessingAtBank: "processing_at_bank",
17
+ Completed: "completed",
18
+ Canceled: "canceled",
19
+ Failed: "failed",
20
+ InsufficientFunds: "insufficient_funds",
21
+ Returned: "returned",
22
+ InvalidRequest: "invalid_request",
23
+ OrganizationInactive: "organization_inactive",
24
+ PayoutsBlocked: "payouts_blocked",
25
+ BankProcessingFailed: "bank_processing_failed",
26
+ BalanceNotFound: "balance_not_found",
27
+ Expired: "expired",
28
+ } as const;
29
+ /**
30
+ * A machine-readable code describing the reason for the payout's current status.
31
+ */
32
+ export type PayoutStatusReasonCode = OpenEnum<typeof PayoutStatusReasonCode>;
33
+
34
+ /** @internal */
35
+ export const PayoutStatusReasonCode$inboundSchema: z.ZodType<
36
+ PayoutStatusReasonCode,
37
+ z.ZodTypeDef,
38
+ unknown
39
+ > = openEnums.inboundSchema(PayoutStatusReasonCode);
@@ -15,6 +15,11 @@ import { ClosedEnum } from "../types/enums.js";
15
15
  export const WebhookEventTypes = {
16
16
  PaymentLinkPaid: "payment-link.paid",
17
17
  BalanceTransactionCreated: "balance-transaction.created",
18
+ PayoutInitiated: "payout.initiated",
19
+ PayoutProcessingAtBank: "payout.processing-at-bank",
20
+ PayoutCompleted: "payout.completed",
21
+ PayoutCanceled: "payout.canceled",
22
+ PayoutFailed: "payout.failed",
18
23
  SalesInvoiceCreated: "sales-invoice.created",
19
24
  SalesInvoiceIssued: "sales-invoice.issued",
20
25
  SalesInvoiceCanceled: "sales-invoice.canceled",
@@ -0,0 +1,128 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 9d174eba7124
4
+ */
5
+
6
+ import { payoutsCancel } from "../funcs/payoutsCancel.js";
7
+ import { payoutsCreate } from "../funcs/payoutsCreate.js";
8
+ import { payoutsGet } from "../funcs/payoutsGet.js";
9
+ import { payoutsList } from "../funcs/payoutsList.js";
10
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
11
+ import * as models from "../models/index.js";
12
+ import * as operations from "../models/operations/index.js";
13
+ import { unwrapAsync } from "../types/fp.js";
14
+ import { PageIterator, unwrapResultIterator } from "../types/operations.js";
15
+
16
+ export class Payouts extends ClientSDK {
17
+ /**
18
+ * Create payout
19
+ *
20
+ * @remarks
21
+ * Request a payout from one of your balances to the balance's configured bank account.
22
+ *
23
+ * The payout will be executed on the next scheduled business day. If no `amount` is specified, the full available
24
+ * balance minus any configured balance reserve is paid out.
25
+ *
26
+ * Once the payout is created with status `requested`, you can cancel it via the
27
+ * [Cancel payout](cancel-payout) endpoint, up until the payout moves to `initiated`.
28
+ *
29
+ * Creating a payout via the API automatically sets the balance's `transferFrequency` to `never`,
30
+ * pausing any previously configured automatic settlement schedule. To resume automatic settlements,
31
+ * update the transfer frequency via the dashboard.
32
+ *
33
+ * ### Webhooks
34
+ *
35
+ * Subscribe to the following webhook events to track payout status changes. See the
36
+ * [Webhook Subscriptions API](list-webhooks) for details on subscribing.
37
+ *
38
+ * | Event | Description |
39
+ * |---|---|
40
+ * | `payout.initiated` | The payout is being executed and funds are reserved. |
41
+ * | `payout.processing-at-bank` | The payout has been submitted to the bank. |
42
+ * | `payout.completed` | The payout has been sent to the destination bank account. |
43
+ * | `payout.canceled` | The payout was canceled via the API before being submitted to the bank. |
44
+ * | `payout.failed` | The payout failed after creation, including bank rejections and post-submission cancellations. |
45
+ *
46
+ * ### Payout failure reasons
47
+ *
48
+ * A payout request may fail immediately if one of the following conditions applies:
49
+ *
50
+ * - A payout is already scheduled for the next business day for this balance.
51
+ * - The balance has insufficient funds.
52
+ * - The balance is not active.
53
+ * - Payouts are blocked for this organization.
54
+ * - The balance has queued refunds.
55
+ * - One of the organization's balances is below the negative balance threshold.
56
+ * - The payout destination (bank account) is invalid or not configured.
57
+ */
58
+ async create(
59
+ request: operations.CreatePayoutRequest,
60
+ options?: RequestOptions,
61
+ ): Promise<models.EntityPayoutResponse> {
62
+ return unwrapAsync(payoutsCreate(
63
+ this,
64
+ request,
65
+ options,
66
+ ));
67
+ }
68
+
69
+ /**
70
+ * List payouts
71
+ *
72
+ * @remarks
73
+ * Retrieve a list of all payouts for your organization, including payouts initiated automatically by the
74
+ * balance's payout schedule and payouts requested via the API or dashboard.
75
+ *
76
+ * Only payouts created on or after April 1st, 2026 are returned.
77
+ *
78
+ * The results are paginated. Use the `from` query parameter together with `_links.next` to iterate through
79
+ * the full result set.
80
+ */
81
+ async list(
82
+ request?: operations.ListPayoutsRequest | undefined,
83
+ options?: RequestOptions,
84
+ ): Promise<PageIterator<operations.ListPayoutsResponse, { url: string }>> {
85
+ return unwrapResultIterator(payoutsList(
86
+ this,
87
+ request,
88
+ options,
89
+ ));
90
+ }
91
+
92
+ /**
93
+ * Get payout
94
+ *
95
+ * @remarks
96
+ * Retrieve a single payout by its ID.
97
+ */
98
+ async get(
99
+ request: operations.GetPayoutRequest,
100
+ options?: RequestOptions,
101
+ ): Promise<models.EntityPayoutResponse> {
102
+ return unwrapAsync(payoutsGet(
103
+ this,
104
+ request,
105
+ options,
106
+ ));
107
+ }
108
+
109
+ /**
110
+ * Cancel payout
111
+ *
112
+ * @remarks
113
+ * Cancel a payout. A payout can only be canceled while it has the status `requested`. Once the payout moves
114
+ * to `initiated`, it is too late to cancel.
115
+ *
116
+ * The canceled payout object is returned with the status set to `canceled`.
117
+ */
118
+ async cancel(
119
+ request: operations.CancelPayoutRequest,
120
+ options?: RequestOptions,
121
+ ): Promise<models.EntityPayoutResponse> {
122
+ return unwrapAsync(payoutsCancel(
123
+ this,
124
+ request,
125
+ options,
126
+ ));
127
+ }
128
+ }
package/src/sdk/sdk.ts CHANGED
@@ -22,6 +22,7 @@ import { Onboarding } from "./onboarding.js";
22
22
  import { Organizations } from "./organizations.js";
23
23
  import { PaymentLinks } from "./paymentlinks.js";
24
24
  import { Payments } from "./payments.js";
25
+ import { Payouts } from "./payouts.js";
25
26
  import { Permissions } from "./permissions.js";
26
27
  import { Profiles } from "./profiles.js";
27
28
  import { Refunds } from "./refunds.js";
@@ -199,4 +200,9 @@ export class Client extends ClientSDK {
199
200
  get verifyPayee(): VerifyPayee {
200
201
  return (this._verifyPayee ??= new VerifyPayee(this._options));
201
202
  }
203
+
204
+ private _payouts?: Payouts;
205
+ get payouts(): Payouts {
206
+ return (this._payouts ??= new Payouts(this._options));
207
+ }
202
208
  }