@getivy/node-sdk 0.1.0-alpha.8 → 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 (150) hide show
  1. package/CHANGELOG.md +359 -0
  2. package/README.md +16 -26
  3. package/_shims/index.d.ts +2 -0
  4. package/_shims/index.js +5 -1
  5. package/_shims/index.mjs +5 -1
  6. package/core.d.ts +19 -5
  7. package/core.d.ts.map +1 -1
  8. package/core.js +25 -15
  9. package/core.js.map +1 -1
  10. package/core.mjs +26 -16
  11. package/core.mjs.map +1 -1
  12. package/index.d.mts +30 -18
  13. package/index.d.ts +30 -18
  14. package/index.d.ts.map +1 -1
  15. package/index.js +21 -8
  16. package/index.js.map +1 -1
  17. package/index.mjs +21 -8
  18. package/index.mjs.map +1 -1
  19. package/package.json +11 -33
  20. package/resource.d.ts +1 -1
  21. package/resource.d.ts.map +1 -1
  22. package/resource.js.map +1 -1
  23. package/resource.mjs.map +1 -1
  24. package/resources/balance.d.ts +8 -5
  25. package/resources/balance.d.ts.map +1 -1
  26. package/resources/banks.d.ts +82 -67
  27. package/resources/banks.d.ts.map +1 -1
  28. package/resources/beneficiary-payouts.d.ts +61 -0
  29. package/resources/beneficiary-payouts.d.ts.map +1 -0
  30. package/resources/beneficiary-payouts.js +16 -0
  31. package/resources/beneficiary-payouts.js.map +1 -0
  32. package/resources/beneficiary-payouts.mjs +12 -0
  33. package/resources/beneficiary-payouts.mjs.map +1 -0
  34. package/resources/capabilities.d.ts +1 -10
  35. package/resources/capabilities.d.ts.map +1 -1
  36. package/resources/charges.d.ts +28 -19
  37. package/resources/charges.d.ts.map +1 -1
  38. package/resources/checkoutsession.d.ts +275 -1360
  39. package/resources/checkoutsession.d.ts.map +1 -1
  40. package/resources/customers.d.ts +140 -10
  41. package/resources/customers.d.ts.map +1 -1
  42. package/resources/customers.js +9 -2
  43. package/resources/customers.js.map +1 -1
  44. package/resources/customers.mjs +9 -2
  45. package/resources/customers.mjs.map +1 -1
  46. package/resources/deposits.d.ts +165 -0
  47. package/resources/deposits.d.ts.map +1 -0
  48. package/resources/deposits.js +15 -0
  49. package/resources/deposits.js.map +1 -0
  50. package/resources/deposits.mjs +11 -0
  51. package/resources/deposits.mjs.map +1 -0
  52. package/resources/fx.d.ts +90 -0
  53. package/resources/fx.d.ts.map +1 -0
  54. package/resources/fx.js +22 -0
  55. package/resources/fx.js.map +1 -0
  56. package/resources/fx.mjs +18 -0
  57. package/resources/fx.mjs.map +1 -0
  58. package/resources/index.d.ts +11 -8
  59. package/resources/index.d.ts.map +1 -1
  60. package/resources/index.js +11 -5
  61. package/resources/index.js.map +1 -1
  62. package/resources/index.mjs +5 -2
  63. package/resources/index.mjs.map +1 -1
  64. package/resources/mandates.d.ts +55 -17
  65. package/resources/mandates.d.ts.map +1 -1
  66. package/resources/orders.d.ts +718 -739
  67. package/resources/orders.d.ts.map +1 -1
  68. package/resources/orders.js +13 -3
  69. package/resources/orders.js.map +1 -1
  70. package/resources/orders.mjs +13 -3
  71. package/resources/orders.mjs.map +1 -1
  72. package/resources/payouts.d.ts +219 -103
  73. package/resources/payouts.d.ts.map +1 -1
  74. package/resources/payouts.js +3 -4
  75. package/resources/payouts.js.map +1 -1
  76. package/resources/payouts.mjs +3 -4
  77. package/resources/payouts.mjs.map +1 -1
  78. package/resources/refunds.d.ts +53 -97
  79. package/resources/refunds.d.ts.map +1 -1
  80. package/resources/refunds.js +8 -12
  81. package/resources/refunds.js.map +1 -1
  82. package/resources/refunds.mjs +8 -12
  83. package/resources/refunds.mjs.map +1 -1
  84. package/resources/returns.d.ts +104 -0
  85. package/resources/returns.d.ts.map +1 -0
  86. package/resources/returns.js +21 -0
  87. package/resources/returns.js.map +1 -0
  88. package/resources/returns.mjs +17 -0
  89. package/resources/returns.mjs.map +1 -0
  90. package/resources/subaccounts.d.ts +15 -5
  91. package/resources/subaccounts.d.ts.map +1 -1
  92. package/resources/subaccounts.js.map +1 -1
  93. package/resources/subaccounts.mjs.map +1 -1
  94. package/resources/transactions.d.ts +174 -0
  95. package/resources/transactions.d.ts.map +1 -0
  96. package/resources/transactions.js +15 -0
  97. package/resources/transactions.js.map +1 -0
  98. package/resources/transactions.mjs +11 -0
  99. package/resources/transactions.mjs.map +1 -0
  100. package/resources.d.ts +2 -0
  101. package/resources.d.ts.map +1 -0
  102. package/resources.js +18 -0
  103. package/resources.js.map +1 -0
  104. package/resources.mjs +2 -0
  105. package/resources.mjs.map +1 -0
  106. package/src/_shims/index.d.ts +2 -0
  107. package/src/_shims/index.js +5 -1
  108. package/src/_shims/index.mjs +5 -1
  109. package/src/core.ts +44 -16
  110. package/src/index.ts +100 -63
  111. package/src/resource.ts +1 -1
  112. package/src/resources/balance.ts +8 -5
  113. package/src/resources/banks.ts +130 -67
  114. package/src/resources/beneficiary-payouts.ts +78 -0
  115. package/src/resources/capabilities.ts +1 -10
  116. package/src/resources/charges.ts +30 -21
  117. package/src/resources/checkoutsession.ts +1224 -3096
  118. package/src/resources/customers.ts +164 -9
  119. package/src/resources/deposits.ts +231 -0
  120. package/src/resources/fx.ts +119 -0
  121. package/src/resources/index.ts +31 -28
  122. package/src/resources/mandates.ts +79 -17
  123. package/src/resources/orders.ts +1448 -1072
  124. package/src/resources/payouts.ts +273 -103
  125. package/src/resources/refunds.ts +70 -111
  126. package/src/resources/returns.ts +140 -0
  127. package/src/resources/subaccounts.ts +26 -4
  128. package/src/resources/transactions.ts +234 -0
  129. package/src/resources.ts +1 -0
  130. package/src/version.ts +1 -1
  131. package/version.d.ts +1 -1
  132. package/version.d.ts.map +1 -1
  133. package/version.js +1 -1
  134. package/version.js.map +1 -1
  135. package/version.mjs +1 -1
  136. package/version.mjs.map +1 -1
  137. package/resources/reports.d.ts +0 -120
  138. package/resources/reports.d.ts.map +0 -1
  139. package/resources/reports.js +0 -31
  140. package/resources/reports.js.map +0 -1
  141. package/resources/reports.mjs +0 -27
  142. package/resources/reports.mjs.map +0 -1
  143. package/resources/webhooksubscription.d.ts +0 -155
  144. package/resources/webhooksubscription.d.ts.map +0 -1
  145. package/resources/webhooksubscription.js +0 -42
  146. package/resources/webhooksubscription.js.map +0 -1
  147. package/resources/webhooksubscription.mjs +0 -38
  148. package/resources/webhooksubscription.mjs.map +0 -1
  149. package/src/resources/reports.ts +0 -172
  150. package/src/resources/webhooksubscription.ts +0 -353
@@ -4,6 +4,17 @@ import { APIResource } from '../resource';
4
4
  import * as Core from '../core';
5
5
 
