@getivy/node-sdk 0.1.0-alpha.10
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/CHANGELOG.md +130 -0
- package/LICENSE +201 -0
- package/README.md +303 -0
- package/_shims/MultipartBody.d.ts +9 -0
- package/_shims/MultipartBody.d.ts.map +1 -0
- package/_shims/MultipartBody.js +16 -0
- package/_shims/MultipartBody.js.map +1 -0
- package/_shims/MultipartBody.mjs +12 -0
- package/_shims/MultipartBody.mjs.map +1 -0
- package/_shims/README.md +46 -0
- package/_shims/auto/runtime-bun.d.ts +5 -0
- package/_shims/auto/runtime-bun.d.ts.map +1 -0
- package/_shims/auto/runtime-bun.js +21 -0
- package/_shims/auto/runtime-bun.js.map +1 -0
- package/_shims/auto/runtime-bun.mjs +2 -0
- package/_shims/auto/runtime-bun.mjs.map +1 -0
- package/_shims/auto/runtime-node.d.ts +5 -0
- package/_shims/auto/runtime-node.d.ts.map +1 -0
- package/_shims/auto/runtime-node.js +21 -0
- package/_shims/auto/runtime-node.js.map +1 -0
- package/_shims/auto/runtime-node.mjs +2 -0
- package/_shims/auto/runtime-node.mjs.map +1 -0
- package/_shims/auto/runtime.d.ts +5 -0
- package/_shims/auto/runtime.d.ts.map +1 -0
- package/_shims/auto/runtime.js +21 -0
- package/_shims/auto/runtime.js.map +1 -0
- package/_shims/auto/runtime.mjs +2 -0
- package/_shims/auto/runtime.mjs.map +1 -0
- package/_shims/auto/types-node.d.ts +5 -0
- package/_shims/auto/types-node.d.ts.map +1 -0
- package/_shims/auto/types-node.js +21 -0
- package/_shims/auto/types-node.js.map +1 -0
- package/_shims/auto/types-node.mjs +2 -0
- package/_shims/auto/types-node.mjs.map +1 -0
- package/_shims/auto/types.d.ts +101 -0
- package/_shims/auto/types.js +3 -0
- package/_shims/auto/types.mjs +3 -0
- package/_shims/bun-runtime.d.ts +6 -0
- package/_shims/bun-runtime.d.ts.map +1 -0
- package/_shims/bun-runtime.js +14 -0
- package/_shims/bun-runtime.js.map +1 -0
- package/_shims/bun-runtime.mjs +10 -0
- package/_shims/bun-runtime.mjs.map +1 -0
- package/_shims/index.d.ts +81 -0
- package/_shims/index.js +13 -0
- package/_shims/index.mjs +7 -0
- package/_shims/manual-types.d.ts +12 -0
- package/_shims/manual-types.js +3 -0
- package/_shims/manual-types.mjs +3 -0
- package/_shims/node-runtime.d.ts +3 -0
- package/_shims/node-runtime.d.ts.map +1 -0
- package/_shims/node-runtime.js +89 -0
- package/_shims/node-runtime.js.map +1 -0
- package/_shims/node-runtime.mjs +56 -0
- package/_shims/node-runtime.mjs.map +1 -0
- package/_shims/node-types.d.ts +42 -0
- package/_shims/node-types.js +3 -0
- package/_shims/node-types.mjs +3 -0
- package/_shims/registry.d.ts +37 -0
- package/_shims/registry.d.ts.map +1 -0
- package/_shims/registry.js +41 -0
- package/_shims/registry.js.map +1 -0
- package/_shims/registry.mjs +37 -0
- package/_shims/registry.mjs.map +1 -0
- package/_shims/web-runtime.d.ts +5 -0
- package/_shims/web-runtime.d.ts.map +1 -0
- package/_shims/web-runtime.js +78 -0
- package/_shims/web-runtime.js.map +1 -0
- package/_shims/web-runtime.mjs +71 -0
- package/_shims/web-runtime.mjs.map +1 -0
- package/_shims/web-types.d.ts +83 -0
- package/_shims/web-types.js +3 -0
- package/_shims/web-types.mjs +3 -0
- package/core.d.ts +241 -0
- package/core.d.ts.map +1 -0
- package/core.js +915 -0
- package/core.js.map +1 -0
- package/core.mjs +883 -0
- package/core.mjs.map +1 -0
- package/error.d.ts +47 -0
- package/error.d.ts.map +1 -0
- package/error.js +113 -0
- package/error.js.map +1 -0
- package/error.mjs +97 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +160 -0
- package/index.d.ts +160 -0
- package/index.d.ts.map +1 -0
- package/index.js +167 -0
- package/index.js.map +1 -0
- package/index.mjs +124 -0
- package/index.mjs.map +1 -0
- package/package.json +124 -0
- package/resource.d.ts +6 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +11 -0
- package/resource.js.map +1 -0
- package/resource.mjs +7 -0
- package/resource.mjs.map +1 -0
- package/resources/balance.d.ts +34 -0
- package/resources/balance.d.ts.map +1 -0
- package/resources/balance.js +16 -0
- package/resources/balance.js.map +1 -0
- package/resources/balance.mjs +12 -0
- package/resources/balance.mjs.map +1 -0
- package/resources/banks.d.ts +235 -0
- package/resources/banks.d.ts.map +1 -0
- package/resources/banks.js +30 -0
- package/resources/banks.js.map +1 -0
- package/resources/banks.mjs +26 -0
- package/resources/banks.mjs.map +1 -0
- package/resources/capabilities.d.ts +28 -0
- package/resources/capabilities.d.ts.map +1 -0
- package/resources/capabilities.js +16 -0
- package/resources/capabilities.js.map +1 -0
- package/resources/capabilities.mjs +12 -0
- package/resources/capabilities.mjs.map +1 -0
- package/resources/charges.d.ts +73 -0
- package/resources/charges.d.ts.map +1 -0
- package/resources/charges.js +15 -0
- package/resources/charges.js.map +1 -0
- package/resources/charges.mjs +11 -0
- package/resources/charges.mjs.map +1 -0
- package/resources/checkoutsession.d.ts +1504 -0
- package/resources/checkoutsession.d.ts.map +1 -0
- package/resources/checkoutsession.js +30 -0
- package/resources/checkoutsession.js.map +1 -0
- package/resources/checkoutsession.mjs +26 -0
- package/resources/checkoutsession.mjs.map +1 -0
- package/resources/customers.d.ts +82 -0
- package/resources/customers.d.ts.map +1 -0
- package/resources/customers.js +21 -0
- package/resources/customers.js.map +1 -0
- package/resources/customers.mjs +17 -0
- package/resources/customers.mjs.map +1 -0
- package/resources/index.d.ts +14 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +31 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +15 -0
- package/resources/index.mjs.map +1 -0
- package/resources/mandates.d.ts +91 -0
- package/resources/mandates.d.ts.map +1 -0
- package/resources/mandates.js +27 -0
- package/resources/mandates.js.map +1 -0
- package/resources/mandates.mjs +23 -0
- package/resources/mandates.mjs.map +1 -0
- package/resources/orders.d.ts +1239 -0
- package/resources/orders.d.ts.map +1 -0
- package/resources/orders.js +23 -0
- package/resources/orders.js.map +1 -0
- package/resources/orders.mjs +19 -0
- package/resources/orders.mjs.map +1 -0
- package/resources/payouts.d.ts +224 -0
- package/resources/payouts.d.ts.map +1 -0
- package/resources/payouts.js +28 -0
- package/resources/payouts.js.map +1 -0
- package/resources/payouts.mjs +24 -0
- package/resources/payouts.mjs.map +1 -0
- package/resources/refunds.d.ts +138 -0
- package/resources/refunds.d.ts.map +1 -0
- package/resources/refunds.js +28 -0
- package/resources/refunds.js.map +1 -0
- package/resources/refunds.mjs +24 -0
- package/resources/refunds.mjs.map +1 -0
- package/resources/reports.d.ts +120 -0
- package/resources/reports.d.ts.map +1 -0
- package/resources/reports.js +31 -0
- package/resources/reports.js.map +1 -0
- package/resources/reports.mjs +27 -0
- package/resources/reports.mjs.map +1 -0
- package/resources/subaccounts.d.ts +49 -0
- package/resources/subaccounts.d.ts.map +1 -0
- package/resources/subaccounts.js +22 -0
- package/resources/subaccounts.js.map +1 -0
- package/resources/subaccounts.mjs +18 -0
- package/resources/subaccounts.mjs.map +1 -0
- package/resources/webhooksubscription.d.ts +155 -0
- package/resources/webhooksubscription.d.ts.map +1 -0
- package/resources/webhooksubscription.js +42 -0
- package/resources/webhooksubscription.js.map +1 -0
- package/resources/webhooksubscription.mjs +38 -0
- package/resources/webhooksubscription.mjs.map +1 -0
- package/shims/node.d.ts +30 -0
- package/shims/node.d.ts.map +1 -0
- package/shims/node.js +31 -0
- package/shims/node.js.map +1 -0
- package/shims/node.mjs +5 -0
- package/shims/node.mjs.map +1 -0
- package/shims/web.d.ts +26 -0
- package/shims/web.d.ts.map +1 -0
- package/shims/web.js +31 -0
- package/shims/web.js.map +1 -0
- package/shims/web.mjs +5 -0
- package/shims/web.mjs.map +1 -0
- package/src/_shims/MultipartBody.ts +9 -0
- package/src/_shims/README.md +46 -0
- package/src/_shims/auto/runtime-bun.ts +4 -0
- package/src/_shims/auto/runtime-node.ts +4 -0
- package/src/_shims/auto/runtime.ts +4 -0
- package/src/_shims/auto/types-node.ts +4 -0
- package/src/_shims/auto/types.d.ts +101 -0
- package/src/_shims/auto/types.js +3 -0
- package/src/_shims/auto/types.mjs +3 -0
- package/src/_shims/bun-runtime.ts +14 -0
- package/src/_shims/index.d.ts +81 -0
- package/src/_shims/index.js +13 -0
- package/src/_shims/index.mjs +7 -0
- package/src/_shims/manual-types.d.ts +12 -0
- package/src/_shims/manual-types.js +3 -0
- package/src/_shims/manual-types.mjs +3 -0
- package/src/_shims/node-runtime.ts +81 -0
- package/src/_shims/node-types.d.ts +42 -0
- package/src/_shims/node-types.js +3 -0
- package/src/_shims/node-types.mjs +3 -0
- package/src/_shims/registry.ts +67 -0
- package/src/_shims/web-runtime.ts +103 -0
- package/src/_shims/web-types.d.ts +83 -0
- package/src/_shims/web-types.js +3 -0
- package/src/_shims/web-types.mjs +3 -0
- package/src/core.ts +1208 -0
- package/src/error.ts +130 -0
- package/src/index.ts +422 -0
- package/src/lib/.keep +4 -0
- package/src/resource.ts +11 -0
- package/src/resources/balance.ts +49 -0
- package/src/resources/banks.ts +1551 -0
- package/src/resources/capabilities.ts +291 -0
- package/src/resources/charges.ts +95 -0
- package/src/resources/checkoutsession.ts +6935 -0
- package/src/resources/customers.ts +111 -0
- package/src/resources/index.ts +88 -0
- package/src/resources/mandates.ts +135 -0
- package/src/resources/orders.ts +3174 -0
- package/src/resources/payouts.ts +297 -0
- package/src/resources/refunds.ts +183 -0
- package/src/resources/reports.ts +172 -0
- package/src/resources/subaccounts.ts +73 -0
- package/src/resources/webhooksubscription.ts +353 -0
- package/src/shims/node.ts +50 -0
- package/src/shims/web.ts +50 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +255 -0
- package/src/version.ts +1 -0
- package/uploads.d.ts +75 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +171 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +158 -0
- package/uploads.mjs.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../resource';
|
|
4
|
+
import * as Core from '../core';
|
|
5
|
+
|
|
6
|
+
export class Payouts extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Create a Customer Payout to a customer's bank account for withdrawals or similar
|
|
9
|
+
* purposes.
|
|
10
|
+
*/
|
|
11
|
+
create(body: PayoutCreateParams, options?: Core.RequestOptions): Core.APIPromise<PublicUserPayout> {
|
|
12
|
+
return this._client.post('/api/service/payout/create', { body, ...options });
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Retrieve a Customer Payout by id
|
|
17
|
+
*/
|
|
18
|
+
retrieve(body: PayoutRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<PublicUserPayout> {
|
|
19
|
+
return this._client.post('/api/service/payout/retrieve', { body, ...options });
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* List all Customer Payouts made by this merchant account.
|
|
24
|
+
*/
|
|
25
|
+
list(body: PayoutListParams, options?: Core.RequestOptions): Core.APIPromise<PayoutListResponse> {
|
|
26
|
+
return this._client.post('/api/service/payout/list', { body, ...options });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface PublicUserPayout {
|
|
31
|
+
id: string;
|
|
32
|
+
|
|
33
|
+
amount: number;
|
|
34
|
+
|
|
35
|
+
currency: 'EUR' | 'GBP' | 'PLN';
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The validation logic is based on the "type" field. For example, if "type" is set
|
|
39
|
+
* to "iban", the "iban" object must be filled out.
|
|
40
|
+
*/
|
|
41
|
+
destination: PublicUserPayout.Destination;
|
|
42
|
+
|
|
43
|
+
status: 'paid' | 'pending' | 'failed';
|
|
44
|
+
|
|
45
|
+
createdAt?: string;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Any key-value pairs, which will be stored to the object. See
|
|
49
|
+
* [here](https://docs.getivy.de/reference/metadata) for more info.
|
|
50
|
+
*/
|
|
51
|
+
metadata?: Record<string, unknown>;
|
|
52
|
+
|
|
53
|
+
updatedAt?: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export namespace PublicUserPayout {
|
|
57
|
+
/**
|
|
58
|
+
* The validation logic is based on the "type" field. For example, if "type" is set
|
|
59
|
+
* to "iban", the "iban" object must be filled out.
|
|
60
|
+
*/
|
|
61
|
+
export interface Destination {
|
|
62
|
+
/**
|
|
63
|
+
* The type of the financial address. The actual destination is determined by this
|
|
64
|
+
* field which can be either "iban", "sortCode", "bankCode", or "bban". The
|
|
65
|
+
* validation will fail if you set e.g. type="iban", but then not fill any values
|
|
66
|
+
* in the "iban" object.
|
|
67
|
+
*
|
|
68
|
+
* - iban: The IBAN of the account
|
|
69
|
+
* - sort_code: The sort code of the account
|
|
70
|
+
* - bank_code: The bank code of the account
|
|
71
|
+
* - bban: The BBAN of the account
|
|
72
|
+
*/
|
|
73
|
+
type: string;
|
|
74
|
+
|
|
75
|
+
bankCode?: Destination.BankCode;
|
|
76
|
+
|
|
77
|
+
bban?: Destination.Bban;
|
|
78
|
+
|
|
79
|
+
iban?: Destination.Iban;
|
|
80
|
+
|
|
81
|
+
sortCode?: Destination.SortCode;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export namespace Destination {
|
|
85
|
+
export interface BankCode {
|
|
86
|
+
/**
|
|
87
|
+
* The name of the account holder.
|
|
88
|
+
*/
|
|
89
|
+
accountHolderName: string;
|
|
90
|
+
|
|
91
|
+
accountNumber: string;
|
|
92
|
+
|
|
93
|
+
code: string;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface Bban {
|
|
97
|
+
/**
|
|
98
|
+
* The name of the account holder.
|
|
99
|
+
*/
|
|
100
|
+
accountHolderName: string;
|
|
101
|
+
|
|
102
|
+
bban: string;
|
|
103
|
+
|
|
104
|
+
bic?: string;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface Iban {
|
|
108
|
+
/**
|
|
109
|
+
* The name of the account holder.
|
|
110
|
+
*/
|
|
111
|
+
accountHolderName: string;
|
|
112
|
+
|
|
113
|
+
iban: string;
|
|
114
|
+
|
|
115
|
+
bic?: string;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export interface SortCode {
|
|
119
|
+
/**
|
|
120
|
+
* The name of the account holder.
|
|
121
|
+
*/
|
|
122
|
+
accountHolderName: string;
|
|
123
|
+
|
|
124
|
+
accountNumber: string;
|
|
125
|
+
|
|
126
|
+
sortCode: string;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface PayoutListResponse {
|
|
132
|
+
/**
|
|
133
|
+
* The total number of items
|
|
134
|
+
*/
|
|
135
|
+
count: number;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Whether there are more items to retrieve
|
|
139
|
+
*/
|
|
140
|
+
hasNext: boolean;
|
|
141
|
+
|
|
142
|
+
items: Array<PublicUserPayout>;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* The number of items skipped
|
|
146
|
+
*/
|
|
147
|
+
skip: number;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export interface PayoutCreateParams {
|
|
151
|
+
/**
|
|
152
|
+
* The amount of the customer payout
|
|
153
|
+
*/
|
|
154
|
+
amount: number;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* The currency of the customer payout
|
|
158
|
+
*/
|
|
159
|
+
currency: 'EUR' | 'GBP' | 'PLN';
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* The destination of the customer payout.
|
|
163
|
+
*/
|
|
164
|
+
destination: PayoutCreateParams.Destination;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* The metadata of the customer payout
|
|
168
|
+
*/
|
|
169
|
+
metadata?: Record<string, unknown>;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* The payment reference of the customer payout. The customer will see this
|
|
173
|
+
* reference in their bank statement.
|
|
174
|
+
*/
|
|
175
|
+
paymentReference?: string;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export namespace PayoutCreateParams {
|
|
179
|
+
/**
|
|
180
|
+
* The destination of the customer payout.
|
|
181
|
+
*/
|
|
182
|
+
export interface Destination {
|
|
183
|
+
/**
|
|
184
|
+
* Used for open-loop customer payouts. Disabled by default for merchants.
|
|
185
|
+
*/
|
|
186
|
+
financialAddress?: Destination.FinancialAddress;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* For closed-loop customer payouts. The destination account will be taken from the
|
|
190
|
+
* payer of this order.
|
|
191
|
+
*/
|
|
192
|
+
orderId?: string;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export namespace Destination {
|
|
196
|
+
/**
|
|
197
|
+
* Used for open-loop customer payouts. Disabled by default for merchants.
|
|
198
|
+
*/
|
|
199
|
+
export interface FinancialAddress {
|
|
200
|
+
/**
|
|
201
|
+
* The type of the financial address. The actual destination is determined by this
|
|
202
|
+
* field which can be either "iban", "sortCode", "bankCode", or "bban". The
|
|
203
|
+
* validation will fail if you set e.g. type="iban", but then not fill any values
|
|
204
|
+
* in the "iban" object.
|
|
205
|
+
*
|
|
206
|
+
* - iban: The IBAN of the account
|
|
207
|
+
* - sort_code: The sort code of the account
|
|
208
|
+
* - bank_code: The bank code of the account
|
|
209
|
+
* - bban: The BBAN of the account
|
|
210
|
+
*/
|
|
211
|
+
type: string;
|
|
212
|
+
|
|
213
|
+
bankCode?: FinancialAddress.BankCode;
|
|
214
|
+
|
|
215
|
+
bban?: FinancialAddress.Bban;
|
|
216
|
+
|
|
217
|
+
iban?: FinancialAddress.Iban;
|
|
218
|
+
|
|
219
|
+
sortCode?: FinancialAddress.SortCode;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export namespace FinancialAddress {
|
|
223
|
+
export interface BankCode {
|
|
224
|
+
/**
|
|
225
|
+
* The name of the account holder.
|
|
226
|
+
*/
|
|
227
|
+
accountHolderName: string;
|
|
228
|
+
|
|
229
|
+
accountNumber: string;
|
|
230
|
+
|
|
231
|
+
code: string;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export interface Bban {
|
|
235
|
+
/**
|
|
236
|
+
* The name of the account holder.
|
|
237
|
+
*/
|
|
238
|
+
accountHolderName: string;
|
|
239
|
+
|
|
240
|
+
bban: string;
|
|
241
|
+
|
|
242
|
+
bic?: string;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export interface Iban {
|
|
246
|
+
/**
|
|
247
|
+
* The name of the account holder.
|
|
248
|
+
*/
|
|
249
|
+
accountHolderName: string;
|
|
250
|
+
|
|
251
|
+
iban: string;
|
|
252
|
+
|
|
253
|
+
bic?: string;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export interface SortCode {
|
|
257
|
+
/**
|
|
258
|
+
* The name of the account holder.
|
|
259
|
+
*/
|
|
260
|
+
accountHolderName: string;
|
|
261
|
+
|
|
262
|
+
accountNumber: string;
|
|
263
|
+
|
|
264
|
+
sortCode: string;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export interface PayoutRetrieveParams {
|
|
271
|
+
/**
|
|
272
|
+
* The unique identifier of the Customer Payout
|
|
273
|
+
*/
|
|
274
|
+
id: string;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export interface PayoutListParams {
|
|
278
|
+
/**
|
|
279
|
+
* The number of items to retrieve
|
|
280
|
+
*/
|
|
281
|
+
limit?: number;
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* The number of items to skip
|
|
285
|
+
*/
|
|
286
|
+
skip?: number;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
export declare namespace Payouts {
|
|
290
|
+
export {
|
|
291
|
+
type PublicUserPayout as PublicUserPayout,
|
|
292
|
+
type PayoutListResponse as PayoutListResponse,
|
|
293
|
+
type PayoutCreateParams as PayoutCreateParams,
|
|
294
|
+
type PayoutRetrieveParams as PayoutRetrieveParams,
|
|
295
|
+
type PayoutListParams as PayoutListParams,
|
|
296
|
+
};
|
|
297
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../resource';
|
|
4
|
+
import * as Core from '../core';
|
|
5
|
+
import * as RefundsAPI from './refunds';
|
|
6
|
+
|
|
7
|
+
export class Refunds extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Initiates a refund for the specified order. The order can be specified either by
|
|
10
|
+
* Ivy\'s internal `orderId` or by the `referenceId` provided by the merchant
|
|
11
|
+
* during checkout creation. If the refund should only be partial, you can specifiy
|
|
12
|
+
* this with the `amount` parameter.
|
|
13
|
+
*/
|
|
14
|
+
create(body: RefundCreateParams, options?: Core.RequestOptions): Core.APIPromise<RefundResponse> {
|
|
15
|
+
return this._client.post('/api/service/merchant/payment/refund', { body, ...options });
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Initiates a batch refund for all provided orders. The orders can be specified
|
|
20
|
+
* either by Ivy\'s internal id ("orderId") or by id provided by the merchant
|
|
21
|
+
* ("referenceId"). If only a partial amount should be refunded the desired amount
|
|
22
|
+
* can be set with the "amount" parameter. Additional information regarding the
|
|
23
|
+
* refund can be provided through the "description" parameter.
|
|
24
|
+
*/
|
|
25
|
+
batch(body: RefundBatchParams, options?: Core.RequestOptions): Core.APIPromise<RefundBatchResponse> {
|
|
26
|
+
return this._client.post('/api/service/merchant/payment/refund/batch', { body, ...options });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface RefundResponse {
|
|
31
|
+
/**
|
|
32
|
+
* The internal Ivy id of the order.
|
|
33
|
+
*/
|
|
34
|
+
orderId: string;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The order status. This status symbolises the state of the user's payment
|
|
38
|
+
* attempt. See [the guide](https://docs.getivy.de/docs/payment-status) for more
|
|
39
|
+
* information.
|
|
40
|
+
*/
|
|
41
|
+
orderStatus:
|
|
42
|
+
| 'failed'
|
|
43
|
+
| 'canceled'
|
|
44
|
+
| 'processing'
|
|
45
|
+
| 'waiting_for_payment'
|
|
46
|
+
| 'paid'
|
|
47
|
+
| 'in_refund'
|
|
48
|
+
| 'refunded'
|
|
49
|
+
| 'refund_failed'
|
|
50
|
+
| 'partially_refunded'
|
|
51
|
+
| 'in_dispute'
|
|
52
|
+
| 'disputed'
|
|
53
|
+
| 'refused';
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* A unique identifier for the newly created refund. You can use this id to
|
|
57
|
+
* retrieve the refund from the order object.
|
|
58
|
+
*/
|
|
59
|
+
referenceId: string;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The status of the refund. Always use the status of the order as your source of
|
|
63
|
+
* truth to trigger actions in your dashboard.
|
|
64
|
+
*/
|
|
65
|
+
refundStatus: 'pending' | 'succeeded' | 'failed' | 'requires_action' | 'partially_refunded';
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface RefundBatchResponse {
|
|
69
|
+
/**
|
|
70
|
+
* An array of refund responses.
|
|
71
|
+
*/
|
|
72
|
+
requestedRefunds: Array<RefundBatchResponse.RequestedRefund>;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export namespace RefundBatchResponse {
|
|
76
|
+
export interface RequestedRefund extends RefundsAPI.RefundResponse {
|
|
77
|
+
/**
|
|
78
|
+
* The Ivy id of the corresponding order.
|
|
79
|
+
*/
|
|
80
|
+
orderId: string;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The error message why the refund failed.
|
|
84
|
+
*/
|
|
85
|
+
error?: string;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface RefundCreateParams {
|
|
90
|
+
/**
|
|
91
|
+
* The amount to refund in decimals, e.g. 10.23 for EUR 10.23. If not specified,
|
|
92
|
+
* the full order amount will be refunded.
|
|
93
|
+
*/
|
|
94
|
+
amount?: number;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* A description for the refund. This will be retrievable in the API and in the Ivy
|
|
98
|
+
* dashboard.
|
|
99
|
+
*/
|
|
100
|
+
description?: string;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* An optional custom text that will be shown on the customer's payment reference.
|
|
104
|
+
* Input has to be maximum 16 alpha-numeric characters. If not provided, a default
|
|
105
|
+
* Ivy refund referenceId will be shown.
|
|
106
|
+
*/
|
|
107
|
+
displayedPaymentReference?: string;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* The email of the customer. If provided, Ivy may use this email to contact the
|
|
111
|
+
* customer directly in case of issues or need for clarification regarding the
|
|
112
|
+
* refund. If not provided, Ivy will contact the merchant in such cases. However,
|
|
113
|
+
* this is a rare occurrence.
|
|
114
|
+
*/
|
|
115
|
+
email?: string;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* The internal Ivy id of the order.
|
|
119
|
+
*/
|
|
120
|
+
orderId?: string;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* The external id set by the merchant during checkout creation.
|
|
124
|
+
*/
|
|
125
|
+
referenceId?: string;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface RefundBatchParams {
|
|
129
|
+
/**
|
|
130
|
+
* An array of refunds to be triggered.
|
|
131
|
+
*/
|
|
132
|
+
requestedRefunds: Array<RefundBatchParams.RequestedRefund>;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export namespace RefundBatchParams {
|
|
136
|
+
export interface RequestedRefund {
|
|
137
|
+
/**
|
|
138
|
+
* The amount to refund in decimals, e.g. 10.23 for EUR 10.23. If not specified,
|
|
139
|
+
* the full order amount will be refunded.
|
|
140
|
+
*/
|
|
141
|
+
amount?: number;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* A description for the refund. This will be retrievable in the API and in the Ivy
|
|
145
|
+
* dashboard.
|
|
146
|
+
*/
|
|
147
|
+
description?: string;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* An optional custom text that will be shown on the customer's payment reference.
|
|
151
|
+
* Input has to be maximum 16 alpha-numeric characters. If not provided, a default
|
|
152
|
+
* Ivy refund referenceId will be shown.
|
|
153
|
+
*/
|
|
154
|
+
displayedPaymentReference?: string;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* The email of the customer. If provided, Ivy may use this email to contact the
|
|
158
|
+
* customer directly in case of issues or need for clarification regarding the
|
|
159
|
+
* refund. If not provided, Ivy will contact the merchant in such cases. However,
|
|
160
|
+
* this is a rare occurrence.
|
|
161
|
+
*/
|
|
162
|
+
email?: string;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* The internal Ivy id of the order.
|
|
166
|
+
*/
|
|
167
|
+
orderId?: string;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* The external id set by the merchant during checkout creation.
|
|
171
|
+
*/
|
|
172
|
+
referenceId?: string;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export declare namespace Refunds {
|
|
177
|
+
export {
|
|
178
|
+
type RefundResponse as RefundResponse,
|
|
179
|
+
type RefundBatchResponse as RefundBatchResponse,
|
|
180
|
+
type RefundCreateParams as RefundCreateParams,
|
|
181
|
+
type RefundBatchParams as RefundBatchParams,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../resource';
|
|
4
|
+
import * as Core from '../core';
|
|
5
|
+
|
|
6
|
+
export class Reports extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Create a Payout Report for a given timerange. A Payout Report is generated
|
|
9
|
+
* async. Please follow [this guide](https://docs.getivy.de/docs/payout-report-1)
|
|
10
|
+
* to learn more in detail.
|
|
11
|
+
*/
|
|
12
|
+
create(body: ReportCreateParams, options?: Core.RequestOptions): Core.APIPromise<ReportCreateResponse> {
|
|
13
|
+
return this._client.post('/api/service/merchant/payout/export/create', { body, ...options });
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Retrieve the status of an existing Payout Report. Use this endpoint to poll for
|
|
18
|
+
* the status before downloading a Payout Report.
|
|
19
|
+
*/
|
|
20
|
+
retrieve(
|
|
21
|
+
body: ReportRetrieveParams,
|
|
22
|
+
options?: Core.RequestOptions,
|
|
23
|
+
): Core.APIPromise<ReportRetrieveResponse> {
|
|
24
|
+
return this._client.post('/api/service/merchant/payout/export/retrieve', { body, ...options });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Download the actual Payout Report once the creation succeeded with this
|
|
29
|
+
* endpoint.
|
|
30
|
+
*/
|
|
31
|
+
download(body: ReportDownloadParams, options?: Core.RequestOptions): Core.APIPromise<PayoutReport> {
|
|
32
|
+
return this._client.post('/api/service/merchant/payout/export/download', { body, ...options });
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface PayoutReport {
|
|
37
|
+
payouts: Array<PayoutReport.Payout>;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export namespace PayoutReport {
|
|
41
|
+
export interface Payout {
|
|
42
|
+
id: string;
|
|
43
|
+
|
|
44
|
+
amount: number;
|
|
45
|
+
|
|
46
|
+
availableAt: string;
|
|
47
|
+
|
|
48
|
+
merchantAppId: string;
|
|
49
|
+
|
|
50
|
+
transactions: Array<Payout.Transaction>;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export namespace Payout {
|
|
54
|
+
export interface Transaction {
|
|
55
|
+
currency: 'EUR' | 'GBP' | 'PLN';
|
|
56
|
+
|
|
57
|
+
fee: number;
|
|
58
|
+
|
|
59
|
+
gross: number;
|
|
60
|
+
|
|
61
|
+
net: number;
|
|
62
|
+
|
|
63
|
+
reportingCategory: string;
|
|
64
|
+
|
|
65
|
+
billingFullName?: string;
|
|
66
|
+
|
|
67
|
+
createdAt?: string;
|
|
68
|
+
|
|
69
|
+
description?: string;
|
|
70
|
+
|
|
71
|
+
displayId?: string;
|
|
72
|
+
|
|
73
|
+
orderId?: string;
|
|
74
|
+
|
|
75
|
+
referenceId?: string;
|
|
76
|
+
|
|
77
|
+
subaccountId?: string;
|
|
78
|
+
|
|
79
|
+
userMail?: string;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface ReportCreateResponse {
|
|
85
|
+
/**
|
|
86
|
+
* The unique identifier of the new Payout Report Object that was created.
|
|
87
|
+
*/
|
|
88
|
+
id: string;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Status of the Payout Report creation. This will be `pending` when the run is
|
|
92
|
+
* initially created. As soon as the report is created, this will be set to
|
|
93
|
+
* `succeeded`. Rarely, we may encounter an error, at which point this will be set
|
|
94
|
+
* to `failed`. See [the guide](https://docs.getivy.de/docs/payout-report-1) to
|
|
95
|
+
* learn more.
|
|
96
|
+
*/
|
|
97
|
+
status: string;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* @deprecated
|
|
101
|
+
*/
|
|
102
|
+
fileUrl?: string;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface ReportRetrieveResponse {
|
|
106
|
+
/**
|
|
107
|
+
* Status of this Payout Report creation. This will be `pending` when the run is
|
|
108
|
+
* initially created. When the run finishes, this will be set to `succeeded`.
|
|
109
|
+
* Rarely, we may encounter an error, at which point this will be set to `failed`.
|
|
110
|
+
*/
|
|
111
|
+
status: string;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* @deprecated
|
|
115
|
+
*/
|
|
116
|
+
fileUrl?: string;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface ReportCreateParams {
|
|
120
|
+
/**
|
|
121
|
+
* Unix timestamp. The end of the timerange to create a Payout Report for.
|
|
122
|
+
*/
|
|
123
|
+
intervalEnd: number;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Unix timestamp. The start of the timerange to create a Payout Report for.
|
|
127
|
+
*/
|
|
128
|
+
intervalStart: number;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* If provided, the report will be generated for this currency only. If not
|
|
132
|
+
* provided, the report will be generated for all currencies.
|
|
133
|
+
*/
|
|
134
|
+
currency?: 'EUR' | 'GBP' | 'PLN';
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Optional URL of a webhook. If provided, the report, once generated, will be sent
|
|
138
|
+
* there in JSON format.
|
|
139
|
+
*/
|
|
140
|
+
webhookUrl?: string;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export interface ReportRetrieveParams {
|
|
144
|
+
/**
|
|
145
|
+
* The unique identifier of the Payout Report to retrieve.
|
|
146
|
+
*/
|
|
147
|
+
reportId: string;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export interface ReportDownloadParams {
|
|
151
|
+
/**
|
|
152
|
+
* The unique identifier of the report you want to download. This was returned when
|
|
153
|
+
* creating a new Payout Report.
|
|
154
|
+
*/
|
|
155
|
+
reportId: string;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* The format in which you want to download the report. Default is csv.
|
|
159
|
+
*/
|
|
160
|
+
format?: 'csv' | 'json' | 'datev';
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export declare namespace Reports {
|
|
164
|
+
export {
|
|
165
|
+
type PayoutReport as PayoutReport,
|
|
166
|
+
type ReportCreateResponse as ReportCreateResponse,
|
|
167
|
+
type ReportRetrieveResponse as ReportRetrieveResponse,
|
|
168
|
+
type ReportCreateParams as ReportCreateParams,
|
|
169
|
+
type ReportRetrieveParams as ReportRetrieveParams,
|
|
170
|
+
type ReportDownloadParams as ReportDownloadParams,
|
|
171
|
+
};
|
|
172
|
+
}
|