mollie-api-typescript 1.7.0 → 1.7.2
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.
- package/README.md +11 -0
- package/dist/commonjs/funcs/payoutsCancel.d.ts +22 -0
- package/dist/commonjs/funcs/payoutsCancel.d.ts.map +1 -0
- package/dist/commonjs/funcs/payoutsCancel.js +147 -0
- package/dist/commonjs/funcs/payoutsCancel.js.map +1 -0
- package/dist/commonjs/funcs/payoutsCreate.d.ts +54 -0
- package/dist/commonjs/funcs/payoutsCreate.d.ts.map +1 -0
- package/dist/commonjs/funcs/payoutsCreate.js +174 -0
- package/dist/commonjs/funcs/payoutsCreate.js.map +1 -0
- package/dist/commonjs/funcs/payoutsGet.d.ts +19 -0
- package/dist/commonjs/funcs/payoutsGet.d.ts.map +1 -0
- package/dist/commonjs/funcs/payoutsGet.js +144 -0
- package/dist/commonjs/funcs/payoutsGet.js.map +1 -0
- package/dist/commonjs/funcs/payoutsList.d.ts +29 -0
- package/dist/commonjs/funcs/payoutsList.d.ts.map +1 -0
- package/dist/commonjs/funcs/payoutsList.js +182 -0
- package/dist/commonjs/funcs/payoutsList.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/models/entitypayoutresponse.d.ts +94 -0
- package/dist/commonjs/models/entitypayoutresponse.d.ts.map +1 -0
- package/dist/commonjs/models/entitypayoutresponse.js +82 -0
- package/dist/commonjs/models/entitypayoutresponse.js.map +1 -0
- package/dist/commonjs/models/entitywebhookevent.d.ts +8 -2
- package/dist/commonjs/models/entitywebhookevent.d.ts.map +1 -1
- package/dist/commonjs/models/entitywebhookevent.js +8 -0
- package/dist/commonjs/models/entitywebhookevent.js.map +1 -1
- package/dist/commonjs/models/index.d.ts +6 -0
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +6 -0
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/listentitypayout.d.ts +90 -0
- package/dist/commonjs/models/listentitypayout.d.ts.map +1 -0
- package/dist/commonjs/models/listentitypayout.js +81 -0
- package/dist/commonjs/models/listentitypayout.js.map +1 -0
- package/dist/commonjs/models/operations/cancelpayout.d.ts +43 -0
- package/dist/commonjs/models/operations/cancelpayout.d.ts.map +1 -0
- package/dist/commonjs/models/operations/cancelpayout.js +57 -0
- package/dist/commonjs/models/operations/cancelpayout.js.map +1 -0
- package/dist/commonjs/models/operations/createpayout.d.ts +41 -0
- package/dist/commonjs/models/operations/createpayout.d.ts.map +1 -0
- package/dist/commonjs/models/operations/createpayout.js +59 -0
- package/dist/commonjs/models/operations/createpayout.js.map +1 -0
- package/dist/commonjs/models/operations/getpayout.d.ts +43 -0
- package/dist/commonjs/models/operations/getpayout.d.ts.map +1 -0
- package/dist/commonjs/models/operations/getpayout.js +57 -0
- package/dist/commonjs/models/operations/getpayout.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +4 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +4 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/listpayouts.d.ts +114 -0
- package/dist/commonjs/models/operations/listpayouts.d.ts.map +1 -0
- package/dist/commonjs/models/operations/listpayouts.js +97 -0
- package/dist/commonjs/models/operations/listpayouts.js.map +1 -0
- package/dist/commonjs/models/paymentrequest.d.ts +10 -0
- package/dist/commonjs/models/paymentrequest.d.ts.map +1 -1
- package/dist/commonjs/models/paymentrequest.js +1 -0
- package/dist/commonjs/models/paymentrequest.js.map +1 -1
- package/dist/commonjs/models/payoutrequest.d.ts +37 -0
- package/dist/commonjs/models/payoutrequest.d.ts.map +1 -0
- package/dist/commonjs/models/payoutrequest.js +54 -0
- package/dist/commonjs/models/payoutrequest.js.map +1 -0
- package/dist/commonjs/models/payoutstatus.d.ts +20 -0
- package/dist/commonjs/models/payoutstatus.d.ts.map +1 -0
- package/dist/commonjs/models/payoutstatus.js +55 -0
- package/dist/commonjs/models/payoutstatus.js.map +1 -0
- package/dist/commonjs/models/payoutstatusreason.d.ts +21 -0
- package/dist/commonjs/models/payoutstatusreason.d.ts.map +1 -0
- package/dist/commonjs/models/payoutstatusreason.js +53 -0
- package/dist/commonjs/models/payoutstatusreason.js.map +1 -0
- package/dist/commonjs/models/payoutstatusreasoncode.d.ts +28 -0
- package/dist/commonjs/models/payoutstatusreasoncode.d.ts.map +1 -0
- package/dist/commonjs/models/payoutstatusreasoncode.js +63 -0
- package/dist/commonjs/models/payoutstatusreasoncode.js.map +1 -0
- package/dist/commonjs/models/webhookeventtypes.d.ts +5 -0
- package/dist/commonjs/models/webhookeventtypes.d.ts.map +1 -1
- package/dist/commonjs/models/webhookeventtypes.js +5 -0
- package/dist/commonjs/models/webhookeventtypes.js.map +1 -1
- package/dist/commonjs/sdk/payouts.d.ts +81 -0
- package/dist/commonjs/sdk/payouts.d.ts.map +1 -0
- package/dist/commonjs/sdk/payouts.js +98 -0
- package/dist/commonjs/sdk/payouts.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +3 -0
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +4 -0
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/esm/funcs/payoutsCancel.d.ts +22 -0
- package/dist/esm/funcs/payoutsCancel.d.ts.map +1 -0
- package/dist/esm/funcs/payoutsCancel.js +111 -0
- package/dist/esm/funcs/payoutsCancel.js.map +1 -0
- package/dist/esm/funcs/payoutsCreate.d.ts +54 -0
- package/dist/esm/funcs/payoutsCreate.d.ts.map +1 -0
- package/dist/esm/funcs/payoutsCreate.js +138 -0
- package/dist/esm/funcs/payoutsCreate.js.map +1 -0
- package/dist/esm/funcs/payoutsGet.d.ts +19 -0
- package/dist/esm/funcs/payoutsGet.d.ts.map +1 -0
- package/dist/esm/funcs/payoutsGet.js +108 -0
- package/dist/esm/funcs/payoutsGet.js.map +1 -0
- package/dist/esm/funcs/payoutsList.d.ts +29 -0
- package/dist/esm/funcs/payoutsList.d.ts.map +1 -0
- package/dist/esm/funcs/payoutsList.js +146 -0
- package/dist/esm/funcs/payoutsList.js.map +1 -0
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/models/entitypayoutresponse.d.ts +94 -0
- package/dist/esm/models/entitypayoutresponse.d.ts.map +1 -0
- package/dist/esm/models/entitypayoutresponse.js +44 -0
- package/dist/esm/models/entitypayoutresponse.js.map +1 -0
- package/dist/esm/models/entitywebhookevent.d.ts +8 -2
- package/dist/esm/models/entitywebhookevent.d.ts.map +1 -1
- package/dist/esm/models/entitywebhookevent.js +8 -0
- package/dist/esm/models/entitywebhookevent.js.map +1 -1
- package/dist/esm/models/index.d.ts +6 -0
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +6 -0
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/listentitypayout.d.ts +90 -0
- package/dist/esm/models/listentitypayout.d.ts.map +1 -0
- package/dist/esm/models/listentitypayout.js +43 -0
- package/dist/esm/models/listentitypayout.js.map +1 -0
- package/dist/esm/models/operations/cancelpayout.d.ts +43 -0
- package/dist/esm/models/operations/cancelpayout.d.ts.map +1 -0
- package/dist/esm/models/operations/cancelpayout.js +20 -0
- package/dist/esm/models/operations/cancelpayout.js.map +1 -0
- package/dist/esm/models/operations/createpayout.d.ts +41 -0
- package/dist/esm/models/operations/createpayout.d.ts.map +1 -0
- package/dist/esm/models/operations/createpayout.js +22 -0
- package/dist/esm/models/operations/createpayout.js.map +1 -0
- package/dist/esm/models/operations/getpayout.d.ts +43 -0
- package/dist/esm/models/operations/getpayout.d.ts.map +1 -0
- package/dist/esm/models/operations/getpayout.js +20 -0
- package/dist/esm/models/operations/getpayout.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +4 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +4 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/listpayouts.d.ts +114 -0
- package/dist/esm/models/operations/listpayouts.d.ts.map +1 -0
- package/dist/esm/models/operations/listpayouts.js +57 -0
- package/dist/esm/models/operations/listpayouts.js.map +1 -0
- package/dist/esm/models/paymentrequest.d.ts +10 -0
- package/dist/esm/models/paymentrequest.d.ts.map +1 -1
- package/dist/esm/models/paymentrequest.js +1 -0
- package/dist/esm/models/paymentrequest.js.map +1 -1
- package/dist/esm/models/payoutrequest.d.ts +37 -0
- package/dist/esm/models/payoutrequest.d.ts.map +1 -0
- package/dist/esm/models/payoutrequest.js +17 -0
- package/dist/esm/models/payoutrequest.js.map +1 -0
- package/dist/esm/models/payoutstatus.d.ts +20 -0
- package/dist/esm/models/payoutstatus.d.ts.map +1 -0
- package/dist/esm/models/payoutstatus.js +19 -0
- package/dist/esm/models/payoutstatus.js.map +1 -0
- package/dist/esm/models/payoutstatusreason.d.ts +21 -0
- package/dist/esm/models/payoutstatusreason.d.ts.map +1 -0
- package/dist/esm/models/payoutstatusreason.js +16 -0
- package/dist/esm/models/payoutstatusreason.js.map +1 -0
- package/dist/esm/models/payoutstatusreasoncode.d.ts +28 -0
- package/dist/esm/models/payoutstatusreasoncode.d.ts.map +1 -0
- package/dist/esm/models/payoutstatusreasoncode.js +27 -0
- package/dist/esm/models/payoutstatusreasoncode.js.map +1 -0
- package/dist/esm/models/webhookeventtypes.d.ts +5 -0
- package/dist/esm/models/webhookeventtypes.d.ts.map +1 -1
- package/dist/esm/models/webhookeventtypes.js +5 -0
- package/dist/esm/models/webhookeventtypes.js.map +1 -1
- package/dist/esm/sdk/payouts.d.ts +81 -0
- package/dist/esm/sdk/payouts.d.ts.map +1 -0
- package/dist/esm/sdk/payouts.js +94 -0
- package/dist/esm/sdk/payouts.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +3 -0
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +4 -0
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/payoutsCancel.ts +204 -0
- package/src/funcs/payoutsCreate.ts +231 -0
- package/src/funcs/payoutsGet.ts +201 -0
- package/src/funcs/payoutsList.ts +278 -0
- package/src/lib/config.ts +3 -3
- package/src/models/entitypayoutresponse.ts +157 -0
- package/src/models/entitywebhookevent.ts +13 -0
- package/src/models/index.ts +6 -0
- package/src/models/listentitypayout.ts +152 -0
- package/src/models/operations/cancelpayout.ts +71 -0
- package/src/models/operations/createpayout.ts +70 -0
- package/src/models/operations/getpayout.ts +71 -0
- package/src/models/operations/index.ts +4 -0
- package/src/models/operations/listpayouts.ts +208 -0
- package/src/models/paymentrequest.ts +11 -0
- package/src/models/payoutrequest.ts +60 -0
- package/src/models/payoutstatus.ts +31 -0
- package/src/models/payoutstatusreason.ts +47 -0
- package/src/models/payoutstatusreasoncode.ts +39 -0
- package/src/models/webhookeventtypes.ts +5 -0
- package/src/sdk/payouts.ts +128 -0
- package/src/sdk/sdk.ts +6 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 2417fe06d050
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod/v3";
|
|
7
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
8
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
import * as models from "../index.js";
|
|
12
|
+
|
|
13
|
+
export type ListPayoutsGlobals = {
|
|
14
|
+
/**
|
|
15
|
+
* Most API credentials are specifically created for either live mode or test mode. In those cases the `testmode` query
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* parameter must not be sent. For organization-level credentials such as OAuth access tokens, you can enable test mode by
|
|
19
|
+
* setting the `testmode` query parameter to `true`.
|
|
20
|
+
*
|
|
21
|
+
* Test entities cannot be retrieved when the endpoint is set to live mode, and vice versa.
|
|
22
|
+
*/
|
|
23
|
+
testmode?: boolean | undefined;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type ListPayoutsRequest = {
|
|
27
|
+
/**
|
|
28
|
+
* Return only payouts for the balance with the given ID. The value must be a valid balance
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* token in the format `bal_*`.
|
|
32
|
+
*/
|
|
33
|
+
balanceId?: string | null | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Provide an ID to start the result set from the item with the given ID and onwards. This allows you to paginate the
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* result set.
|
|
39
|
+
*/
|
|
40
|
+
from?: string | null | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* The maximum number of items to return. Defaults to 50 items.
|
|
43
|
+
*/
|
|
44
|
+
limit?: number | null | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Used for setting the direction of the result set. Defaults to descending order, meaning the results are ordered from
|
|
47
|
+
*
|
|
48
|
+
* @remarks
|
|
49
|
+
* newest to oldest.
|
|
50
|
+
*/
|
|
51
|
+
sort?: models.Sorting | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Most API credentials are specifically created for either live mode or test mode. In those cases the `testmode` query
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* parameter must not be sent. For organization-level credentials such as OAuth access tokens, you can enable test mode by
|
|
57
|
+
* setting the `testmode` query parameter to `true`.
|
|
58
|
+
*
|
|
59
|
+
* Test entities cannot be retrieved when the endpoint is set to live mode, and vice versa.
|
|
60
|
+
*/
|
|
61
|
+
testmode?: boolean | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* A unique key to ensure idempotent requests. This key should be a UUID v4 string.
|
|
64
|
+
*/
|
|
65
|
+
idempotencyKey?: string | undefined;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export type ListPayoutsEmbedded = {
|
|
69
|
+
/**
|
|
70
|
+
* An array of payout objects. For a complete reference of the payout object, refer to the
|
|
71
|
+
*
|
|
72
|
+
* @remarks
|
|
73
|
+
* [Get payout endpoint](get-payout) documentation.
|
|
74
|
+
*/
|
|
75
|
+
payouts: Array<models.ListEntityPayout>;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* A list of payout objects. For a complete reference of the payout object, refer to the
|
|
80
|
+
*
|
|
81
|
+
* @remarks
|
|
82
|
+
* [Get payout endpoint](get-payout) documentation.
|
|
83
|
+
*/
|
|
84
|
+
export type ListPayoutsResponseBody = {
|
|
85
|
+
/**
|
|
86
|
+
* The number of items in this result set. If more items are available, a `_links.next` URL will be present in the result
|
|
87
|
+
*
|
|
88
|
+
* @remarks
|
|
89
|
+
* as well.
|
|
90
|
+
*
|
|
91
|
+
* The maximum number of items per result set is controlled by the `limit` property provided in the request. The default
|
|
92
|
+
* limit is 50 items.
|
|
93
|
+
*/
|
|
94
|
+
count: number;
|
|
95
|
+
embedded: ListPayoutsEmbedded;
|
|
96
|
+
/**
|
|
97
|
+
* Links to help navigate through the lists of items. Every URL object will contain an `href` and a `type` field.
|
|
98
|
+
*/
|
|
99
|
+
links: models.ListLinks;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export type ListPayoutsResponse = {
|
|
103
|
+
result: ListPayoutsResponseBody;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
/** @internal */
|
|
107
|
+
export type ListPayoutsRequest$Outbound = {
|
|
108
|
+
balanceId?: string | null | undefined;
|
|
109
|
+
from?: string | null | undefined;
|
|
110
|
+
limit?: number | null | undefined;
|
|
111
|
+
sort?: string | undefined;
|
|
112
|
+
testmode?: boolean | undefined;
|
|
113
|
+
"idempotency-key"?: string | undefined;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
/** @internal */
|
|
117
|
+
export const ListPayoutsRequest$outboundSchema: z.ZodType<
|
|
118
|
+
ListPayoutsRequest$Outbound,
|
|
119
|
+
z.ZodTypeDef,
|
|
120
|
+
ListPayoutsRequest
|
|
121
|
+
> = z.object({
|
|
122
|
+
balanceId: z.nullable(z.string()).optional(),
|
|
123
|
+
from: z.nullable(z.string()).optional(),
|
|
124
|
+
limit: z.nullable(z.number().int()).optional(),
|
|
125
|
+
sort: models.Sorting$outboundSchema.optional(),
|
|
126
|
+
testmode: z.boolean().optional(),
|
|
127
|
+
idempotencyKey: z.string().optional(),
|
|
128
|
+
}).transform((v) => {
|
|
129
|
+
return remap$(v, {
|
|
130
|
+
idempotencyKey: "idempotency-key",
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
export function listPayoutsRequestToJSON(
|
|
135
|
+
listPayoutsRequest: ListPayoutsRequest,
|
|
136
|
+
): string {
|
|
137
|
+
return JSON.stringify(
|
|
138
|
+
ListPayoutsRequest$outboundSchema.parse(listPayoutsRequest),
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** @internal */
|
|
143
|
+
export const ListPayoutsEmbedded$inboundSchema: z.ZodType<
|
|
144
|
+
ListPayoutsEmbedded,
|
|
145
|
+
z.ZodTypeDef,
|
|
146
|
+
unknown
|
|
147
|
+
> = z.object({
|
|
148
|
+
payouts: z.array(models.ListEntityPayout$inboundSchema),
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
export function listPayoutsEmbeddedFromJSON(
|
|
152
|
+
jsonString: string,
|
|
153
|
+
): SafeParseResult<ListPayoutsEmbedded, SDKValidationError> {
|
|
154
|
+
return safeParse(
|
|
155
|
+
jsonString,
|
|
156
|
+
(x) => ListPayoutsEmbedded$inboundSchema.parse(JSON.parse(x)),
|
|
157
|
+
`Failed to parse 'ListPayoutsEmbedded' from JSON`,
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/** @internal */
|
|
162
|
+
export const ListPayoutsResponseBody$inboundSchema: z.ZodType<
|
|
163
|
+
ListPayoutsResponseBody,
|
|
164
|
+
z.ZodTypeDef,
|
|
165
|
+
unknown
|
|
166
|
+
> = z.object({
|
|
167
|
+
count: z.number().int(),
|
|
168
|
+
_embedded: z.lazy(() => ListPayoutsEmbedded$inboundSchema),
|
|
169
|
+
_links: models.ListLinks$inboundSchema,
|
|
170
|
+
}).transform((v) => {
|
|
171
|
+
return remap$(v, {
|
|
172
|
+
"_embedded": "embedded",
|
|
173
|
+
"_links": "links",
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
export function listPayoutsResponseBodyFromJSON(
|
|
178
|
+
jsonString: string,
|
|
179
|
+
): SafeParseResult<ListPayoutsResponseBody, SDKValidationError> {
|
|
180
|
+
return safeParse(
|
|
181
|
+
jsonString,
|
|
182
|
+
(x) => ListPayoutsResponseBody$inboundSchema.parse(JSON.parse(x)),
|
|
183
|
+
`Failed to parse 'ListPayoutsResponseBody' from JSON`,
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/** @internal */
|
|
188
|
+
export const ListPayoutsResponse$inboundSchema: z.ZodType<
|
|
189
|
+
ListPayoutsResponse,
|
|
190
|
+
z.ZodTypeDef,
|
|
191
|
+
unknown
|
|
192
|
+
> = z.object({
|
|
193
|
+
Result: z.lazy(() => ListPayoutsResponseBody$inboundSchema),
|
|
194
|
+
}).transform((v) => {
|
|
195
|
+
return remap$(v, {
|
|
196
|
+
"Result": "result",
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
export function listPayoutsResponseFromJSON(
|
|
201
|
+
jsonString: string,
|
|
202
|
+
): SafeParseResult<ListPayoutsResponse, SDKValidationError> {
|
|
203
|
+
return safeParse(
|
|
204
|
+
jsonString,
|
|
205
|
+
(x) => ListPayoutsResponse$inboundSchema.parse(JSON.parse(x)),
|
|
206
|
+
`Failed to parse 'ListPayoutsResponse' from JSON`,
|
|
207
|
+
);
|
|
208
|
+
}
|
|
@@ -511,6 +511,15 @@ export type PaymentRequest = {
|
|
|
511
511
|
* enough.
|
|
512
512
|
*/
|
|
513
513
|
cardToken?: string | undefined;
|
|
514
|
+
/**
|
|
515
|
+
* The Google Pay payment token object (encoded as JSON) returned by the Google Pay SDK after the customer authorizes
|
|
516
|
+
*
|
|
517
|
+
* @remarks
|
|
518
|
+
* the payment. The token contains the payment information needed to complete the payment.
|
|
519
|
+
*
|
|
520
|
+
* The object should be passed encoded in a JSON string.
|
|
521
|
+
*/
|
|
522
|
+
googlePayPaymentToken?: string | undefined;
|
|
514
523
|
/**
|
|
515
524
|
* The card token you received from the card component of Mollie Components. The token represents the customer's card
|
|
516
525
|
*
|
|
@@ -752,6 +761,7 @@ export type PaymentRequest$Outbound = {
|
|
|
752
761
|
applePayPaymentToken?: string | undefined;
|
|
753
762
|
company?: Company$Outbound | undefined;
|
|
754
763
|
cardToken?: string | undefined;
|
|
764
|
+
googlePayPaymentToken?: string | undefined;
|
|
755
765
|
voucherNumber?: string | undefined;
|
|
756
766
|
voucherPin?: string | undefined;
|
|
757
767
|
consumerDateOfBirth?: string | undefined;
|
|
@@ -804,6 +814,7 @@ export const PaymentRequest$outboundSchema: z.ZodType<
|
|
|
804
814
|
applePayPaymentToken: z.string().optional(),
|
|
805
815
|
company: z.lazy(() => Company$outboundSchema).optional(),
|
|
806
816
|
cardToken: z.string().optional(),
|
|
817
|
+
googlePayPaymentToken: z.string().optional(),
|
|
807
818
|
voucherNumber: z.string().optional(),
|
|
808
819
|
voucherPin: z.string().optional(),
|
|
809
820
|
consumerDateOfBirth: z.instanceof(RFCDate).transform(v => v.toString())
|
|
@@ -0,0 +1,60 @@
|
|
|
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
|
+
* In v2 endpoints, monetary amounts are represented as objects with a `currency` and `value` field.
|
|
20
|
+
*/
|
|
21
|
+
amount?: AmountNullable | null | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* The description that will appear on the bank statement for this payout.
|
|
24
|
+
*/
|
|
25
|
+
description?: string | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Whether to create the entity in test mode or live mode.
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
*
|
|
31
|
+
* Most API credentials are specifically created for either live mode or test mode, in which case this parameter must
|
|
32
|
+
* not be sent. For organization-level credentials such as OAuth access tokens, you can enable test mode by setting
|
|
33
|
+
* `testmode` to `true`.
|
|
34
|
+
*/
|
|
35
|
+
testmode?: boolean | null | undefined;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** @internal */
|
|
39
|
+
export type PayoutRequest$Outbound = {
|
|
40
|
+
balanceId: string;
|
|
41
|
+
amount?: AmountNullable$Outbound | null | undefined;
|
|
42
|
+
description?: string | undefined;
|
|
43
|
+
testmode?: boolean | null | undefined;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/** @internal */
|
|
47
|
+
export const PayoutRequest$outboundSchema: z.ZodType<
|
|
48
|
+
PayoutRequest$Outbound,
|
|
49
|
+
z.ZodTypeDef,
|
|
50
|
+
PayoutRequest
|
|
51
|
+
> = z.object({
|
|
52
|
+
balanceId: z.string(),
|
|
53
|
+
amount: z.nullable(AmountNullable$outboundSchema).optional(),
|
|
54
|
+
description: z.string().optional(),
|
|
55
|
+
testmode: z.nullable(z.boolean()).optional(),
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
export function payoutRequestToJSON(payoutRequest: PayoutRequest): string {
|
|
59
|
+
return JSON.stringify(PayoutRequest$outboundSchema.parse(payoutRequest));
|
|
60
|
+
}
|
|
@@ -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
|
}
|