6
6
  export class Orders extends APIResource {
7
+ /**
8
+ * Create a new order. By creating a new order, you will create a new settlement
9
+ * destination which you can use to settle expected incoming payments efficiently.
10
+ * After creating the order, Ivy provides you with a destination for the expected
11
+ * incoming payment. As soon as a payment with the same details arrives, Ivy will
12
+ * update the status of the order.
13
+ */
14
+ create(body: OrderCreateParams, options?: Core.RequestOptions): Core.APIPromise<OrderCreateResponse> {
15
+ return this._client.post('/api/service/order/create', { body, ...options });
16
+ }
17
+
7
18
  /**
8
19
  * Retrieve details of an order. You can retrieve the order by passing either the
9
20
  * internal Ivy order id or the `referenceId` you specified when creating a
@@ -14,68 +25,58 @@ export class Orders extends APIResource {
14
25
  }
15
26
 
16
27
  /**
17
- * Update certain fields of the specified order.
28
+ * Manually expire an order before its natural expiration time.
18
29
  */
19
- update(body: OrderUpdateParams, options?: Core.RequestOptions): Core.APIPromise<OrderUpdateResponse> {
20
- return this._client.post('/api/service/order/update', { body, ...options });
30
+ expire(body: OrderExpireParams, options?: Core.RequestOptions): Core.APIPromise<OrderExpireResponse> {
31
+ return this._client.post('/api/service/order/expire', { body, ...options });
21
32
  }
22
33
  }
23
34
 
24
- export interface OrderRetrieveResponse {
35
+ export interface OrderCreateResponse {
25
36
  /**
26
- * The Ivy unique identifier for the order.
37
+ * The unique id for the order.
27
38
  */
28
39
  id: string;
29
40
 
30
41
  /**
31
- * @deprecated The unique identifier for the merchantApp which initiated the order
32
- * / payment attempt.
42
+ * The unique id for the merchantApp which initiated the order.
33
43
  */
34
44
  appId: string;
35
45
 
36
46
  /**
37
- * The Ivy fee for the payment.
47
+ * The amount of application fee collected with the order.
38
48
  */
39
49
  applicationFeeAmount: number;
40
50
 
41
- createdAt: string;
51
+ createdAt: unknown;
42
52
 
43
53
  instantPaymentScheme: boolean;
44
54
 
45
55
  /**
46
- * @deprecated Deprecated in favor of `appId`.
56
+ * Same as appId
47
57
  */
48
58
  merchantAppId: string;
49
59
 
50
- /**
51
- * The unique identifier for the merchant which initiated the order / payment
52
- * attempt.
53
- */
54
60
  merchantId: string;
55
61
 
56
62
  /**
57
- * The amount to be paid by the user. The amounts is in decimals, i.e. 10.23
58
- * represents EUR 10.23. Any amount of decimal places can be provided on
59
- * initialization, but the actual transfer amount is rounded to 2 decimal places,
60
- * as this is the format accepted by most banks.
63
+ * The price object. All values in decimals, e.g. 0.13 for 13 cents.
61
64
  */
62
- price: OrderRetrieveResponse.Price;
65
+ price: OrderCreateResponse.Price;
63
66
 
64
67
  /**
65
- * An internal reference id which will be stored with the checkout & corresponding
66
- * order. Needs to be unique per shop per order and can be up to 200 characters.
68
+ * A unique id for the order which can be set when creating the checkoutSession.
67
69
  */
68
70
  referenceId: string;
69
71
 
70
72
  /**
71
- * The name of the merchant which initiated the order.
73
+ * The legal name of the merchant which initiated the order.
72
74
  */
73
75
  shopName: string;
74
76
 
75
77
  /**
76
- * The order status. This status symbolises the state of the user's payment
77
- * attempt. See [the guide](https://docs.getivy.de/docs/payment-status) for more
78
- * information.
78
+ * The status of the order. As soon as this value is 'paid', you can ship the
79
+ * order.
79
80
  */
80
81
  status:
81
82
  | 'failed'
@@ -91,7 +92,7 @@ export interface OrderRetrieveResponse {
91
92
  | 'disputed'
92
93
  | 'refused';
93
94
 
94
- updatedAt: string;
95
+ updatedAt: unknown;
95
96
 
96
97
  /**
97
98
  * The unique identifier of the customer's bank.
@@ -99,30 +100,21 @@ export interface OrderRetrieveResponse {
99
100
  bankId?: string;
100
101
 
101
102
  /**
102
- * The bank statement reference of the payment for the order. This is the reference
103
- * that will be visible on the bank statement.
103
+ * The reference that will be shown on the bank statement of the customer. Only
104
+ * available after a successful DirectDebit initiation.
104
105
  */
105
106
  bankStatementReference?: string;
106
107
 
107
- /**
108
- * The billing address of the user. Required when handshake=true.
109
- */
110
- billingAddress?: OrderRetrieveResponse.BillingAddress;
108
+ billingAddress?: OrderCreateResponse.BillingAddress;
111
109
 
112
110
  /**
113
- * The merchant category code or
114
- * [MCC](https://en.wikipedia.org/wiki/Merchant_category_code).
111
+ * The merchant category code for the account. MCCs are used to classify businesses
112
+ * based on the goods or services they provide.
115
113
  */
116
114
  category?: string;
117
115
 
118
- /**
119
- * @deprecated
120
- */
121
- climateActionMode?: OrderRetrieveResponse.ClimateActionMode;
116
+ climateActionMode?: OrderCreateResponse.ClimateActionMode;
122
117
 
123
- /**
124
- * @deprecated
125
- */
126
118
  co2Grams?: number;
127
119
 
128
120
  /**
@@ -131,73 +123,61 @@ export interface OrderRetrieveResponse {
131
123
  customerId?: string;
132
124
 
133
125
  /**
134
- * The customer facing id. This id is displayed to the user during the checkout and
135
- * in the merchant dashboard.
126
+ * The destination bank account and statement reference for the order.
136
127
  */
137
- displayId?: string;
128
+ destination?: OrderCreateResponse.Destination;
138
129
 
139
130
  /**
140
- * False by default. If set to true, customers skip email input and jump directly
141
- * to their bank login. For express Checkout Sessions this is always false.
131
+ * The customer-facing id of the order.
142
132
  */
143
- guest?: boolean;
133
+ displayId?: string;
144
134
 
145
- /**
146
- * Only valid for sustainable incentive mode. The social / sustainable projects
147
- * available to the user during Checkout.
148
- */
149
- impactOffsetProjects?: Array<string>;
135
+ guest?: boolean;
150
136
 
151
- /**
152
- * The incentive mode of the checkout session. For any use-case apart from
153
- * e-commerce, please use `white_label` as the value. If set to `white_label`, the
154
- * checkout session will be white labeled. If set to `sustainable`, the checkout
155
- * session will contain sustainable incentives for users.
156
- */
157
- incentiveMode?: 'white_label' | 'sustainable';
137
+ impactOffsetProjects?: Array<unknown>;
158
138
 
159
139
  /**
160
- * The line items of the Checkout.
140
+ * The list of line items sold with the order.
161
141
  */
162
- lineItems?: Array<OrderRetrieveResponse.LineItem>;
142
+ lineItems?: Array<OrderCreateResponse.LineItem>;
163
143
 
164
- mandate?: OrderRetrieveResponse.Mandate;
144
+ mandate?: OrderCreateResponse.Mandate;
165
145
 
166
146
  /**
167
- * The destination bank account where the money will be sent to.
147
+ * The financial address of the merchant associated with the order. Only available
148
+ * when requested via order/details and therefore requires authentication.
168
149
  */
169
- merchantFinancialAddress?: OrderRetrieveResponse.MerchantFinancialAddress;
150
+ merchantFinancialAddress?: OrderCreateResponse.MerchantFinancialAddress;
170
151
 
171
152
  /**
172
- * Any data which will be stored and returned for this checkout session and
173
- * corresponding order. See [here](https://docs.getivy.de/reference/metadata) for
174
- * more info.
153
+ * Set of key-value pairs that you can attach to an object. This can be useful for
154
+ * storing additional information about the object in a structured format.
175
155
  */
176
- metadata?: Record<string, unknown>;
156
+ metadata?: { [key: string]: unknown };
177
157
 
178
158
  /**
179
- * Only valid for sustainable incentive mode. The social / sustainability project
180
- * chosen by the user during Checkout.
159
+ * The project related to the order.
181
160
  */
182
161
  offsetProject?: string;
183
162
 
184
163
  /**
185
- * The source bank account where the money is send from.
164
+ * The financial address of the payer associated with the order. Only available
165
+ * after successful PIS flow.
186
166
  */
187
- payerFinancialAddress?: OrderRetrieveResponse.PayerFinancialAddress;
167
+ payerFinancialAddress?: OrderCreateResponse.PayerFinancialAddress;
188
168
 
189
- paymentMethodType?: 'sepa_debit' | 'customer_balance';
169
+ paymentMethodType?: 'sepa_debit' | 'customer_balance' | 'manual_bank_transfer';
190
170
 
191
171
  /**
192
- * The payment mode of the order. Can be either 'settlement' or 'direct'.
172
+ * The payment mode of the order. Can be either settlement or direct.
193
173
  */
194
- paymentMode?: 'settlement' | 'direct';
174
+ paymentMode?: 'direct' | 'settlement';
195
175
 
196
176
  /**
197
- * @deprecated Deprecated in favor of `status`. Do not use this field to trigger
198
- * actions in your system.
177
+ * Deprecated. The status of the payment.
199
178
  */
200
179
  paymentStatus?:
180
+ | 'not_settled'
201
181
  | 'failed'
202
182
  | 'canceled'
203
183
  | 'processing'
@@ -207,7 +187,6 @@ export interface OrderRetrieveResponse {
207
187
  | 'refunded'
208
188
  | 'refund_failed'
209
189
  | 'partially_refunded'
210
- | 'not_settled'
211
190
  | 'disputed';
212
191
 
213
192
  /**
@@ -216,75 +195,51 @@ export interface OrderRetrieveResponse {
216
195
  refundAmount?: number;
217
196
 
218
197
  /**
219
- * The list of refunds connected to this order.
198
+ * All partial and total refunds of this order.
220
199
  */
221
- refunds?: Array<OrderRetrieveResponse.Refund>;
200
+ refunds?: Array<OrderCreateResponse.Refund>;
222
201
 
223
202
  /**
224
- * The shipping address of the user. This is only collected in express Checkouts.
203
+ * If set to true, a payment mandate will be created for the user. This is
204
+ * currently in alpha and defaults to false.
225
205
  */
226
- shippingAddress?: OrderRetrieveResponse.ShippingAddress;
206
+ setupPaymentMandate?: boolean;
227
207
 
228
- /**
229
- * The selected shipping method by the user. Can either be selected during an
230
- * express Checkout Session or passed during Checkout Session creation.
231
- */
232
- shippingMethod?: OrderRetrieveResponse.ShippingMethod;
208
+ shippingAddress?: OrderCreateResponse.ShippingAddress;
233
209
 
234
- /**
235
- * The logo of the shop provided as a URL.
236
- */
237
210
  shopLogo?: string;
238
211
 
239
212
  /**
240
- * The shopper object. Contains information collected from the user during the
241
- * Checkout.
213
+ * Information about the customer who finished the order.
242
214
  */
243
- shopper?: OrderRetrieveResponse.Shopper;
215
+ shopper?: OrderCreateResponse.Shopper;
244
216
 
245
217
  /**
246
- * @deprecated Deprecated in favor of `shopper.email`. The email of the user if
247
- * collected in the Checkout.
218
+ * Deprecated. The email of the customer who completed the order.
248
219
  */
249
220
  shopperEmail?: string;
250
221
 
251
- statusClassification?: OrderRetrieveResponse.StatusClassification;
222
+ statusClassification?: OrderCreateResponse.StatusClassification;
252
223
 
253
- /**
254
- * List of status history items for the order, used for logging every update on
255
- * status.
256
- */
257
- statusHistoryList?: Array<OrderRetrieveResponse.StatusHistoryList>;
224
+ statusHistoryList?: Array<OrderCreateResponse.StatusHistoryList>;
258
225
 
259
226
  /**
260
- * The subaccount id of the order.
227
+ * The subaccount id of the merchant.
261
228
  */
262
229
  subaccountId?: string;
263
230
 
264
- /**
265
- * The legal name of the subaccount
266
- */
267
231
  subaccountLegalName?: string;
268
232
 
269
- /**
270
- * @deprecated
271
- */
272
233
  trees?: number;
273
234
  }
274
235
 
275
- export namespace OrderRetrieveResponse {
236
+ export namespace OrderCreateResponse {
276
237
  /**
277
- * The amount to be paid by the user. The amounts is in decimals, i.e. 10.23
278
- * represents EUR 10.23. Any amount of decimal places can be provided on
279
- * initialization, but the actual transfer amount is rounded to 2 decimal places,
280
- * as this is the format accepted by most banks.
238
+ * The price object. All values in decimals, e.g. 0.13 for 13 cents.
281
239
  */
282
240
  export interface Price {
283
- currency: 'EUR' | 'GBP' | 'PLN';
241
+ currency: 'EUR' | 'GBP' | 'PLN' | 'SEK' | 'DKK';
284
242
 
285
- /**
286
- * The total amount to be paid.
287
- */
288
243
  total: number;
289
244
 
290
245
  shipping?: number;
@@ -296,16 +251,9 @@ export namespace OrderRetrieveResponse {
296
251
  vat?: number;
297
252
  }
298
253
 
299
- /**
300
- * The billing address of the user. Required when handshake=true.
301
- */
302
254
  export interface BillingAddress {
303
255
  city: string;
304
256
 
305
- /**
306
- * The country code in
307
- * [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.
308
- */
309
257
  country:
310
258
  | 'AF'
311
259
  | 'AL'
@@ -558,131 +506,160 @@ export namespace OrderRetrieveResponse {
558
506
  | 'SS'
559
507
  | 'XK';
560
508
 
561
- line1: string;
509
+ firstName: string;
562
510
 
563
- zipCode: string;
511
+ lastName: string;
564
512
 
565
- firstName?: string;
513
+ line1: string;
566
514
 
567
- lastName?: string;
515
+ line2: string;
568
516
 
569
- line2?: string;
517
+ region: string;
570
518
 
571
- region?: string;
519
+ zipCode: string;
572
520
  }
573
521
 
574
- /**
575
- * @deprecated
576
- */
577
522
  export interface ClimateActionMode {
578
523
  amount: number;
579
524
 
580
525
  type: 'transaction' | 'amount';
581
526
  }
582
527
 
583
- export interface LineItem {
584
- /**
585
- * The total amount of all line items, i.e. single amount \* quantity. Given in
586
- * decimals, i.e. 10.23 represents EUR 10.23.
587
- */
588
- amount: number;
528
+ /**
529
+ * The destination bank account and statement reference for the order.
530
+ */
531
+ export interface Destination {
532
+ bankAccount: Destination.BankAccount;
589
533
 
590
534
  /**
591
- * The name of the line item.
535
+ * The bank statement reference of the payment for the order. This is the reference
536
+ * that will be visible on the bank statement.
592
537
  */
593
- name: string;
538
+ bankStatementReference: string;
539
+ }
540
+
541
+ export namespace Destination {
542
+ export interface BankAccount {
543
+ type: 'iban' | 'sort_code' | 'bank_code' | 'bban';
544
+
545
+ bankCode?: BankAccount.BankCode;
546
+
547
+ bban?: BankAccount.Bban;
548
+
549
+ iban?: BankAccount.Iban;
550
+
551
+ paymentReference?: string;
552
+
553
+ sortCode?: BankAccount.SortCode;
554
+ }
555
+
556
+ export namespace BankAccount {
557
+ export interface BankCode {
558
+ accountHolderName: string;
559
+
560
+ accountNumber: string;
561
+
562
+ code: string;
563
+ }
564
+
565
+ export interface Bban {
566
+ accountHolderName: string;
567
+
568
+ bban: string;
569
+
570
+ bic?: string;
571
+ }
594
572
 
573
+ export interface Iban {
574
+ accountHolderName: string;
575
+
576
+ iban: string;
577
+
578
+ bic?: string;
579
+ }
580
+
581
+ export interface SortCode {
582
+ accountHolderName: string;
583
+
584
+ accountNumber: string;
585
+
586
+ sortCode: string;
587
+ }
588
+ }
589
+ }
590
+
591
+ export interface LineItem {
595
592
  /**
596
- * The quantity of the line item.
593
+ * Accumulated cost in decimals. For example, for a lineItem with total price 3.00
594
+ * and quantity 4, amount would be equal to 12.00.
597
595
  */
598
- quantity: number;
596
+ amount: number;
599
597
 
600
598
  /**
601
- * The net amount of a single item.
599
+ * Customer-facing name of the line item.
602
600
  */
601
+ name: string;
602
+
603
603
  singleNet: number;
604
604
 
605
- /**
606
- * The VAT amount of a single item.
607
- */
608
605
  singleVat: number;
609
606
 
610
- /**
611
- * The category as [MCC](https://en.wikipedia.org/wiki/Merchant_category_code) of
612
- * the line item.
613
- */
614
- category?: string;
607
+ category?:
608
+ | '5045'
609
+ | '5065'
610
+ | '5094'
611
+ | '5192'
612
+ | '5193'
613
+ | '5499'
614
+ | '5655'
615
+ | '5691'
616
+ | '5712'
617
+ | '5722'
618
+ | '5812'
619
+ | '5814'
620
+ | '5912'
621
+ | '5977'
622
+ | '5999'
623
+ | '7629';
624
+
625
+ co2Grams?: number;
615
626
 
616
- /**
617
- * The
618
- * [EAN](https://en.wikipedia.org/wiki/International_Article_Number#:~:text=The%20International%20Article%20Number%20(also,configuration%2C%20from%20a%20specific%20manufacturer.)
619
- * of the line item.
620
- */
621
627
  EAN?: string;
622
628
 
623
629
  /**
624
- * The image of the line item as a URL.
630
+ * An image of the line item. Valid URLs are accepted only.
625
631
  */
626
632
  image?: string;
627
633
 
628
634
  /**
629
- * The internal unique identifier of the line item.
635
+ * Quantity of this lineItem.
636
+ */
637
+ quantity?: number;
638
+
639
+ /**
640
+ * An internal unique id stored to this line item.
630
641
  */
631
642
  referenceId?: string;
632
643
  }
633
644
 
634
645
  export interface Mandate {
635
- /**
636
- * The name of the account holder who signs the mandate.
637
- */
638
- accountHolderName?: string;
646
+ accountHolderName: string;
639
647
 
640
- /**
641
- * Additional information to display to the user during the mandate setup. This
642
- * information is not used to setup any recurrence on the mandate. It is only
643
- * displayed to the user during checkout.
644
- */
645
648
  additionalDisplayInformation?: Mandate.AdditionalDisplayInformation;
646
649
 
647
- /**
648
- * Mandate creditor data
649
- */
650
650
  creditor?: Mandate.Creditor;
651
651
 
652
- /**
653
- * The reference of the mandate going to be setup
654
- */
655
652
  reference?: string;
656
653
 
657
- /**
658
- * The mandate referenceId. Set this to match incoming `mandate_setup_started`,
659
- * `mandate_setup_succeeded` or `mandate_setup_failed` webhook events to your
660
- * mandate setup request.
661
- */
662
654
  referenceId?: string;
663
655
 
664
- /**
665
- * If true, a ready to use mandate will be set up after the payment flow.
666
- */
667
656
  setup?: boolean;
668
657
 
669
- /**
670
- * The email of the user who signs the mandate.
671
- */
672
658
  userNotificationEmail?: string;
673
659
  }
674
660
 
675
661
  export namespace Mandate {
676
- /**
677
- * Additional information to display to the user during the mandate setup. This
678
- * information is not used to setup any recurrence on the mandate. It is only
679
- * displayed to the user during checkout.
680
- */
681
662
  export interface AdditionalDisplayInformation {
682
- /**
683
- * The intended cadence of charges used for displaying purpose only. On demand
684
- * would be used for unscheduled charges.
685
- */
686
663
  cadence?: 'BI_WEEKLY' | 'WEEKLY' | 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'ON_DEMAND';
687
664
 
688
665
  price?: AdditionalDisplayInformation.Price;
@@ -690,19 +667,12 @@ export namespace OrderRetrieveResponse {
690
667
 
691
668
  export namespace AdditionalDisplayInformation {
692
669
  export interface Price {
693
- /**
694
- * The amount displayed to the user as decimal e.g. 10.23 would be displayed as
695
- * 10.23 EUR.
696
- */
697
- amount?: number;
670
+ amount: number;
698
671
 
699
- currency?: 'EUR' | 'GBP' | 'PLN';
672
+ currency: 'EUR' | 'GBP' | 'PLN' | 'SEK' | 'DKK';
700
673
  }
701
674
  }
702
675
 
703
- /**
704
- * Mandate creditor data
705
- */
706
676
  export interface Creditor {
707
677
  id?: string;
708
678
 
@@ -711,42 +681,25 @@ export namespace OrderRetrieveResponse {
711
681
  }
712
682
 
713
683
  /**
714
- * The destination bank account where the money will be sent to.
684
+ * The financial address of the merchant associated with the order. Only available
685
+ * when requested via order/details and therefore requires authentication.
715
686
  */
716
687
  export interface MerchantFinancialAddress {
688
+ type: 'iban' | 'sort_code' | 'bank_code' | 'bban';
689
+
717
690
  bankCode?: MerchantFinancialAddress.BankCode;
718
691
 
719
692
  bban?: MerchantFinancialAddress.Bban;
720
693
 
721
694
  iban?: MerchantFinancialAddress.Iban;
722
695
 
723
- /**
724
- * The payment reference for the order. This is the reference that will be visible
725
- * on the bank statement.
726
- */
727
696
  paymentReference?: string;
728
697
 
729
698
  sortCode?: MerchantFinancialAddress.SortCode;
730
-
731
- /**
732
- * The type of the financial address. The actual destination is determined by this
733
- * field which can be either "iban", "sortCode", "bankCode", or "bban". The
734
- * validation will fail if you set e.g. type="iban", but then not fill any values
735
- * in the "iban" object.
736
- *
737
- * - iban: The IBAN of the account
738
- * - sort_code: The sort code of the account
739
- * - bank_code: The bank code of the account
740
- * - bban: The BBAN of the account
741
- */
742
- type?: string;
743
699
  }
744
700
 
745
701
  export namespace MerchantFinancialAddress {
746
702
  export interface BankCode {
747
- /**
748
- * The name of the account holder.
749
- */
750
703
  accountHolderName: string;
751
704
 
752
705
  accountNumber: string;
@@ -755,9 +708,6 @@ export namespace OrderRetrieveResponse {
755
708
  }
756
709
 
757
710
  export interface Bban {
758
- /**
759
- * The name of the account holder.
760
- */
761
711
  accountHolderName: string;
762
712
 
763
713
  bban: string;
@@ -766,9 +716,6 @@ export namespace OrderRetrieveResponse {
766
716
  }
767
717
 
768
718
  export interface Iban {
769
- /**
770
- * The name of the account holder.
771
- */
772
719
  accountHolderName: string;
773
720
 
774
721
  iban: string;
@@ -777,9 +724,6 @@ export namespace OrderRetrieveResponse {
777
724
  }
778
725
 
779
726
  export interface SortCode {
780
- /**
781
- * The name of the account holder.
782
- */
783
727
  accountHolderName: string;
784
728
 
785
729
  accountNumber: string;
@@ -789,21 +733,11 @@ export namespace OrderRetrieveResponse {
789
733
  }
790
734
 
791
735
  /**
792
- * The source bank account where the money is send from.
736
+ * The financial address of the payer associated with the order. Only available
737
+ * after successful PIS flow.
793
738
  */
794
739
  export interface PayerFinancialAddress {
795
- /**
796
- * The type of the financial address. The actual destination is determined by this
797
- * field which can be either "iban", "sortCode", "bankCode", or "bban". The
798
- * validation will fail if you set e.g. type="iban", but then not fill any values
799
- * in the "iban" object.
800
- *
801
- * - iban: The IBAN of the account
802
- * - sort_code: The sort code of the account
803
- * - bank_code: The bank code of the account
804
- * - bban: The BBAN of the account
805
- */
806
- type: string;
740
+ type: 'iban' | 'sort_code' | 'bank_code' | 'bban';
807
741
 
808
742
  bankCode?: PayerFinancialAddress.BankCode;
809
743
 
@@ -820,18 +754,12 @@ export namespace OrderRetrieveResponse {
820
754
 
821
755
  code: string;
822
756
 
823
- /**
824
- * The name of the account holder.
825
- */
826
757
  accountHolderName?: string;
827
758
  }
828
759
 
829
760
  export interface Bban {
830
761
  bban: string;
831
762
 
832
- /**
833
- * The name of the account holder.
834
- */
835
763
  accountHolderName?: string;
836
764
 
837
765
  bic?: string;
@@ -840,9 +768,6 @@ export namespace OrderRetrieveResponse {
840
768
  export interface Iban {
841
769
  iban: string;
842
770
 
843
- /**
844
- * The name of the account holder.
845
- */
846
771
  accountHolderName?: string;
847
772
 
848
773
  bic?: string;
@@ -853,46 +778,45 @@ export namespace OrderRetrieveResponse {
853
778
 
854
779
  sortCode: string;
855
780
 
856
- /**
857
- * The name of the account holder.
858
- */
859
781
  accountHolderName?: string;
860
782
  }
861
783
  }
862
784
 
863
- /**
864
- * A Refund object. This corresponds to one Refund request.
865
- */
866
785
  export interface Refund {
786
+ /**
787
+ * The unique id of this refund request.
788
+ */
867
789
  id: string;
868
790
 
791
+ /**
792
+ * The amount of the refund in decimals.
793
+ */
869
794
  amount: number;
870
795
 
871
- createdAt: string;
796
+ createdAt: unknown;
872
797
 
798
+ /**
799
+ * The unique id of this refund request. This can be set when requesting the
800
+ * refund.
801
+ */
873
802
  referenceId: string;
874
803
 
875
804
  /**
876
- * The status of the refund. Always use the status of the order as your source of
877
- * truth to trigger actions in your dashboard.
805
+ * The current status of this refund.
878
806
  */
879
807
  status: 'pending' | 'succeeded' | 'failed' | 'requires_action' | 'partially_refunded';
880
808
 
881
- updatedAt: string;
809
+ updatedAt: unknown;
882
810
 
811
+ /**
812
+ * The description of the refund.
813
+ */
883
814
  description?: string;
884
815
  }
885
816
 
886
- /**
887
- * The shipping address of the user. This is only collected in express Checkouts.
888
- */
889
817
  export interface ShippingAddress {
890
818
  city: string;
891
819
 
892
- /**
893
- * The country code in
894
- * [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.
895
- */
896
820
  country:
897
821
  | 'AF'
898
822
  | 'AL'
@@ -1145,93 +1069,389 @@ export namespace OrderRetrieveResponse {
1145
1069
  | 'SS'
1146
1070
  | 'XK';
1147
1071
 
1072
+ firstName: string;
1073
+
1074
+ lastName: string;
1075
+
1148
1076
  line1: string;
1149
1077
 
1078
+ line2: string;
1079
+
1080
+ region: string;
1081
+
1150
1082
  zipCode: string;
1083
+ }
1084
+
1085
+ /**
1086
+ * Information about the customer who finished the order.
1087
+ */
1088
+ export interface Shopper {
1089
+ email?: string;
1090
+
1091
+ phoneNumber?: string;
1092
+ }
1151
1093
 
1152
- firstName?: string;
1094
+ export interface StatusClassification {
1095
+ primary: 'payment_authorisation_failed' | 'payment_execution_failed' | 'payment_abandoned';
1096
+
1097
+ secondary?:
1098
+ | 'timeout'
1099
+ | 'wrong_credentials'
1100
+ | 'incorrect_2fa_response'
1101
+ | 'payment_rejected'
1102
+ | 'insufficient_funds'
1103
+ | 'cancelled'
1104
+ | 'connection_to_bank_failed'
1105
+ | 'international_transfer_blocked'
1106
+ | 'international_transfer_limit_exceeded'
1107
+ | 'user_blocked'
1108
+ | 'bank_error'
1109
+ | 'instant_transfers_not_enabled'
1110
+ | 'no_active_tan_methods_available'
1111
+ | 'account_limit_exceeded'
1112
+ | 'bank_under_maintenance'
1113
+ | 'pin_blocked'
1114
+ | 'payment_not_settled'
1115
+ | 'unsupported_bank_account';
1116
+ }
1117
+
1118
+ export interface StatusHistoryList {
1119
+ createdAt: unknown;
1153
1120
 
1154
- lastName?: string;
1121
+ currentStatus:
1122
+ | 'failed'
1123
+ | 'canceled'
1124
+ | 'processing'
1125
+ | 'waiting_for_payment'
1126
+ | 'paid'
1127
+ | 'in_refund'
1128
+ | 'refunded'
1129
+ | 'refund_failed'
1130
+ | 'partially_refunded'
1131
+ | 'in_dispute'
1132
+ | 'disputed'
1133
+ | 'refused';
1155
1134
 
1156
- line2?: string;
1135
+ reason:
1136
+ | 'ORDER_CREATED'
1137
+ | 'CHECKOUT_SESSION_ABORTED'
1138
+ | 'PAYMENT_SUCCEEDED'
1139
+ | 'PAYMENT_INITIATED'
1140
+ | 'ORDER_CANCELED'
1141
+ | 'ORDER_EXPIRED_BY_MERCHANT'
1142
+ | 'ORDER_REFUND_INITIATED'
1143
+ | 'ORDER_REFUNDED'
1144
+ | 'REFUND_CHARGE_SUCCEEDED'
1145
+ | 'REFUND_UPDATED'
1146
+ | 'CHECKOUT_COMPLETED'
1147
+ | 'PIS_PAYMENT_INITIATED'
1148
+ | 'PIS_PAYMENT_UPDATED'
1149
+ | 'PIS_PAYMENT_SUCCEEDED'
1150
+ | 'PAYMENT_NOT_SETTLED'
1151
+ | 'PAYMENT_INITIATION_FAILED'
1152
+ | 'PAYMENT_CANCELED'
1153
+ | 'PAYMENT_FAILED'
1154
+ | 'CHECKOUT_SESSION_CREATED'
1155
+ | 'EXPIRED_CHECKOUT_SESSION_ABORTED'
1156
+ | 'DISPUTE'
1157
+ | 'PENDING_PAYMENT_ATTEMPTS_FOUND'
1158
+ | 'AML_FREEZE'
1159
+ | 'MANUAL_FREEZE'
1160
+ | 'MANUAL_UNFREEZE'
1161
+ | 'ORDER_MANUALLY_REOPENED';
1162
+
1163
+ updatedAt: unknown;
1157
1164
 
1158
- region?: string;
1165
+ previousStatus?:
1166
+ | 'failed'
1167
+ | 'canceled'
1168
+ | 'processing'
1169
+ | 'waiting_for_payment'
1170
+ | 'paid'
1171
+ | 'in_refund'
1172
+ | 'refunded'
1173
+ | 'refund_failed'
1174
+ | 'partially_refunded'
1175
+ | 'in_dispute'
1176
+ | 'disputed'
1177
+ | 'refused'
1178
+ | null;
1159
1179
  }
1180
+ }
1160
1181
 
1182
+ export interface OrderRetrieveResponse {
1161
1183
  /**
1162
- * The selected shipping method by the user. Can either be selected during an
1163
- * express Checkout Session or passed during Checkout Session creation.
1184
+ * The unique id for the order.
1164
1185
  */
1165
- export interface ShippingMethod {
1166
- /**
1167
- * The customer-facing name of the shipping method.
1168
- */
1169
- name: string;
1186
+ id: string;
1170
1187
 
1171
- /**
1172
- * The price of the shipping method in decimals, i.e. 10.23 represents EUR 10.23.
1173
- */
1174
- price: number;
1188
+ /**
1189
+ * The unique id for the merchantApp which initiated the order.
1190
+ */
1191
+ appId: string;
1175
1192
 
1176
- /**
1177
- * The unique identifier of the shipping method within Ivy.
1178
- */
1179
- id?: string;
1193
+ /**
1194
+ * The amount of application fee collected with the order.
1195
+ */
1196
+ applicationFeeAmount: number;
1180
1197
 
1181
- /**
1182
- * The list of countries where the shipping method is available.
1183
- */
1184
- countries?: Array<
1185
- | 'AF'
1186
- | 'AL'
1187
- | 'DZ'
1188
- | 'AS'
1189
- | 'AD'
1190
- | 'AO'
1191
- | 'AI'
1192
- | 'AQ'
1193
- | 'AG'
1194
- | 'AR'
1195
- | 'AM'
1196
- | 'AW'
1197
- | 'AU'
1198
- | 'AT'
1199
- | 'AZ'
1200
- | 'BS'
1201
- | 'BH'
1202
- | 'BD'
1203
- | 'BB'
1204
- | 'BY'
1205
- | 'BE'
1206
- | 'BZ'
1207
- | 'BJ'
1208
- | 'BM'
1209
- | 'BT'
1210
- | 'BO'
1211
- | 'BA'
1212
- | 'BW'
1213
- | 'BV'
1214
- | 'BR'
1215
- | 'IO'
1216
- | 'BN'
1217
- | 'BG'
1218
- | 'BF'
1219
- | 'BI'
1220
- | 'KH'
1221
- | 'CM'
1222
- | 'CA'
1223
- | 'CV'
1224
- | 'KY'
1225
- | 'CF'
1226
- | 'TD'
1227
- | 'CL'
1228
- | 'CN'
1229
- | 'CX'
1230
- | 'CC'
1231
- | 'CO'
1232
- | 'KM'
1233
- | 'CG'
1234
- | 'CD'
1198
+ createdAt: unknown;
1199
+
1200
+ instantPaymentScheme: boolean;
1201
+
1202
+ /**
1203
+ * Same as appId
1204
+ */
1205
+ merchantAppId: string;
1206
+
1207
+ merchantId: string;
1208
+
1209
+ /**
1210
+ * The price object. All values in decimals, e.g. 0.13 for 13 cents.
1211
+ */
1212
+ price: OrderRetrieveResponse.Price;
1213
+
1214
+ /**
1215
+ * A unique id for the order which can be set when creating the checkoutSession.
1216
+ */
1217
+ referenceId: string;
1218
+
1219
+ /**
1220
+ * The legal name of the merchant which initiated the order.
1221
+ */
1222
+ shopName: string;
1223
+
1224
+ /**
1225
+ * The status of the order. As soon as this value is 'paid', you can ship the
1226
+ * order.
1227
+ */
1228
+ status:
1229
+ | 'failed'
1230
+ | 'canceled'
1231
+ | 'processing'
1232
+ | 'waiting_for_payment'
1233
+ | 'paid'
1234
+ | 'in_refund'
1235
+ | 'refunded'
1236
+ | 'refund_failed'
1237
+ | 'partially_refunded'
1238
+ | 'in_dispute'
1239
+ | 'disputed'
1240
+ | 'refused';
1241
+
1242
+ updatedAt: unknown;
1243
+
1244
+ /**
1245
+ * The unique identifier of the customer's bank.
1246
+ */
1247
+ bankId?: string;
1248
+
1249
+ /**
1250
+ * The reference that will be shown on the bank statement of the customer. Only
1251
+ * available after a successful DirectDebit initiation.
1252
+ */
1253
+ bankStatementReference?: string;
1254
+
1255
+ billingAddress?: OrderRetrieveResponse.BillingAddress;
1256
+
1257
+ /**
1258
+ * The merchant category code for the account. MCCs are used to classify businesses
1259
+ * based on the goods or services they provide.
1260
+ */
1261
+ category?: string;
1262
+
1263
+ climateActionMode?: OrderRetrieveResponse.ClimateActionMode;
1264
+
1265
+ co2Grams?: number;
1266
+
1267
+ /**
1268
+ * The unique identifier of the customer who placed the order.
1269
+ */
1270
+ customerId?: string;
1271
+
1272
+ /**
1273
+ * The destination bank account and statement reference for the order.
1274
+ */
1275
+ destination?: OrderRetrieveResponse.Destination;
1276
+
1277
+ /**
1278
+ * The customer-facing id of the order.
1279
+ */
1280
+ displayId?: string;
1281
+
1282
+ guest?: boolean;
1283
+
1284
+ impactOffsetProjects?: Array<unknown>;
1285
+
1286
+ /**
1287
+ * The list of line items sold with the order.
1288
+ */
1289
+ lineItems?: Array<OrderRetrieveResponse.LineItem>;
1290
+
1291
+ mandate?: OrderRetrieveResponse.Mandate;
1292
+
1293
+ /**
1294
+ * The financial address of the merchant associated with the order. Only available
1295
+ * when requested via order/details and therefore requires authentication.
1296
+ */
1297
+ merchantFinancialAddress?: OrderRetrieveResponse.MerchantFinancialAddress;
1298
+
1299
+ /**
1300
+ * Set of key-value pairs that you can attach to an object. This can be useful for
1301
+ * storing additional information about the object in a structured format.
1302
+ */
1303
+ metadata?: { [key: string]: unknown };
1304
+
1305
+ /**
1306
+ * The project related to the order.
1307
+ */
1308
+ offsetProject?: string;
1309
+
1310
+ /**
1311
+ * The financial address of the payer associated with the order. Only available
1312
+ * after successful PIS flow.
1313
+ */
1314
+ payerFinancialAddress?: OrderRetrieveResponse.PayerFinancialAddress;
1315
+
1316
+ paymentMethodType?: 'sepa_debit' | 'customer_balance' | 'manual_bank_transfer';
1317
+
1318
+ /**
1319
+ * The payment mode of the order. Can be either settlement or direct.
1320
+ */
1321
+ paymentMode?: 'direct' | 'settlement';
1322
+
1323
+ /**
1324
+ * Deprecated. The status of the payment.
1325
+ */
1326
+ paymentStatus?:
1327
+ | 'not_settled'
1328
+ | 'failed'
1329
+ | 'canceled'
1330
+ | 'processing'
1331
+ | 'requires_action'
1332
+ | 'succeeded'
1333
+ | 'in_refund'
1334
+ | 'refunded'
1335
+ | 'refund_failed'
1336
+ | 'partially_refunded'
1337
+ | 'disputed';
1338
+
1339
+ /**
1340
+ * The total amount in the currency of all successful refunds for this order
1341
+ */
1342
+ refundAmount?: number;
1343
+
1344
+ /**
1345
+ * All partial and total refunds of this order.
1346
+ */
1347
+ refunds?: Array<OrderRetrieveResponse.Refund>;
1348
+
1349
+ /**
1350
+ * If set to true, a payment mandate will be created for the user. This is
1351
+ * currently in alpha and defaults to false.
1352
+ */
1353
+ setupPaymentMandate?: boolean;
1354
+
1355
+ shippingAddress?: OrderRetrieveResponse.ShippingAddress;
1356
+
1357
+ shopLogo?: string;
1358
+
1359
+ /**
1360
+ * Information about the customer who finished the order.
1361
+ */
1362
+ shopper?: OrderRetrieveResponse.Shopper;
1363
+
1364
+ /**
1365
+ * Deprecated. The email of the customer who completed the order.
1366
+ */
1367
+ shopperEmail?: string;
1368
+
1369
+ statusClassification?: OrderRetrieveResponse.StatusClassification;
1370
+
1371
+ statusHistoryList?: Array<OrderRetrieveResponse.StatusHistoryList>;
1372
+
1373
+ /**
1374
+ * The subaccount id of the merchant.
1375
+ */
1376
+ subaccountId?: string;
1377
+
1378
+ subaccountLegalName?: string;
1379
+
1380
+ trees?: number;
1381
+ }
1382
+
1383
+ export namespace OrderRetrieveResponse {
1384
+ /**
1385
+ * The price object. All values in decimals, e.g. 0.13 for 13 cents.
1386
+ */
1387
+ export interface Price {
1388
+ currency: 'EUR' | 'GBP' | 'PLN' | 'SEK' | 'DKK';
1389
+
1390
+ total: number;
1391
+
1392
+ shipping?: number;
1393
+
1394
+ subTotal?: number;
1395
+
1396
+ totalNet?: number;
1397
+
1398
+ vat?: number;
1399
+ }
1400
+
1401
+ export interface BillingAddress {
1402
+ city: string;
1403
+
1404
+ country:
1405
+ | 'AF'
1406
+ | 'AL'
1407
+ | 'DZ'
1408
+ | 'AS'
1409
+ | 'AD'
1410
+ | 'AO'
1411
+ | 'AI'
1412
+ | 'AQ'
1413
+ | 'AG'
1414
+ | 'AR'
1415
+ | 'AM'
1416
+ | 'AW'
1417
+ | 'AU'
1418
+ | 'AT'
1419
+ | 'AZ'
1420
+ | 'BS'
1421
+ | 'BH'
1422
+ | 'BD'
1423
+ | 'BB'
1424
+ | 'BY'
1425
+ | 'BE'
1426
+ | 'BZ'
1427
+ | 'BJ'
1428
+ | 'BM'
1429
+ | 'BT'
1430
+ | 'BO'
1431
+ | 'BA'
1432
+ | 'BW'
1433
+ | 'BV'
1434
+ | 'BR'
1435
+ | 'IO'
1436
+ | 'BN'
1437
+ | 'BG'
1438
+ | 'BF'
1439
+ | 'BI'
1440
+ | 'KH'
1441
+ | 'CM'
1442
+ | 'CA'
1443
+ | 'CV'
1444
+ | 'KY'
1445
+ | 'CF'
1446
+ | 'TD'
1447
+ | 'CL'
1448
+ | 'CN'
1449
+ | 'CX'
1450
+ | 'CC'
1451
+ | 'CO'
1452
+ | 'KM'
1453
+ | 'CG'
1454
+ | 'CD'
1235
1455
  | 'CK'
1236
1456
  | 'CR'
1237
1457
  | 'CI'
@@ -1431,429 +1651,319 @@ export namespace OrderRetrieveResponse {
1431
1651
  | 'RS'
1432
1652
  | 'SX'
1433
1653
  | 'SS'
1434
- | 'XK'
1435
- >;
1654
+ | 'XK';
1436
1655
 
1437
- /**
1438
- * The delivery estimate of the shipping method.
1439
- */
1440
- deliveryEstimate?: ShippingMethod.DeliveryEstimate;
1656
+ firstName: string;
1441
1657
 
1442
- /**
1443
- * The unique identifier within your system of the shipping method.
1444
- */
1445
- reference?: string;
1658
+ lastName: string;
1446
1659
 
1447
- /**
1448
- * @deprecated Deprecated in favor of deliveryEstimate
1449
- */
1450
- timeFrame?: string;
1660
+ line1: string;
1661
+
1662
+ line2: string;
1663
+
1664
+ region: string;
1665
+
1666
+ zipCode: string;
1451
1667
  }
1452
1668
 
1453
- export namespace ShippingMethod {
1669
+ export interface ClimateActionMode {
1670
+ amount: number;
1671
+
1672
+ type: 'transaction' | 'amount';
1673
+ }
1674
+
1675
+ /**
1676
+ * The destination bank account and statement reference for the order.
1677
+ */
1678
+ export interface Destination {
1679
+ bankAccount: Destination.BankAccount;
1680
+
1454
1681
  /**
1455
- * The delivery estimate of the shipping method.
1682
+ * The bank statement reference of the payment for the order. This is the reference
1683
+ * that will be visible on the bank statement.
1456
1684
  */
1457
- export interface DeliveryEstimate {
1458
- /**
1459
- * The maximum delivery time.
1460
- */
1461
- maximum?: DeliveryEstimate.Maximum;
1462
-
1463
- /**
1464
- * The minimum delivery time.
1465
- */
1466
- minimum?: DeliveryEstimate.Minimum;
1685
+ bankStatementReference: string;
1686
+ }
1687
+
1688
+ export namespace Destination {
1689
+ export interface BankAccount {
1690
+ type: 'iban' | 'sort_code' | 'bank_code' | 'bban';
1691
+
1692
+ bankCode?: BankAccount.BankCode;
1693
+
1694
+ bban?: BankAccount.Bban;
1695
+
1696
+ iban?: BankAccount.Iban;
1697
+
1698
+ paymentReference?: string;
1699
+
1700
+ sortCode?: BankAccount.SortCode;
1467
1701
  }
1468
1702
 
1469
- export namespace DeliveryEstimate {
1470
- /**
1471
- * The maximum delivery time.
1472
- */
1473
- export interface Maximum {
1474
- /**
1475
- * The unit of the time duration.
1476
- */
1477
- unit: 'hour' | 'day' | 'business_day' | 'week' | 'month';
1478
-
1479
- /**
1480
- * The value of the time duration.
1481
- */
1482
- value: number;
1703
+ export namespace BankAccount {
1704
+ export interface BankCode {
1705
+ accountHolderName: string;
1706
+
1707
+ accountNumber: string;
1708
+
1709
+ code: string;
1483
1710
  }
1484
1711
 
1485
- /**
1486
- * The minimum delivery time.
1487
- */
1488
- export interface Minimum {
1489
- /**
1490
- * The unit of the time duration.
1491
- */
1492
- unit: 'hour' | 'day' | 'business_day' | 'week' | 'month';
1493
-
1494
- /**
1495
- * The value of the time duration.
1496
- */
1497
- value: number;
1712
+ export interface Bban {
1713
+ accountHolderName: string;
1714
+
1715
+ bban: string;
1716
+
1717
+ bic?: string;
1498
1718
  }
1499
- }
1500
- }
1501
1719
 
1502
- /**
1503
- * The shopper object. Contains information collected from the user during the
1504
- * Checkout.
1505
- */
1506
- export interface Shopper {
1507
- email?: string;
1720
+ export interface Iban {
1721
+ accountHolderName: string;
1508
1722
 
1509
- phoneNumber?: string;
1723
+ iban: string;
1724
+
1725
+ bic?: string;
1726
+ }
1727
+
1728
+ export interface SortCode {
1729
+ accountHolderName: string;
1730
+
1731
+ accountNumber: string;
1732
+
1733
+ sortCode: string;
1734
+ }
1735
+ }
1510
1736
  }
1511
1737
 
1512
- export interface StatusClassification {
1738
+ export interface LineItem {
1513
1739
  /**
1514
- * Populated with the primary payment initiation failure classsification if
1515
- * available.
1740
+ * Accumulated cost in decimals. For example, for a lineItem with total price 3.00
1741
+ * and quantity 4, amount would be equal to 12.00.
1516
1742
  */
1517
- primary?: string;
1743
+ amount: number;
1518
1744
 
1519
1745
  /**
1520
- * Populated with the secondary payment initiation failure classsification if
1521
- * available.
1746
+ * Customer-facing name of the line item.
1522
1747
  */
1523
- secondary?: string;
1524
- }
1748
+ name: string;
1749
+
1750
+ singleNet: number;
1751
+
1752
+ singleVat: number;
1753
+
1754
+ category?:
1755
+ | '5045'
1756
+ | '5065'
1757
+ | '5094'
1758
+ | '5192'
1759
+ | '5193'
1760
+ | '5499'
1761
+ | '5655'
1762
+ | '5691'
1763
+ | '5712'
1764
+ | '5722'
1765
+ | '5812'
1766
+ | '5814'
1767
+ | '5912'
1768
+ | '5977'
1769
+ | '5999'
1770
+ | '7629';
1771
+
1772
+ co2Grams?: number;
1773
+
1774
+ EAN?: string;
1525
1775
 
1526
- export interface StatusHistoryList {
1527
1776
  /**
1528
- * The order status. This status symbolises the state of the user's payment
1529
- * attempt. See [the guide](https://docs.getivy.de/docs/payment-status) for more
1530
- * information.
1777
+ * An image of the line item. Valid URLs are accepted only.
1531
1778
  */
1532
- currentStatus:
1533
- | 'failed'
1534
- | 'canceled'
1535
- | 'processing'
1536
- | 'waiting_for_payment'
1537
- | 'paid'
1538
- | 'in_refund'
1539
- | 'refunded'
1540
- | 'refund_failed'
1541
- | 'partially_refunded'
1542
- | 'in_dispute'
1543
- | 'disputed'
1544
- | 'refused';
1545
-
1546
- reason: string;
1779
+ image?: string;
1547
1780
 
1548
- updatedAt: string;
1781
+ /**
1782
+ * Quantity of this lineItem.
1783
+ */
1784
+ quantity?: number;
1549
1785
 
1550
1786
  /**
1551
- * The order status. This status symbolises the state of the user's payment
1552
- * attempt. See [the guide](https://docs.getivy.de/docs/payment-status) for more
1553
- * information.
1787
+ * An internal unique id stored to this line item.
1554
1788
  */
1555
- previousStatus?:
1556
- | 'failed'
1557
- | 'canceled'
1558
- | 'processing'
1559
- | 'waiting_for_payment'
1560
- | 'paid'
1561
- | 'in_refund'
1562
- | 'refunded'
1563
- | 'refund_failed'
1564
- | 'partially_refunded'
1565
- | 'in_dispute'
1566
- | 'disputed'
1567
- | 'refused'
1568
- | null;
1789
+ referenceId?: string;
1569
1790
  }
1570
- }
1571
1791
 
1572
- export interface OrderUpdateResponse {
1573
- /**
1574
- * The Ivy unique identifier for the order.
1575
- */
1576
- id: string;
1792
+ export interface Mandate {
1793
+ accountHolderName: string;
1577
1794
 
1578
- /**
1579
- * @deprecated The unique identifier for the merchantApp which initiated the order
1580
- * / payment attempt.
1581
- */
1582
- appId: string;
1795
+ additionalDisplayInformation?: Mandate.AdditionalDisplayInformation;
1583
1796
 
1584
- /**
1585
- * The Ivy fee for the payment.
1586
- */
1587
- applicationFeeAmount: number;
1797
+ creditor?: Mandate.Creditor;
1798
+
1799
+ reference?: string;
1588
1800
 
1589
- createdAt: string;
1801
+ referenceId?: string;
1590
1802
 
1591
- instantPaymentScheme: boolean;
1803
+ setup?: boolean;
1592
1804
 
1593
- /**
1594
- * @deprecated Deprecated in favor of `appId`.
1595
- */
1596
- merchantAppId: string;
1805
+ userNotificationEmail?: string;
1806
+ }
1597
1807
 
1598
- /**
1599
- * The unique identifier for the merchant which initiated the order / payment
1600
- * attempt.
1601
- */
1602
- merchantId: string;
1808
+ export namespace Mandate {
1809
+ export interface AdditionalDisplayInformation {
1810
+ cadence?: 'BI_WEEKLY' | 'WEEKLY' | 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'ON_DEMAND';
1603
1811
 
1604
- /**
1605
- * The amount to be paid by the user. The amounts is in decimals, i.e. 10.23
1606
- * represents EUR 10.23. Any amount of decimal places can be provided on
1607
- * initialization, but the actual transfer amount is rounded to 2 decimal places,
1608
- * as this is the format accepted by most banks.
1609
- */
1610
- price: OrderUpdateResponse.Price;
1812
+ price?: AdditionalDisplayInformation.Price;
1813
+ }
1611
1814
 
1612
- /**
1613
- * An internal reference id which will be stored with the checkout & corresponding
1614
- * order. Needs to be unique per shop per order and can be up to 200 characters.
1615
- */
1616
- referenceId: string;
1815
+ export namespace AdditionalDisplayInformation {
1816
+ export interface Price {
1817
+ amount: number;
1617
1818
 
1618
- /**
1619
- * The name of the merchant which initiated the order.
1620
- */
1621
- shopName: string;
1819
+ currency: 'EUR' | 'GBP' | 'PLN' | 'SEK' | 'DKK';
1820
+ }
1821
+ }
1622
1822
 
1623
- /**
1624
- * The order status. This status symbolises the state of the user's payment
1625
- * attempt. See [the guide](https://docs.getivy.de/docs/payment-status) for more
1626
- * information.
1627
- */
1628
- status:
1629
- | 'failed'
1630
- | 'canceled'
1631
- | 'processing'
1632
- | 'waiting_for_payment'
1633
- | 'paid'
1634
- | 'in_refund'
1635
- | 'refunded'
1636
- | 'refund_failed'
1637
- | 'partially_refunded'
1638
- | 'in_dispute'
1639
- | 'disputed'
1640
- | 'refused';
1823
+ export interface Creditor {
1824
+ id?: string;
1641
1825
 
1642
- updatedAt: string;
1826
+ name?: string;
1827
+ }
1828
+ }
1643
1829
 
1644
1830
  /**
1645
- * The unique identifier of the customer's bank.
1831
+ * The financial address of the merchant associated with the order. Only available
1832
+ * when requested via order/details and therefore requires authentication.
1646
1833
  */
1647
- bankId?: string;
1834
+ export interface MerchantFinancialAddress {
1835
+ type: 'iban' | 'sort_code' | 'bank_code' | 'bban';
1648
1836
 
1649
- /**
1650
- * The bank statement reference of the payment for the order. This is the reference
1651
- * that will be visible on the bank statement.
1652
- */
1653
- bankStatementReference?: string;
1837
+ bankCode?: MerchantFinancialAddress.BankCode;
1654
1838
 
1655
- /**
1656
- * The billing address of the user. Required when handshake=true.
1657
- */
1658
- billingAddress?: OrderUpdateResponse.BillingAddress;
1839
+ bban?: MerchantFinancialAddress.Bban;
1659
1840
 
1660
- /**
1661
- * The merchant category code or
1662
- * [MCC](https://en.wikipedia.org/wiki/Merchant_category_code).
1663
- */
1664
- category?: string;
1841
+ iban?: MerchantFinancialAddress.Iban;
1665
1842
 
1666
- /**
1667
- * @deprecated
1668
- */
1669
- climateActionMode?: OrderUpdateResponse.ClimateActionMode;
1843
+ paymentReference?: string;
1670
1844
 
1671
- /**
1672
- * @deprecated
1673
- */
1674
- co2Grams?: number;
1845
+ sortCode?: MerchantFinancialAddress.SortCode;
1846
+ }
1675
1847
 
1676
- /**
1677
- * The unique identifier of the customer who placed the order.
1678
- */
1679
- customerId?: string;
1848
+ export namespace MerchantFinancialAddress {
1849
+ export interface BankCode {
1850
+ accountHolderName: string;
1680
1851
 
1681
- /**
1682
- * The customer facing id. This id is displayed to the user during the checkout and
1683
- * in the merchant dashboard.
1684
- */
1685
- displayId?: string;
1852
+ accountNumber: string;
1686
1853
 
1687
- /**
1688
- * False by default. If set to true, customers skip email input and jump directly
1689
- * to their bank login. For express Checkout Sessions this is always false.
1690
- */
1691
- guest?: boolean;
1854
+ code: string;
1855
+ }
1692
1856
 
1693
- /**
1694
- * Only valid for sustainable incentive mode. The social / sustainable projects
1695
- * available to the user during Checkout.
1696
- */
1697
- impactOffsetProjects?: Array<string>;
1857
+ export interface Bban {
1858
+ accountHolderName: string;
1698
1859
 
1699
- /**
1700
- * The incentive mode of the checkout session. For any use-case apart from
1701
- * e-commerce, please use `white_label` as the value. If set to `white_label`, the
1702
- * checkout session will be white labeled. If set to `sustainable`, the checkout
1703
- * session will contain sustainable incentives for users.
1704
- */
1705
- incentiveMode?: 'white_label' | 'sustainable';
1860
+ bban: string;
1706
1861
 
1707
- /**
1708
- * The line items of the Checkout.
1709
- */
1710
- lineItems?: Array<OrderUpdateResponse.LineItem>;
1862
+ bic?: string;
1863
+ }
1711
1864
 
1712
- mandate?: OrderUpdateResponse.Mandate;
1865
+ export interface Iban {
1866
+ accountHolderName: string;
1713
1867
 
1714
- /**
1715
- * The destination bank account where the money will be sent to.
1716
- */
1717
- merchantFinancialAddress?: OrderUpdateResponse.MerchantFinancialAddress;
1868
+ iban: string;
1718
1869
 
1719
- /**
1720
- * Any data which will be stored and returned for this checkout session and
1721
- * corresponding order. See [here](https://docs.getivy.de/reference/metadata) for
1722
- * more info.
1723
- */
1724
- metadata?: Record<string, unknown>;
1870
+ bic?: string;
1871
+ }
1725
1872
 
1726
- /**
1727
- * Only valid for sustainable incentive mode. The social / sustainability project
1728
- * chosen by the user during Checkout.
1729
- */
1730
- offsetProject?: string;
1873
+ export interface SortCode {
1874
+ accountHolderName: string;
1731
1875
 
1732
- /**
1733
- * The source bank account where the money is send from.
1734
- */
1735
- payerFinancialAddress?: OrderUpdateResponse.PayerFinancialAddress;
1876
+ accountNumber: string;
1736
1877
 
1737
- paymentMethodType?: 'sepa_debit' | 'customer_balance';
1878
+ sortCode: string;
1879
+ }
1880
+ }
1738
1881
 
1739
1882
  /**
1740
- * The payment mode of the order. Can be either 'settlement' or 'direct'.
1883
+ * The financial address of the payer associated with the order. Only available
1884
+ * after successful PIS flow.
1741
1885
  */
1742
- paymentMode?: 'settlement' | 'direct';
1886
+ export interface PayerFinancialAddress {
1887
+ type: 'iban' | 'sort_code' | 'bank_code' | 'bban';
1743
1888
 
1744
- /**
1745
- * @deprecated Deprecated in favor of `status`. Do not use this field to trigger
1746
- * actions in your system.
1747
- */
1748
- paymentStatus?:
1749
- | 'failed'
1750
- | 'canceled'
1751
- | 'processing'
1752
- | 'requires_action'
1753
- | 'succeeded'
1754
- | 'in_refund'
1755
- | 'refunded'
1756
- | 'refund_failed'
1757
- | 'partially_refunded'
1758
- | 'not_settled'
1759
- | 'disputed';
1889
+ bankCode?: PayerFinancialAddress.BankCode;
1760
1890
 
1761
- /**
1762
- * The total amount in the currency of all successful refunds for this order
1763
- */
1764
- refundAmount?: number;
1891
+ bban?: PayerFinancialAddress.Bban;
1765
1892
 
1766
- /**
1767
- * The list of refunds connected to this order.
1768
- */
1769
- refunds?: Array<OrderUpdateResponse.Refund>;
1893
+ iban?: PayerFinancialAddress.Iban;
1770
1894
 
1771
- /**
1772
- * The shipping address of the user. This is only collected in express Checkouts.
1773
- */
1774
- shippingAddress?: OrderUpdateResponse.ShippingAddress;
1895
+ sortCode?: PayerFinancialAddress.SortCode;
1896
+ }
1775
1897
 
1776
- /**
1777
- * The selected shipping method by the user. Can either be selected during an
1778
- * express Checkout Session or passed during Checkout Session creation.
1779
- */
1780
- shippingMethod?: OrderUpdateResponse.ShippingMethod;
1898
+ export namespace PayerFinancialAddress {
1899
+ export interface BankCode {
1900
+ accountNumber: string;
1781
1901
 
1782
- /**
1783
- * The logo of the shop provided as a URL.
1784
- */
1785
- shopLogo?: string;
1902
+ code: string;
1786
1903
 
1787
- /**
1788
- * The shopper object. Contains information collected from the user during the
1789
- * Checkout.
1790
- */
1791
- shopper?: OrderUpdateResponse.Shopper;
1904
+ accountHolderName?: string;
1905
+ }
1792
1906
 
1793
- /**
1794
- * @deprecated Deprecated in favor of `shopper.email`. The email of the user if
1795
- * collected in the Checkout.
1796
- */
1797
- shopperEmail?: string;
1907
+ export interface Bban {
1908
+ bban: string;
1798
1909
 
1799
- statusClassification?: OrderUpdateResponse.StatusClassification;
1910
+ accountHolderName?: string;
1800
1911
 
1801
- /**
1802
- * List of status history items for the order, used for logging every update on
1803
- * status.
1804
- */
1805
- statusHistoryList?: Array<OrderUpdateResponse.StatusHistoryList>;
1912
+ bic?: string;
1913
+ }
1806
1914
 
1807
- /**
1808
- * The subaccount id of the order.
1809
- */
1810
- subaccountId?: string;
1915
+ export interface Iban {
1916
+ iban: string;
1811
1917
 
1812
- /**
1813
- * The legal name of the subaccount
1814
- */
1815
- subaccountLegalName?: string;
1918
+ accountHolderName?: string;
1816
1919
 
1817
- /**
1818
- * @deprecated
1819
- */
1820
- trees?: number;
1821
- }
1920
+ bic?: string;
1921
+ }
1822
1922
 
1823
- export namespace OrderUpdateResponse {
1824
- /**
1825
- * The amount to be paid by the user. The amounts is in decimals, i.e. 10.23
1826
- * represents EUR 10.23. Any amount of decimal places can be provided on
1827
- * initialization, but the actual transfer amount is rounded to 2 decimal places,
1828
- * as this is the format accepted by most banks.
1829
- */
1830
- export interface Price {
1831
- currency: 'EUR' | 'GBP' | 'PLN';
1923
+ export interface SortCode {
1924
+ accountNumber: string;
1925
+
1926
+ sortCode: string;
1927
+
1928
+ accountHolderName?: string;
1929
+ }
1930
+ }
1832
1931
 
1932
+ export interface Refund {
1833
1933
  /**
1834
- * The total amount to be paid.
1934
+ * The unique id of this refund request.
1835
1935
  */
1836
- total: number;
1936
+ id: string;
1837
1937
 
1838
- shipping?: number;
1938
+ /**
1939
+ * The amount of the refund in decimals.
1940
+ */
1941
+ amount: number;
1839
1942
 
1840
- subTotal?: number;
1943
+ createdAt: unknown;
1841
1944
 
1842
- totalNet?: number;
1945
+ /**
1946
+ * The unique id of this refund request. This can be set when requesting the
1947
+ * refund.
1948
+ */
1949
+ referenceId: string;
1843
1950
 
1844
- vat?: number;
1845
- }
1951
+ /**
1952
+ * The current status of this refund.
1953
+ */
1954
+ status: 'pending' | 'succeeded' | 'failed' | 'requires_action' | 'partially_refunded';
1846
1955
 
1847
- /**
1848
- * The billing address of the user. Required when handshake=true.
1849
- */
1850
- export interface BillingAddress {
1851
- city: string;
1956
+ updatedAt: unknown;
1852
1957
 
1853
1958
  /**
1854
- * The country code in
1855
- * [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.
1959
+ * The description of the refund.
1856
1960
  */
1961
+ description?: string;
1962
+ }
1963
+
1964
+ export interface ShippingAddress {
1965
+ city: string;
1966
+
1857
1967
  country:
1858
1968
  | 'AF'
1859
1969
  | 'AL'
@@ -2106,341 +2216,338 @@ export namespace OrderUpdateResponse {
2106
2216
  | 'SS'
2107
2217
  | 'XK';
2108
2218
 
2109
- line1: string;
2219
+ firstName: string;
2110
2220
 
2111
- zipCode: string;
2221
+ lastName: string;
2112
2222
 
2113
- firstName?: string;
2223
+ line1: string;
2114
2224
 
2115
- lastName?: string;
2225
+ line2: string;
2116
2226
 
2117
- line2?: string;
2227
+ region: string;
2118
2228
 
2119
- region?: string;
2229
+ zipCode: string;
2120
2230
  }
2121
2231
 
2122
2232
  /**
2123
- * @deprecated
2233
+ * Information about the customer who finished the order.
2124
2234
  */
2125
- export interface ClimateActionMode {
2126
- amount: number;
2235
+ export interface Shopper {
2236
+ email?: string;
2127
2237
 
2128
- type: 'transaction' | 'amount';
2238
+ phoneNumber?: string;
2129
2239
  }
2130
2240
 
2131
- export interface LineItem {
2132
- /**
2133
- * The total amount of all line items, i.e. single amount \* quantity. Given in
2134
- * decimals, i.e. 10.23 represents EUR 10.23.
2135
- */
2136
- amount: number;
2137
-
2138
- /**
2139
- * The name of the line item.
2140
- */
2141
- name: string;
2142
-
2143
- /**
2144
- * The quantity of the line item.
2145
- */
2146
- quantity: number;
2147
-
2148
- /**
2149
- * The net amount of a single item.
2150
- */
2151
- singleNet: number;
2152
-
2153
- /**
2154
- * The VAT amount of a single item.
2155
- */
2156
- singleVat: number;
2157
-
2158
- /**
2159
- * The category as [MCC](https://en.wikipedia.org/wiki/Merchant_category_code) of
2160
- * the line item.
2161
- */
2162
- category?: string;
2163
-
2164
- /**
2165
- * The
2166
- * [EAN](https://en.wikipedia.org/wiki/International_Article_Number#:~:text=The%20International%20Article%20Number%20(also,configuration%2C%20from%20a%20specific%20manufacturer.)
2167
- * of the line item.
2168
- */
2169
- EAN?: string;
2170
-
2171
- /**
2172
- * The image of the line item as a URL.
2173
- */
2174
- image?: string;
2175
-
2176
- /**
2177
- * The internal unique identifier of the line item.
2178
- */
2179
- referenceId?: string;
2241
+ export interface StatusClassification {
2242
+ primary: 'payment_authorisation_failed' | 'payment_execution_failed' | 'payment_abandoned';
2243
+
2244
+ secondary?:
2245
+ | 'timeout'
2246
+ | 'wrong_credentials'
2247
+ | 'incorrect_2fa_response'
2248
+ | 'payment_rejected'
2249
+ | 'insufficient_funds'
2250
+ | 'cancelled'
2251
+ | 'connection_to_bank_failed'
2252
+ | 'international_transfer_blocked'
2253
+ | 'international_transfer_limit_exceeded'
2254
+ | 'user_blocked'
2255
+ | 'bank_error'
2256
+ | 'instant_transfers_not_enabled'
2257
+ | 'no_active_tan_methods_available'
2258
+ | 'account_limit_exceeded'
2259
+ | 'bank_under_maintenance'
2260
+ | 'pin_blocked'
2261
+ | 'payment_not_settled'
2262
+ | 'unsupported_bank_account';
2180
2263
  }
2181
2264
 
2182
- export interface Mandate {
2183
- /**
2184
- * The name of the account holder who signs the mandate.
2185
- */
2186
- accountHolderName?: string;
2265
+ export interface StatusHistoryList {
2266
+ createdAt: unknown;
2187
2267
 
2188
- /**
2189
- * Additional information to display to the user during the mandate setup. This
2190
- * information is not used to setup any recurrence on the mandate. It is only
2191
- * displayed to the user during checkout.
2192
- */
2193
- additionalDisplayInformation?: Mandate.AdditionalDisplayInformation;
2268
+ currentStatus:
2269
+ | 'failed'
2270
+ | 'canceled'
2271
+ | 'processing'
2272
+ | 'waiting_for_payment'
2273
+ | 'paid'
2274
+ | 'in_refund'
2275
+ | 'refunded'
2276
+ | 'refund_failed'
2277
+ | 'partially_refunded'
2278
+ | 'in_dispute'
2279
+ | 'disputed'
2280
+ | 'refused';
2194
2281
 
2195
- /**
2196
- * Mandate creditor data
2197
- */
2198
- creditor?: Mandate.Creditor;
2282
+ reason:
2283
+ | 'ORDER_CREATED'
2284
+ | 'CHECKOUT_SESSION_ABORTED'
2285
+ | 'PAYMENT_SUCCEEDED'
2286
+ | 'PAYMENT_INITIATED'
2287
+ | 'ORDER_CANCELED'
2288
+ | 'ORDER_EXPIRED_BY_MERCHANT'
2289
+ | 'ORDER_REFUND_INITIATED'
2290
+ | 'ORDER_REFUNDED'
2291
+ | 'REFUND_CHARGE_SUCCEEDED'
2292
+ | 'REFUND_UPDATED'
2293
+ | 'CHECKOUT_COMPLETED'
2294
+ | 'PIS_PAYMENT_INITIATED'
2295
+ | 'PIS_PAYMENT_UPDATED'
2296
+ | 'PIS_PAYMENT_SUCCEEDED'
2297
+ | 'PAYMENT_NOT_SETTLED'
2298
+ | 'PAYMENT_INITIATION_FAILED'
2299
+ | 'PAYMENT_CANCELED'
2300
+ | 'PAYMENT_FAILED'
2301
+ | 'CHECKOUT_SESSION_CREATED'
2302
+ | 'EXPIRED_CHECKOUT_SESSION_ABORTED'
2303
+ | 'DISPUTE'
2304
+ | 'PENDING_PAYMENT_ATTEMPTS_FOUND'
2305
+ | 'AML_FREEZE'
2306
+ | 'MANUAL_FREEZE'
2307
+ | 'MANUAL_UNFREEZE'
2308
+ | 'ORDER_MANUALLY_REOPENED';
2309
+
2310
+ updatedAt: unknown;
2199
2311
 
2200
- /**
2201
- * The reference of the mandate going to be setup
2202
- */
2203
- reference?: string;
2312
+ previousStatus?:
2313
+ | 'failed'
2314
+ | 'canceled'
2315
+ | 'processing'
2316
+ | 'waiting_for_payment'
2317
+ | 'paid'
2318
+ | 'in_refund'
2319
+ | 'refunded'
2320
+ | 'refund_failed'
2321
+ | 'partially_refunded'
2322
+ | 'in_dispute'
2323
+ | 'disputed'
2324
+ | 'refused'
2325
+ | null;
2326
+ }
2327
+ }
2204
2328
 
2205
- /**
2206
- * The mandate referenceId. Set this to match incoming `mandate_setup_started`,
2207
- * `mandate_setup_succeeded` or `mandate_setup_failed` webhook events to your
2208
- * mandate setup request.
2209
- */
2210
- referenceId?: string;
2329
+ export interface OrderExpireResponse {
2330
+ /**
2331
+ * The unique id for the order.
2332
+ */
2333
+ id: string;
2211
2334
 
2212
- /**
2213
- * If true, a ready to use mandate will be set up after the payment flow.
2214
- */
2215
- setup?: boolean;
2335
+ /**
2336
+ * The unique id for the merchantApp which initiated the order.
2337
+ */
2338
+ appId: string;
2216
2339
 
2217
- /**
2218
- * The email of the user who signs the mandate.
2219
- */
2220
- userNotificationEmail?: string;
2221
- }
2340
+ /**
2341
+ * The amount of application fee collected with the order.
2342
+ */
2343
+ applicationFeeAmount: number;
2222
2344
 
2223
- export namespace Mandate {
2224
- /**
2225
- * Additional information to display to the user during the mandate setup. This
2226
- * information is not used to setup any recurrence on the mandate. It is only
2227
- * displayed to the user during checkout.
2228
- */
2229
- export interface AdditionalDisplayInformation {
2230
- /**
2231
- * The intended cadence of charges used for displaying purpose only. On demand
2232
- * would be used for unscheduled charges.
2233
- */
2234
- cadence?: 'BI_WEEKLY' | 'WEEKLY' | 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'ON_DEMAND';
2345
+ createdAt: unknown;
2235
2346
 
2236
- price?: AdditionalDisplayInformation.Price;
2237
- }
2347
+ instantPaymentScheme: boolean;
2238
2348
 
2239
- export namespace AdditionalDisplayInformation {
2240
- export interface Price {
2241
- /**
2242
- * The amount displayed to the user as decimal e.g. 10.23 would be displayed as
2243
- * 10.23 EUR.
2244
- */
2245
- amount?: number;
2349
+ /**
2350
+ * Same as appId
2351
+ */
2352
+ merchantAppId: string;
2246
2353
 
2247
- currency?: 'EUR' | 'GBP' | 'PLN';
2248
- }
2249
- }
2354
+ merchantId: string;
2250
2355
 
2251
- /**
2252
- * Mandate creditor data
2253
- */
2254
- export interface Creditor {
2255
- id?: string;
2356
+ /**
2357
+ * The price object. All values in decimals, e.g. 0.13 for 13 cents.
2358
+ */
2359
+ price: OrderExpireResponse.Price;
2256
2360
 
2257
- name?: string;
2258
- }
2259
- }
2361
+ /**
2362
+ * A unique id for the order which can be set when creating the checkoutSession.
2363
+ */
2364
+ referenceId: string;
2260
2365
 
2261
2366
  /**
2262
- * The destination bank account where the money will be sent to.
2367
+ * The legal name of the merchant which initiated the order.
2263
2368
  */
2264
- export interface MerchantFinancialAddress {
2265
- bankCode?: MerchantFinancialAddress.BankCode;
2369
+ shopName: string;
2266
2370
 
2267
- bban?: MerchantFinancialAddress.Bban;
2371
+ /**
2372
+ * The status of the order. As soon as this value is 'paid', you can ship the
2373
+ * order.
2374
+ */
2375
+ status:
2376
+ | 'failed'
2377
+ | 'canceled'
2378
+ | 'processing'
2379
+ | 'waiting_for_payment'
2380
+ | 'paid'
2381
+ | 'in_refund'
2382
+ | 'refunded'
2383
+ | 'refund_failed'
2384
+ | 'partially_refunded'
2385
+ | 'in_dispute'
2386
+ | 'disputed'
2387
+ | 'refused';
2268
2388
 
2269
- iban?: MerchantFinancialAddress.Iban;
2389
+ updatedAt: unknown;
2270
2390
 
2271
- /**
2272
- * The payment reference for the order. This is the reference that will be visible
2273
- * on the bank statement.
2274
- */
2275
- paymentReference?: string;
2391
+ /**
2392
+ * The unique identifier of the customer's bank.
2393
+ */
2394
+ bankId?: string;
2276
2395
 
2277
- sortCode?: MerchantFinancialAddress.SortCode;
2396
+ /**
2397
+ * The reference that will be shown on the bank statement of the customer. Only
2398
+ * available after a successful DirectDebit initiation.
2399
+ */
2400
+ bankStatementReference?: string;
2278
2401
 
2279
- /**
2280
- * The type of the financial address. The actual destination is determined by this
2281
- * field which can be either "iban", "sortCode", "bankCode", or "bban". The
2282
- * validation will fail if you set e.g. type="iban", but then not fill any values
2283
- * in the "iban" object.
2284
- *
2285
- * - iban: The IBAN of the account
2286
- * - sort_code: The sort code of the account
2287
- * - bank_code: The bank code of the account
2288
- * - bban: The BBAN of the account
2289
- */
2290
- type?: string;
2291
- }
2402
+ billingAddress?: OrderExpireResponse.BillingAddress;
2292
2403
 
2293
- export namespace MerchantFinancialAddress {
2294
- export interface BankCode {
2295
- /**
2296
- * The name of the account holder.
2297
- */
2298
- accountHolderName: string;
2404
+ /**
2405
+ * The merchant category code for the account. MCCs are used to classify businesses
2406
+ * based on the goods or services they provide.
2407
+ */
2408
+ category?: string;
2299
2409
 
2300
- accountNumber: string;
2410
+ climateActionMode?: OrderExpireResponse.ClimateActionMode;
2301
2411
 
2302
- code: string;
2303
- }
2412
+ co2Grams?: number;
2304
2413
 
2305
- export interface Bban {
2306
- /**
2307
- * The name of the account holder.
2308
- */
2309
- accountHolderName: string;
2414
+ /**
2415
+ * The unique identifier of the customer who placed the order.
2416
+ */
2417
+ customerId?: string;
2310
2418
 
2311
- bban: string;
2419
+ /**
2420
+ * The destination bank account and statement reference for the order.
2421
+ */
2422
+ destination?: OrderExpireResponse.Destination;
2312
2423
 
2313
- bic?: string;
2314
- }
2424
+ /**
2425
+ * The customer-facing id of the order.
2426
+ */
2427
+ displayId?: string;
2315
2428
 
2316
- export interface Iban {
2317
- /**
2318
- * The name of the account holder.
2319
- */
2320
- accountHolderName: string;
2429
+ guest?: boolean;
2321
2430
 
2322
- iban: string;
2431
+ impactOffsetProjects?: Array<unknown>;
2323
2432
 
2324
- bic?: string;
2325
- }
2433
+ /**
2434
+ * The list of line items sold with the order.
2435
+ */
2436
+ lineItems?: Array<OrderExpireResponse.LineItem>;
2326
2437
 
2327
- export interface SortCode {
2328
- /**
2329
- * The name of the account holder.
2330
- */
2331
- accountHolderName: string;
2438
+ mandate?: OrderExpireResponse.Mandate;
2332
2439
 
2333
- accountNumber: string;
2440
+ /**
2441
+ * The financial address of the merchant associated with the order. Only available
2442
+ * when requested via order/details and therefore requires authentication.
2443
+ */
2444
+ merchantFinancialAddress?: OrderExpireResponse.MerchantFinancialAddress;
2334
2445
 
2335
- sortCode: string;
2336
- }
2337
- }
2446
+ /**
2447
+ * Set of key-value pairs that you can attach to an object. This can be useful for
2448
+ * storing additional information about the object in a structured format.
2449
+ */
2450
+ metadata?: { [key: string]: unknown };
2338
2451
 
2339
2452
  /**
2340
- * The source bank account where the money is send from.
2453
+ * The project related to the order.
2341
2454
  */
2342
- export interface PayerFinancialAddress {
2343
- /**
2344
- * The type of the financial address. The actual destination is determined by this
2345
- * field which can be either "iban", "sortCode", "bankCode", or "bban". The
2346
- * validation will fail if you set e.g. type="iban", but then not fill any values
2347
- * in the "iban" object.
2348
- *
2349
- * - iban: The IBAN of the account
2350
- * - sort_code: The sort code of the account
2351
- * - bank_code: The bank code of the account
2352
- * - bban: The BBAN of the account
2353
- */
2354
- type: string;
2455
+ offsetProject?: string;
2355
2456
 
2356
- bankCode?: PayerFinancialAddress.BankCode;
2457
+ /**
2458
+ * The financial address of the payer associated with the order. Only available
2459
+ * after successful PIS flow.
2460
+ */
2461
+ payerFinancialAddress?: OrderExpireResponse.PayerFinancialAddress;
2357
2462
 
2358
- bban?: PayerFinancialAddress.Bban;
2463
+ paymentMethodType?: 'sepa_debit' | 'customer_balance' | 'manual_bank_transfer';
2359
2464
 
2360
- iban?: PayerFinancialAddress.Iban;
2465
+ /**
2466
+ * The payment mode of the order. Can be either settlement or direct.
2467
+ */
2468
+ paymentMode?: 'direct' | 'settlement';
2361
2469
 
2362
- sortCode?: PayerFinancialAddress.SortCode;
2363
- }
2470
+ /**
2471
+ * Deprecated. The status of the payment.
2472
+ */
2473
+ paymentStatus?:
2474
+ | 'not_settled'
2475
+ | 'failed'
2476
+ | 'canceled'
2477
+ | 'processing'
2478
+ | 'requires_action'
2479
+ | 'succeeded'
2480
+ | 'in_refund'
2481
+ | 'refunded'
2482
+ | 'refund_failed'
2483
+ | 'partially_refunded'
2484
+ | 'disputed';
2364
2485
 
2365
- export namespace PayerFinancialAddress {
2366
- export interface BankCode {
2367
- accountNumber: string;
2486
+ /**
2487
+ * The total amount in the currency of all successful refunds for this order
2488
+ */
2489
+ refundAmount?: number;
2368
2490
 
2369
- code: string;
2491
+ /**
2492
+ * All partial and total refunds of this order.
2493
+ */
2494
+ refunds?: Array<OrderExpireResponse.Refund>;
2370
2495
 
2371
- /**
2372
- * The name of the account holder.
2373
- */
2374
- accountHolderName?: string;
2375
- }
2496
+ /**
2497
+ * If set to true, a payment mandate will be created for the user. This is
2498
+ * currently in alpha and defaults to false.
2499
+ */
2500
+ setupPaymentMandate?: boolean;
2376
2501
 
2377
- export interface Bban {
2378
- bban: string;
2502
+ shippingAddress?: OrderExpireResponse.ShippingAddress;
2379
2503
 
2380
- /**
2381
- * The name of the account holder.
2382
- */
2383
- accountHolderName?: string;
2504
+ shopLogo?: string;
2384
2505
 
2385
- bic?: string;
2386
- }
2506
+ /**
2507
+ * Information about the customer who finished the order.
2508
+ */
2509
+ shopper?: OrderExpireResponse.Shopper;
2387
2510
 
2388
- export interface Iban {
2389
- iban: string;
2511
+ /**
2512
+ * Deprecated. The email of the customer who completed the order.
2513
+ */
2514
+ shopperEmail?: string;
2390
2515
 
2391
- /**
2392
- * The name of the account holder.
2393
- */
2394
- accountHolderName?: string;
2516
+ statusClassification?: OrderExpireResponse.StatusClassification;
2395
2517
 
2396
- bic?: string;
2397
- }
2518
+ statusHistoryList?: Array<OrderExpireResponse.StatusHistoryList>;
2398
2519
 
2399
- export interface SortCode {
2400
- accountNumber: string;
2520
+ /**
2521
+ * The subaccount id of the merchant.
2522
+ */
2523
+ subaccountId?: string;
2401
2524
 
2402
- sortCode: string;
2525
+ subaccountLegalName?: string;
2403
2526
 
2404
- /**
2405
- * The name of the account holder.
2406
- */
2407
- accountHolderName?: string;
2408
- }
2409
- }
2527
+ trees?: number;
2528
+ }
2410
2529
 
2530
+ export namespace OrderExpireResponse {
2411
2531
  /**
2412
- * A Refund object. This corresponds to one Refund request.
2532
+ * The price object. All values in decimals, e.g. 0.13 for 13 cents.
2413
2533
  */
2414
- export interface Refund {
2415
- id: string;
2416
-
2417
- amount: number;
2534
+ export interface Price {
2535
+ currency: 'EUR' | 'GBP' | 'PLN' | 'SEK' | 'DKK';
2418
2536
 
2419
- createdAt: string;
2537
+ total: number;
2420
2538
 
2421
- referenceId: string;
2539
+ shipping?: number;
2422
2540
 
2423
- /**
2424
- * The status of the refund. Always use the status of the order as your source of
2425
- * truth to trigger actions in your dashboard.
2426
- */
2427
- status: 'pending' | 'succeeded' | 'failed' | 'requires_action' | 'partially_refunded';
2541
+ subTotal?: number;
2428
2542
 
2429
- updatedAt: string;
2543
+ totalNet?: number;
2430
2544
 
2431
- description?: string;
2545
+ vat?: number;
2432
2546
  }
2433
2547
 
2434
- /**
2435
- * The shipping address of the user. This is only collected in express Checkouts.
2436
- */
2437
- export interface ShippingAddress {
2548
+ export interface BillingAddress {
2438
2549
  city: string;
2439
2550
 
2440
- /**
2441
- * The country code in
2442
- * [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.
2443
- */
2444
2551
  country:
2445
2552
  | 'AF'
2446
2553
  | 'AL'
@@ -2693,43 +2800,318 @@ export namespace OrderUpdateResponse {
2693
2800
  | 'SS'
2694
2801
  | 'XK';
2695
2802
 
2696
- line1: string;
2803
+ firstName: string;
2804
+
2805
+ lastName: string;
2806
+
2807
+ line1: string;
2808
+
2809
+ line2: string;
2810
+
2811
+ region: string;
2812
+
2813
+ zipCode: string;
2814
+ }
2815
+
2816
+ export interface ClimateActionMode {
2817
+ amount: number;
2818
+
2819
+ type: 'transaction' | 'amount';
2820
+ }
2821
+
2822
+ /**
2823
+ * The destination bank account and statement reference for the order.
2824
+ */
2825
+ export interface Destination {
2826
+ bankAccount: Destination.BankAccount;
2827
+
2828
+ /**
2829
+ * The bank statement reference of the payment for the order. This is the reference
2830
+ * that will be visible on the bank statement.
2831
+ */
2832
+ bankStatementReference: string;
2833
+ }
2834
+
2835
+ export namespace Destination {
2836
+ export interface BankAccount {
2837
+ type: 'iban' | 'sort_code' | 'bank_code' | 'bban';
2838
+
2839
+ bankCode?: BankAccount.BankCode;
2840
+
2841
+ bban?: BankAccount.Bban;
2842
+
2843
+ iban?: BankAccount.Iban;
2844
+
2845
+ paymentReference?: string;
2846
+
2847
+ sortCode?: BankAccount.SortCode;
2848
+ }
2849
+
2850
+ export namespace BankAccount {
2851
+ export interface BankCode {
2852
+ accountHolderName: string;
2853
+
2854
+ accountNumber: string;
2855
+
2856
+ code: string;
2857
+ }
2858
+
2859
+ export interface Bban {
2860
+ accountHolderName: string;
2861
+
2862
+ bban: string;
2863
+
2864
+ bic?: string;
2865
+ }
2866
+
2867
+ export interface Iban {
2868
+ accountHolderName: string;
2697
2869
 
2698
- zipCode: string;
2870
+ iban: string;
2871
+
2872
+ bic?: string;
2873
+ }
2874
+
2875
+ export interface SortCode {
2876
+ accountHolderName: string;
2877
+
2878
+ accountNumber: string;
2879
+
2880
+ sortCode: string;
2881
+ }
2882
+ }
2883
+ }
2884
+
2885
+ export interface LineItem {
2886
+ /**
2887
+ * Accumulated cost in decimals. For example, for a lineItem with total price 3.00
2888
+ * and quantity 4, amount would be equal to 12.00.
2889
+ */
2890
+ amount: number;
2891
+
2892
+ /**
2893
+ * Customer-facing name of the line item.
2894
+ */
2895
+ name: string;
2896
+
2897
+ singleNet: number;
2898
+
2899
+ singleVat: number;
2900
+
2901
+ category?:
2902
+ | '5045'
2903
+ | '5065'
2904
+ | '5094'
2905
+ | '5192'
2906
+ | '5193'
2907
+ | '5499'
2908
+ | '5655'
2909
+ | '5691'
2910
+ | '5712'
2911
+ | '5722'
2912
+ | '5812'
2913
+ | '5814'
2914
+ | '5912'
2915
+ | '5977'
2916
+ | '5999'
2917
+ | '7629';
2918
+
2919
+ co2Grams?: number;
2920
+
2921
+ EAN?: string;
2922
+
2923
+ /**
2924
+ * An image of the line item. Valid URLs are accepted only.
2925
+ */
2926
+ image?: string;
2927
+
2928
+ /**
2929
+ * Quantity of this lineItem.
2930
+ */
2931
+ quantity?: number;
2932
+
2933
+ /**
2934
+ * An internal unique id stored to this line item.
2935
+ */
2936
+ referenceId?: string;
2937
+ }
2938
+
2939
+ export interface Mandate {
2940
+ accountHolderName: string;
2941
+
2942
+ additionalDisplayInformation?: Mandate.AdditionalDisplayInformation;
2943
+
2944
+ creditor?: Mandate.Creditor;
2945
+
2946
+ reference?: string;
2947
+
2948
+ referenceId?: string;
2949
+
2950
+ setup?: boolean;
2951
+
2952
+ userNotificationEmail?: string;
2953
+ }
2954
+
2955
+ export namespace Mandate {
2956
+ export interface AdditionalDisplayInformation {
2957
+ cadence?: 'BI_WEEKLY' | 'WEEKLY' | 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'ON_DEMAND';
2958
+
2959
+ price?: AdditionalDisplayInformation.Price;
2960
+ }
2961
+
2962
+ export namespace AdditionalDisplayInformation {
2963
+ export interface Price {
2964
+ amount: number;
2699
2965
 
2700
- firstName?: string;
2966
+ currency: 'EUR' | 'GBP' | 'PLN' | 'SEK' | 'DKK';
2967
+ }
2968
+ }
2969
+
2970
+ export interface Creditor {
2971
+ id?: string;
2972
+
2973
+ name?: string;
2974
+ }
2975
+ }
2976
+
2977
+ /**
2978
+ * The financial address of the merchant associated with the order. Only available
2979
+ * when requested via order/details and therefore requires authentication.
2980
+ */
2981
+ export interface MerchantFinancialAddress {
2982
+ type: 'iban' | 'sort_code' | 'bank_code' | 'bban';
2983
+
2984
+ bankCode?: MerchantFinancialAddress.BankCode;
2985
+
2986
+ bban?: MerchantFinancialAddress.Bban;
2987
+
2988
+ iban?: MerchantFinancialAddress.Iban;
2989
+
2990
+ paymentReference?: string;
2991
+
2992
+ sortCode?: MerchantFinancialAddress.SortCode;
2993
+ }
2994
+
2995
+ export namespace MerchantFinancialAddress {
2996
+ export interface BankCode {
2997
+ accountHolderName: string;
2998
+
2999
+ accountNumber: string;
3000
+
3001
+ code: string;
3002
+ }
3003
+
3004
+ export interface Bban {
3005
+ accountHolderName: string;
3006
+
3007
+ bban: string;
3008
+
3009
+ bic?: string;
3010
+ }
3011
+
3012
+ export interface Iban {
3013
+ accountHolderName: string;
3014
+
3015
+ iban: string;
3016
+
3017
+ bic?: string;
3018
+ }
2701
3019
 
2702
- lastName?: string;
3020
+ export interface SortCode {
3021
+ accountHolderName: string;
2703
3022
 
2704
- line2?: string;
3023
+ accountNumber: string;
2705
3024
 
2706
- region?: string;
3025
+ sortCode: string;
3026
+ }
2707
3027
  }
2708
3028
 
2709
3029
  /**
2710
- * The selected shipping method by the user. Can either be selected during an
2711
- * express Checkout Session or passed during Checkout Session creation.
3030
+ * The financial address of the payer associated with the order. Only available
3031
+ * after successful PIS flow.
2712
3032
  */
2713
- export interface ShippingMethod {
3033
+ export interface PayerFinancialAddress {
3034
+ type: 'iban' | 'sort_code' | 'bank_code' | 'bban';
3035
+
3036
+ bankCode?: PayerFinancialAddress.BankCode;
3037
+
3038
+ bban?: PayerFinancialAddress.Bban;
3039
+
3040
+ iban?: PayerFinancialAddress.Iban;
3041
+
3042
+ sortCode?: PayerFinancialAddress.SortCode;
3043
+ }
3044
+
3045
+ export namespace PayerFinancialAddress {
3046
+ export interface BankCode {
3047
+ accountNumber: string;
3048
+
3049
+ code: string;
3050
+
3051
+ accountHolderName?: string;
3052
+ }
3053
+
3054
+ export interface Bban {
3055
+ bban: string;
3056
+
3057
+ accountHolderName?: string;
3058
+
3059
+ bic?: string;
3060
+ }
3061
+
3062
+ export interface Iban {
3063
+ iban: string;
3064
+
3065
+ accountHolderName?: string;
3066
+
3067
+ bic?: string;
3068
+ }
3069
+
3070
+ export interface SortCode {
3071
+ accountNumber: string;
3072
+
3073
+ sortCode: string;
3074
+
3075
+ accountHolderName?: string;
3076
+ }
3077
+ }
3078
+
3079
+ export interface Refund {
2714
3080
  /**
2715
- * The customer-facing name of the shipping method.
3081
+ * The unique id of this refund request.
2716
3082
  */
2717
- name: string;
3083
+ id: string;
3084
+
3085
+ /**
3086
+ * The amount of the refund in decimals.
3087
+ */
3088
+ amount: number;
3089
+
3090
+ createdAt: unknown;
2718
3091
 
2719
3092
  /**
2720
- * The price of the shipping method in decimals, i.e. 10.23 represents EUR 10.23.
3093
+ * The unique id of this refund request. This can be set when requesting the
3094
+ * refund.
2721
3095
  */
2722
- price: number;
3096
+ referenceId: string;
2723
3097
 
2724
3098
  /**
2725
- * The unique identifier of the shipping method within Ivy.
3099
+ * The current status of this refund.
2726
3100
  */
2727
- id?: string;
3101
+ status: 'pending' | 'succeeded' | 'failed' | 'requires_action' | 'partially_refunded';
3102
+
3103
+ updatedAt: unknown;
2728
3104
 
2729
3105
  /**
2730
- * The list of countries where the shipping method is available.
3106
+ * The description of the refund.
2731
3107
  */
2732
- countries?: Array<
3108
+ description?: string;
3109
+ }
3110
+
3111
+ export interface ShippingAddress {
3112
+ city: string;
3113
+
3114
+ country:
2733
3115
  | 'AF'
2734
3116
  | 'AL'
2735
3117
  | 'DZ'
@@ -2979,77 +3361,23 @@ export namespace OrderUpdateResponse {
2979
3361
  | 'RS'
2980
3362
  | 'SX'
2981
3363
  | 'SS'
2982
- | 'XK'
2983
- >;
3364
+ | 'XK';
2984
3365
 
2985
- /**
2986
- * The delivery estimate of the shipping method.
2987
- */
2988
- deliveryEstimate?: ShippingMethod.DeliveryEstimate;
3366
+ firstName: string;
2989
3367
 
2990
- /**
2991
- * The unique identifier within your system of the shipping method.
2992
- */
2993
- reference?: string;
3368
+ lastName: string;
2994
3369
 
2995
- /**
2996
- * @deprecated Deprecated in favor of deliveryEstimate
2997
- */
2998
- timeFrame?: string;
2999
- }
3370
+ line1: string;
3000
3371
 
3001
- export namespace ShippingMethod {
3002
- /**
3003
- * The delivery estimate of the shipping method.
3004
- */
3005
- export interface DeliveryEstimate {
3006
- /**
3007
- * The maximum delivery time.
3008
- */
3009
- maximum?: DeliveryEstimate.Maximum;
3010
-
3011
- /**
3012
- * The minimum delivery time.
3013
- */
3014
- minimum?: DeliveryEstimate.Minimum;
3015
- }
3372
+ line2: string;
3016
3373
 
3017
- export namespace DeliveryEstimate {
3018
- /**
3019
- * The maximum delivery time.
3020
- */
3021
- export interface Maximum {
3022
- /**
3023
- * The unit of the time duration.
3024
- */
3025
- unit: 'hour' | 'day' | 'business_day' | 'week' | 'month';
3026
-
3027
- /**
3028
- * The value of the time duration.
3029
- */
3030
- value: number;
3031
- }
3374
+ region: string;
3032
3375
 
3033
- /**
3034
- * The minimum delivery time.
3035
- */
3036
- export interface Minimum {
3037
- /**
3038
- * The unit of the time duration.
3039
- */
3040
- unit: 'hour' | 'day' | 'business_day' | 'week' | 'month';
3041
-
3042
- /**
3043
- * The value of the time duration.
3044
- */
3045
- value: number;
3046
- }
3047
- }
3376
+ zipCode: string;
3048
3377
  }
3049
3378
 
3050
3379
  /**
3051
- * The shopper object. Contains information collected from the user during the
3052
- * Checkout.
3380
+ * Information about the customer who finished the order.
3053
3381
  */
3054
3382
  export interface Shopper {
3055
3383
  email?: string;
@@ -3058,25 +3386,32 @@ export namespace OrderUpdateResponse {
3058
3386
  }
3059
3387
 
3060
3388
  export interface StatusClassification {
3061
- /**
3062
- * Populated with the primary payment initiation failure classsification if
3063
- * available.
3064
- */
3065
- primary?: string;
3066
-
3067
- /**
3068
- * Populated with the secondary payment initiation failure classsification if
3069
- * available.
3070
- */
3071
- secondary?: string;
3389
+ primary: 'payment_authorisation_failed' | 'payment_execution_failed' | 'payment_abandoned';
3390
+
3391
+ secondary?:
3392
+ | 'timeout'
3393
+ | 'wrong_credentials'
3394
+ | 'incorrect_2fa_response'
3395
+ | 'payment_rejected'
3396
+ | 'insufficient_funds'
3397
+ | 'cancelled'
3398
+ | 'connection_to_bank_failed'
3399
+ | 'international_transfer_blocked'
3400
+ | 'international_transfer_limit_exceeded'
3401
+ | 'user_blocked'
3402
+ | 'bank_error'
3403
+ | 'instant_transfers_not_enabled'
3404
+ | 'no_active_tan_methods_available'
3405
+ | 'account_limit_exceeded'
3406
+ | 'bank_under_maintenance'
3407
+ | 'pin_blocked'
3408
+ | 'payment_not_settled'
3409
+ | 'unsupported_bank_account';
3072
3410
  }
3073
3411
 
3074
3412
  export interface StatusHistoryList {
3075
- /**
3076
- * The order status. This status symbolises the state of the user's payment
3077
- * attempt. See [the guide](https://docs.getivy.de/docs/payment-status) for more
3078
- * information.
3079
- */
3413
+ createdAt: unknown;
3414
+
3080
3415
  currentStatus:
3081
3416
  | 'failed'
3082
3417
  | 'canceled'
@@ -3091,15 +3426,36 @@ export namespace OrderUpdateResponse {
3091
3426
  | 'disputed'
3092
3427
  | 'refused';
3093
3428
 
3094
- reason: string;
3095
-
3096
- updatedAt: string;
3429
+ reason:
3430
+ | 'ORDER_CREATED'
3431
+ | 'CHECKOUT_SESSION_ABORTED'
3432
+ | 'PAYMENT_SUCCEEDED'
3433
+ | 'PAYMENT_INITIATED'
3434
+ | 'ORDER_CANCELED'
3435
+ | 'ORDER_EXPIRED_BY_MERCHANT'
3436
+ | 'ORDER_REFUND_INITIATED'
3437
+ | 'ORDER_REFUNDED'
3438
+ | 'REFUND_CHARGE_SUCCEEDED'
3439
+ | 'REFUND_UPDATED'
3440
+ | 'CHECKOUT_COMPLETED'
3441
+ | 'PIS_PAYMENT_INITIATED'
3442
+ | 'PIS_PAYMENT_UPDATED'
3443
+ | 'PIS_PAYMENT_SUCCEEDED'
3444
+ | 'PAYMENT_NOT_SETTLED'
3445
+ | 'PAYMENT_INITIATION_FAILED'
3446
+ | 'PAYMENT_CANCELED'
3447
+ | 'PAYMENT_FAILED'
3448
+ | 'CHECKOUT_SESSION_CREATED'
3449
+ | 'EXPIRED_CHECKOUT_SESSION_ABORTED'
3450
+ | 'DISPUTE'
3451
+ | 'PENDING_PAYMENT_ATTEMPTS_FOUND'
3452
+ | 'AML_FREEZE'
3453
+ | 'MANUAL_FREEZE'
3454
+ | 'MANUAL_UNFREEZE'
3455
+ | 'ORDER_MANUALLY_REOPENED';
3456
+
3457
+ updatedAt: unknown;
3097
3458
 
3098
- /**
3099
- * The order status. This status symbolises the state of the user's payment
3100
- * attempt. See [the guide](https://docs.getivy.de/docs/payment-status) for more
3101
- * information.
3102
- */
3103
3459
  previousStatus?:
3104
3460
  | 'failed'
3105
3461
  | 'canceled'
@@ -3117,56 +3473,76 @@ export namespace OrderUpdateResponse {
3117
3473
  }
3118
3474
  }
3119
3475
 
3120
- export interface OrderRetrieveParams {
3121
- id: string;
3122
- }
3476
+ export interface OrderCreateParams {
3477
+ /**
3478
+ * The total amount of the order
3479
+ */
3480
+ amount: number;
3123
3481
 
3124
- export interface OrderUpdateParams {
3125
- id: string;
3482
+ /**
3483
+ * The currency code of the order
3484
+ */
3485
+ currency: 'EUR' | 'GBP' | 'PLN' | 'SEK' | 'DKK';
3126
3486
 
3127
3487
  /**
3128
- * The customer-facing id of the order. This id will also be shown next to the
3129
- * orders in the Ivy Dashboard.
3488
+ * The merchant's unique reference ID for the order
3130
3489
  */
3131
- displayId?: string;
3490
+ referenceId: string;
3132
3491
 
3133
3492
  /**
3134
- * An internal reference id which will be stored with the checkout & corresponding
3135
- * order. Needs to be unique per shop per order and can be up to 200 characters. We
3136
- * recommend to use your internal order id here.
3493
+ * The customer of the merchant.
3137
3494
  */
3138
- referenceId?: string;
3495
+ customer?: OrderCreateParams.Customer;
3139
3496
 
3140
3497
  /**
3141
- * The customer-facing name of the shop.
3498
+ * Optional expiration timestamp in seconds
3142
3499
  */
3143
- shopName?: string;
3500
+ expiresAt?: string;
3144
3501
 
3145
3502
  /**
3146
- * The order status. This status symbolises the state of the user's payment
3147
- * attempt. See [the guide](https://docs.getivy.de/docs/payment-status) for more
3148
- * information.
3503
+ * The subaccount id of the merchant.
3149
3504
  */
3150
- status?:
3151
- | 'failed'
3152
- | 'canceled'
3153
- | 'processing'
3154
- | 'waiting_for_payment'
3155
- | 'paid'
3156
- | 'in_refund'
3157
- | 'refunded'
3158
- | 'refund_failed'
3159
- | 'partially_refunded'
3160
- | 'in_dispute'
3161
- | 'disputed'
3162
- | 'refused';
3505
+ subaccountId?: string;
3506
+ }
3507
+
3508
+ export namespace OrderCreateParams {
3509
+ /**
3510
+ * The customer of the merchant.
3511
+ */
3512
+ export interface Customer {
3513
+ /**
3514
+ * The Ivy id of the customer.
3515
+ */
3516
+ id?: string;
3517
+
3518
+ /**
3519
+ * The email of the customer.
3520
+ */
3521
+ email?: string;
3522
+ }
3523
+ }
3524
+
3525
+ export interface OrderRetrieveParams {
3526
+ /**
3527
+ * You can put in either the Ivy id OR the referenceId of the order
3528
+ */
3529
+ id: string;
3530
+ }
3531
+
3532
+ export interface OrderExpireParams {
3533
+ /**
3534
+ * You can put in either the Ivy id OR the referenceId of the order
3535
+ */
3536
+ id: string;
3163
3537
  }
3164
3538
 
3165
3539
  export declare namespace Orders {
3166
3540
  export {
3541
+ type OrderCreateResponse as OrderCreateResponse,
3167
3542
  type OrderRetrieveResponse as OrderRetrieveResponse,
3168
- type OrderUpdateResponse as OrderUpdateResponse,
3543
+ type OrderExpireResponse as OrderExpireResponse,
3544
+ type OrderCreateParams as OrderCreateParams,
3169
3545
  type OrderRetrieveParams as OrderRetrieveParams,
3170
- type OrderUpdateParams as OrderUpdateParams,
3546
+ type OrderExpireParams as OrderExpireParams,
3171
3547
  };
3172
3548
  }