@getivy/node-sdk 0.1.0-alpha.3 → 0.1.0-alpha.30

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 (143) hide show
  1. package/CHANGELOG.md +310 -0
  2. package/README.md +2 -2
  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 +12 -1
  7. package/core.d.ts.map +1 -1
  8. package/core.js +20 -11
  9. package/core.js.map +1 -1
  10. package/core.mjs +21 -12
  11. package/core.mjs.map +1 -1
  12. package/index.d.mts +8 -2
  13. package/index.d.ts +8 -2
  14. package/index.d.ts.map +1 -1
  15. package/index.js +6 -0
  16. package/index.js.map +1 -1
  17. package/index.mjs +6 -0
  18. package/index.mjs.map +1 -1
  19. package/package.json +1 -1
  20. package/resources/balance.d.ts +2 -2
  21. package/resources/balance.d.ts.map +1 -1
  22. package/resources/banks.d.ts +53 -5
  23. package/resources/banks.d.ts.map +1 -1
  24. package/resources/charges.d.ts +1 -14
  25. package/resources/charges.d.ts.map +1 -1
  26. package/resources/checkoutsession.d.ts +451 -1312
  27. package/resources/checkoutsession.d.ts.map +1 -1
  28. package/resources/customers.d.ts +56 -6
  29. package/resources/customers.d.ts.map +1 -1
  30. package/resources/customers.js +3 -2
  31. package/resources/customers.js.map +1 -1
  32. package/resources/customers.mjs +3 -2
  33. package/resources/customers.mjs.map +1 -1
  34. package/resources/data/accounts.d.ts +104 -0
  35. package/resources/data/accounts.d.ts.map +1 -0
  36. package/resources/data/accounts.js +15 -0
  37. package/resources/data/accounts.js.map +1 -0
  38. package/resources/data/accounts.mjs +11 -0
  39. package/resources/data/accounts.mjs.map +1 -0
  40. package/resources/data/balances.d.ts +45 -0
  41. package/resources/data/balances.d.ts.map +1 -0
  42. package/resources/data/balances.js +15 -0
  43. package/resources/data/balances.js.map +1 -0
  44. package/resources/data/balances.mjs +11 -0
  45. package/resources/data/balances.mjs.map +1 -0
  46. package/resources/data/consent.d.ts +80 -0
  47. package/resources/data/consent.d.ts.map +1 -0
  48. package/resources/data/consent.js +21 -0
  49. package/resources/data/consent.js.map +1 -0
  50. package/resources/data/consent.mjs +17 -0
  51. package/resources/data/consent.mjs.map +1 -0
  52. package/resources/data/data.d.ts +26 -0
  53. package/resources/data/data.d.ts.map +1 -0
  54. package/resources/data/data.js +55 -0
  55. package/resources/data/data.js.map +1 -0
  56. package/resources/data/data.mjs +28 -0
  57. package/resources/data/data.mjs.map +1 -0
  58. package/resources/data/index.d.ts +7 -0
  59. package/resources/data/index.d.ts.map +1 -0
  60. package/resources/data/index.js +17 -0
  61. package/resources/data/index.js.map +1 -0
  62. package/resources/data/index.mjs +8 -0
  63. package/resources/data/index.mjs.map +1 -0
  64. package/resources/data/session.d.ts +233 -0
  65. package/resources/data/session.d.ts.map +1 -0
  66. package/resources/data/session.js +21 -0
  67. package/resources/data/session.js.map +1 -0
  68. package/resources/data/session.mjs +17 -0
  69. package/resources/data/session.mjs.map +1 -0
  70. package/resources/data/transactions.d.ts +54 -0
  71. package/resources/data/transactions.d.ts.map +1 -0
  72. package/resources/data/transactions.js +16 -0
  73. package/resources/data/transactions.js.map +1 -0
  74. package/resources/data/transactions.mjs +12 -0
  75. package/resources/data/transactions.mjs.map +1 -0
  76. package/resources/data.d.ts +2 -0
  77. package/resources/data.d.ts.map +1 -0
  78. package/resources/data.js +19 -0
  79. package/resources/data.js.map +1 -0
  80. package/resources/data.mjs +3 -0
  81. package/resources/data.mjs.map +1 -0
  82. package/resources/index.d.ts +3 -1
  83. package/resources/index.d.ts.map +1 -1
  84. package/resources/index.js +5 -1
  85. package/resources/index.js.map +1 -1
  86. package/resources/index.mjs +2 -0
  87. package/resources/index.mjs.map +1 -1
  88. package/resources/orders.d.ts +251 -105
  89. package/resources/orders.d.ts.map +1 -1
  90. package/resources/orders.js +10 -6
  91. package/resources/orders.js.map +1 -1
  92. package/resources/orders.mjs +10 -6
  93. package/resources/orders.mjs.map +1 -1
  94. package/resources/payouts.d.ts +2 -2
  95. package/resources/payouts.d.ts.map +1 -1
  96. package/resources/refunds.d.ts +1 -1
  97. package/resources/refunds.d.ts.map +1 -1
  98. package/resources/reports.d.ts +2 -2
  99. package/resources/reports.d.ts.map +1 -1
  100. package/resources/webhooksubscription.d.ts +155 -0
  101. package/resources/webhooksubscription.d.ts.map +1 -0
  102. package/resources/webhooksubscription.js +42 -0
  103. package/resources/webhooksubscription.js.map +1 -0
  104. package/resources/webhooksubscription.mjs +38 -0
  105. package/resources/webhooksubscription.mjs.map +1 -0
  106. package/resources.d.ts +2 -0
  107. package/resources.d.ts.map +1 -0
  108. package/resources.js +18 -0
  109. package/resources.js.map +1 -0
  110. package/resources.mjs +2 -0
  111. package/resources.mjs.map +1 -0
  112. package/src/_shims/index.d.ts +2 -0
  113. package/src/_shims/index.js +5 -1
  114. package/src/_shims/index.mjs +5 -1
  115. package/src/core.ts +39 -12
  116. package/src/index.ts +38 -4
  117. package/src/resources/balance.ts +2 -2
  118. package/src/resources/banks.ts +92 -5
  119. package/src/resources/charges.ts +1 -14
  120. package/src/resources/checkoutsession.ts +2100 -4413
  121. package/src/resources/customers.ts +61 -6
  122. package/src/resources/data/accounts.ts +134 -0
  123. package/src/resources/data/balances.ts +57 -0
  124. package/src/resources/data/consent.ts +110 -0
  125. package/src/resources/data/data.ts +75 -0
  126. package/src/resources/data/index.ts +20 -0
  127. package/src/resources/data/session.ts +1298 -0
  128. package/src/resources/data/transactions.ts +71 -0
  129. package/src/resources/data.ts +3 -0
  130. package/src/resources/index.ts +16 -2
  131. package/src/resources/orders.ts +296 -122
  132. package/src/resources/payouts.ts +2 -2
  133. package/src/resources/refunds.ts +0 -1
  134. package/src/resources/reports.ts +2 -2
  135. package/src/resources/webhooksubscription.ts +353 -0
  136. package/src/resources.ts +1 -0
  137. package/src/version.ts +1 -1
  138. package/version.d.ts +1 -1
  139. package/version.d.ts.map +1 -1
  140. package/version.js +1 -1
  141. package/version.js.map +1 -1
  142. package/version.mjs +1 -1
  143. package/version.mjs.map +1 -1
@@ -1,18 +1,22 @@
1
1
  import { APIResource } from "../resource.js";
2
2
  import * as Core from "../core.js";
3
3
  export declare class Orders extends APIResource {
4
+ /**
5
+ * Create a new order. By creating a new order, you will create a new settlement
6
+ * destination which you can use to settle expected incoming payments efficiently.
7
+ * After creating the order, Ivy provides you with a destination for the expected
8
+ * incoming payment. As soon as a payment with the same details arrives, Ivy will
9
+ * update the status of the order.
10
+ */
11
+ create(body: OrderCreateParams, options?: Core.RequestOptions): Core.APIPromise<OrderCreateResponse>;
4
12
  /**
5
13
  * Retrieve details of an order. You can retrieve the order by passing either the
6
14
  * internal Ivy order id or the `referenceId` you specified when creating a
7
15
  * Checkout Session to the `id` field.
8
16
  */
9
17
  retrieve(body: OrderRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<OrderRetrieveResponse>;
10
- /**
11
- * Update certain fields of the specified order.
12
- */
13
- update(body: OrderUpdateParams, options?: Core.RequestOptions): Core.APIPromise<OrderUpdateResponse>;
14
18
  }
15
- export interface OrderRetrieveResponse {
19
+ export interface OrderCreateResponse {
16
20
  /**
17
21
  * The Ivy unique identifier for the order.
18
22
  */
@@ -38,12 +42,12 @@ export interface OrderRetrieveResponse {
38
42
  */
39
43
  merchantId: string;
40
44
  /**
41
- * The price to be paid by the user. All amounts are in decimals, i.e. 10.23
45
+ * The amount to be paid by the user. The amounts is in decimals, i.e. 10.23
42
46
  * represents EUR 10.23. Any amount of decimal places can be provided on
43
47
  * initialization, but the actual transfer amount is rounded to 2 decimal places,
44
48
  * as this is the format accepted by most banks.
45
49
  */
46
- price: OrderRetrieveResponse.Price;
50
+ price: OrderCreateResponse.Price;
47
51
  /**
48
52
  * An internal reference id which will be stored with the checkout & corresponding
49
53
  * order. Needs to be unique per shop per order and can be up to 200 characters.
@@ -58,17 +62,22 @@ export interface OrderRetrieveResponse {
58
62
  * attempt. See [the guide](https://docs.getivy.de/docs/payment-status) for more
59
63
  * information.
60
64
  */
61
- status: 'failed' | 'canceled' | 'processing' | 'in_handshake' | 'waiting_for_payment' | 'paid' | 'in_refund' | 'refunded' | 'refund_failed' | 'partially_refunded' | 'in_dispute' | 'disputed' | 'refused';
65
+ status: 'failed' | 'canceled' | 'processing' | 'waiting_for_payment' | 'paid' | 'in_refund' | 'refunded' | 'refund_failed' | 'partially_refunded' | 'in_dispute' | 'disputed' | 'refused';
62
66
  updatedAt: string;
63
67
  /**
64
- * The bank statement reference of the payment for the order. This is the reference
65
- * that will be visible on the bank statement.
68
+ * The unique identifier of Ivy of the chosen bank to make the payment. Not there,
69
+ * if no payment was made.
70
+ */
71
+ bankId?: string;
72
+ /**
73
+ * @deprecated The bank statement reference of the payment for the order. This is
74
+ * the reference that will be visible on the bank statement.
66
75
  */
67
76
  bankStatementReference?: string;
68
77
  /**
69
78
  * The billing address of the user. Required when handshake=true.
70
79
  */
71
- billingAddress?: OrderRetrieveResponse.BillingAddress;
80
+ billingAddress?: OrderCreateResponse.BillingAddress;
72
81
  /**
73
82
  * The merchant category code or
74
83
  * [MCC](https://en.wikipedia.org/wiki/Merchant_category_code).
@@ -77,7 +86,7 @@ export interface OrderRetrieveResponse {
77
86
  /**
78
87
  * @deprecated
79
88
  */
80
- climateActionMode?: OrderRetrieveResponse.ClimateActionMode;
89
+ climateActionMode?: OrderCreateResponse.ClimateActionMode;
81
90
  /**
82
91
  * @deprecated
83
92
  */
@@ -86,6 +95,7 @@ export interface OrderRetrieveResponse {
86
95
  * The unique identifier of the customer who placed the order.
87
96
  */
88
97
  customerId?: string;
98
+ destination?: OrderCreateResponse.Destination;
89
99
  /**
90
100
  * The customer facing id. This id is displayed to the user during the checkout and
91
101
  * in the merchant dashboard.
@@ -111,12 +121,12 @@ export interface OrderRetrieveResponse {
111
121
  /**
112
122
  * The line items of the Checkout.
113
123
  */
114
- lineItems?: Array<OrderRetrieveResponse.LineItem>;
115
- mandate?: OrderRetrieveResponse.Mandate;
124
+ lineItems?: Array<OrderCreateResponse.LineItem>;
125
+ mandate?: OrderCreateResponse.Mandate;
116
126
  /**
117
- * The destination bank account where the money will be sent to.
127
+ * @deprecated
118
128
  */
119
- merchantFinancialAddress?: OrderRetrieveResponse.MerchantFinancialAddress;
129
+ merchantFinancialAddress?: OrderCreateResponse.MerchantFinancialAddress;
120
130
  /**
121
131
  * Any data which will be stored and returned for this checkout session and
122
132
  * corresponding order. See [here](https://docs.getivy.de/reference/metadata) for
@@ -131,8 +141,8 @@ export interface OrderRetrieveResponse {
131
141
  /**
132
142
  * The source bank account where the money is send from.
133
143
  */
134
- payerFinancialAddress?: OrderRetrieveResponse.PayerFinancialAddress;
135
- paymentMethodType?: 'sepa_debit' | 'customer_balance';
144
+ payerFinancialAddress?: OrderCreateResponse.PayerFinancialAddress;
145
+ paymentMethodType?: 'sepa_debit' | 'customer_balance' | 'manual_bank_transfer';
136
146
  /**
137
147
  * The payment mode of the order. Can be either 'settlement' or 'direct'.
138
148
  */
@@ -141,7 +151,7 @@ export interface OrderRetrieveResponse {
141
151
  * @deprecated Deprecated in favor of `status`. Do not use this field to trigger
142
152
  * actions in your system.
143
153
  */
144
- paymentStatus?: 'failed' | 'canceled' | 'processing' | 'requires_action' | 'succeeded' | 'in_refund' | 'refunded' | 'refund_failed' | 'partially_refunded' | 'not_settled' | 'disputed';
154
+ paymentStatus?: 'failed' | 'canceled' | 'processing' | 'requires_action' | 'succeeded' | 'in_refund' | 'refunded' | 'refund_failed' | 'partially_refunded' | 'not_settled' | 'disputed' | 'frozen_due_to_aml';
145
155
  /**
146
156
  * The total amount in the currency of all successful refunds for this order
147
157
  */
@@ -149,16 +159,16 @@ export interface OrderRetrieveResponse {
149
159
  /**
150
160
  * The list of refunds connected to this order.
151
161
  */
152
- refunds?: Array<OrderRetrieveResponse.Refund>;
162
+ refunds?: Array<OrderCreateResponse.Refund>;
153
163
  /**
154
164
  * The shipping address of the user. This is only collected in express Checkouts.
155
165
  */
156
- shippingAddress?: OrderRetrieveResponse.ShippingAddress;
166
+ shippingAddress?: OrderCreateResponse.ShippingAddress;
157
167
  /**
158
168
  * The selected shipping method by the user. Can either be selected during an
159
169
  * express Checkout Session or passed during Checkout Session creation.
160
170
  */
161
- shippingMethod?: OrderRetrieveResponse.ShippingMethod;
171
+ shippingMethod?: OrderCreateResponse.ShippingMethod;
162
172
  /**
163
173
  * The logo of the shop provided as a URL.
164
174
  */
@@ -167,18 +177,18 @@ export interface OrderRetrieveResponse {
167
177
  * The shopper object. Contains information collected from the user during the
168
178
  * Checkout.
169
179
  */
170
- shopper?: OrderRetrieveResponse.Shopper;
180
+ shopper?: OrderCreateResponse.Shopper;
171
181
  /**
172
182
  * @deprecated Deprecated in favor of `shopper.email`. The email of the user if
173
183
  * collected in the Checkout.
174
184
  */
175
185
  shopperEmail?: string;
176
- statusClassification?: OrderRetrieveResponse.StatusClassification;
186
+ statusClassification?: OrderCreateResponse.StatusClassification;
177
187
  /**
178
188
  * List of status history items for the order, used for logging every update on
179
189
  * status.
180
190
  */
181
- statusHistoryList?: Array<OrderRetrieveResponse.StatusHistoryList>;
191
+ statusHistoryList?: Array<OrderCreateResponse.StatusHistoryList>;
182
192
  /**
183
193
  * The subaccount id of the order.
184
194
  */
@@ -192,35 +202,22 @@ export interface OrderRetrieveResponse {
192
202
  */
193
203
  trees?: number;
194
204
  }
195
- export declare namespace OrderRetrieveResponse {
205
+ export declare namespace OrderCreateResponse {
196
206
  /**
197
- * The price to be paid by the user. All amounts are in decimals, i.e. 10.23
207
+ * The amount to be paid by the user. The amounts is in decimals, i.e. 10.23
198
208
  * represents EUR 10.23. Any amount of decimal places can be provided on
199
209
  * initialization, but the actual transfer amount is rounded to 2 decimal places,
200
210
  * as this is the format accepted by most banks.
201
211
  */
202
212
  interface Price {
203
- currency: 'EUR' | 'GBP' | 'PLN';
213
+ currency: 'EUR' | 'GBP' | 'PLN' | 'SEK' | 'DKK';
204
214
  /**
205
215
  * The total amount to be paid.
206
216
  */
207
217
  total: number;
208
- /**
209
- * The shipping amount.
210
- */
211
218
  shipping?: number;
212
- /**
213
- * The subtotal amount, i.e. the total amount without VAT and shipping.
214
- */
215
219
  subTotal?: number;
216
- /**
217
- * The total net amount, i.e. the total amount without VAT. This value is rounded
218
- * to 2 decimal places for the actual transfer.
219
- */
220
220
  totalNet?: number;
221
- /**
222
- * The VAT amount.
223
- */
224
221
  vat?: number;
225
222
  }
226
223
  /**
@@ -247,6 +244,76 @@ export declare namespace OrderRetrieveResponse {
247
244
  amount: number;
248
245
  type: 'transaction' | 'amount';
249
246
  }
247
+ interface Destination {
248
+ /**
249
+ * The validation logic is based on the "type" field. For example, if "type" is set
250
+ * to "iban", the "iban" object must be filled out.
251
+ */
252
+ bankAccount: Destination.BankAccount;
253
+ /**
254
+ * The bank statement reference of the payment for the order. This is the reference
255
+ * that will be visible on the bank statement.
256
+ */
257
+ bankStatementReference: string;
258
+ }
259
+ namespace Destination {
260
+ /**
261
+ * The validation logic is based on the "type" field. For example, if "type" is set
262
+ * to "iban", the "iban" object must be filled out.
263
+ */
264
+ interface BankAccount {
265
+ /**
266
+ * The type of the financial address. The actual destination is determined by this
267
+ * field which can be either "iban", "sortCode", "bankCode", or "bban". The
268
+ * validation will fail if you set e.g. type="iban", but then not fill any values
269
+ * in the "iban" object.
270
+ *
271
+ * - iban: The IBAN of the account
272
+ * - sort_code: The sort code of the account
273
+ * - bank_code: The bank code of the account
274
+ * - bban: The BBAN of the account
275
+ */
276
+ type: string;
277
+ bankCode?: BankAccount.BankCode;
278
+ bban?: BankAccount.Bban;
279
+ iban?: BankAccount.Iban;
280
+ sortCode?: BankAccount.SortCode;
281
+ }
282
+ namespace BankAccount {
283
+ interface BankCode {
284
+ /**
285
+ * The name of the account holder.
286
+ */
287
+ accountHolderName: string;
288
+ accountNumber: string;
289
+ code: string;
290
+ }
291
+ interface Bban {
292
+ /**
293
+ * The name of the account holder.
294
+ */
295
+ accountHolderName: string;
296
+ bban: string;
297
+ bic?: string;
298
+ }
299
+ interface Iban {
300
+ /**
301
+ * The name of the account holder.
302
+ */
303
+ accountHolderName: string;
304
+ iban: string;
305
+ bic?: string;
306
+ }
307
+ interface SortCode {
308
+ /**
309
+ * The name of the account holder.
310
+ */
311
+ accountHolderName: string;
312
+ accountNumber: string;
313
+ sortCode: string;
314
+ }
315
+ }
316
+ }
250
317
  interface LineItem {
251
318
  /**
252
319
  * The total amount of all line items, i.e. single amount \* quantity. Given in
@@ -344,7 +411,7 @@ export declare namespace OrderRetrieveResponse {
344
411
  * 10.23 EUR.
345
412
  */
346
413
  amount?: number;
347
- currency?: 'EUR' | 'GBP' | 'PLN';
414
+ currency?: 'EUR' | 'GBP' | 'PLN' | 'SEK' | 'DKK';
348
415
  }
349
416
  }
350
417
  /**
@@ -356,7 +423,7 @@ export declare namespace OrderRetrieveResponse {
356
423
  }
357
424
  }
358
425
  /**
359
- * The destination bank account where the money will be sent to.
426
+ * @deprecated
360
427
  */
361
428
  interface MerchantFinancialAddress {
362
429
  bankCode?: MerchantFinancialAddress.BankCode;
@@ -606,7 +673,7 @@ export declare namespace OrderRetrieveResponse {
606
673
  * attempt. See [the guide](https://docs.getivy.de/docs/payment-status) for more
607
674
  * information.
608
675
  */
609
- currentStatus: 'failed' | 'canceled' | 'processing' | 'in_handshake' | 'waiting_for_payment' | 'paid' | 'in_refund' | 'refunded' | 'refund_failed' | 'partially_refunded' | 'in_dispute' | 'disputed' | 'refused';
676
+ currentStatus: 'failed' | 'canceled' | 'processing' | 'waiting_for_payment' | 'paid' | 'in_refund' | 'refunded' | 'refund_failed' | 'partially_refunded' | 'in_dispute' | 'disputed' | 'refused';
610
677
  reason: string;
611
678
  updatedAt: string;
612
679
  /**
@@ -614,10 +681,10 @@ export declare namespace OrderRetrieveResponse {
614
681
  * attempt. See [the guide](https://docs.getivy.de/docs/payment-status) for more
615
682
  * information.
616
683
  */
617
- previousStatus?: 'failed' | 'canceled' | 'processing' | 'in_handshake' | 'waiting_for_payment' | 'paid' | 'in_refund' | 'refunded' | 'refund_failed' | 'partially_refunded' | 'in_dispute' | 'disputed' | 'refused' | null;
684
+ previousStatus?: 'failed' | 'canceled' | 'processing' | 'waiting_for_payment' | 'paid' | 'in_refund' | 'refunded' | 'refund_failed' | 'partially_refunded' | 'in_dispute' | 'disputed' | 'refused' | null;
618
685
  }
619
686
  }
620
- export interface OrderUpdateResponse {
687
+ export interface OrderRetrieveResponse {
621
688
  /**
622
689
  * The Ivy unique identifier for the order.
623
690
  */
@@ -643,12 +710,12 @@ export interface OrderUpdateResponse {
643
710
  */
644
711
  merchantId: string;
645
712
  /**
646
- * The price to be paid by the user. All amounts are in decimals, i.e. 10.23
713
+ * The amount to be paid by the user. The amounts is in decimals, i.e. 10.23
647
714
  * represents EUR 10.23. Any amount of decimal places can be provided on
648
715
  * initialization, but the actual transfer amount is rounded to 2 decimal places,
649
716
  * as this is the format accepted by most banks.
650
717
  */
651
- price: OrderUpdateResponse.Price;
718
+ price: OrderRetrieveResponse.Price;
652
719
  /**
653
720
  * An internal reference id which will be stored with the checkout & corresponding
654
721
  * order. Needs to be unique per shop per order and can be up to 200 characters.
@@ -663,17 +730,22 @@ export interface OrderUpdateResponse {
663
730
  * attempt. See [the guide](https://docs.getivy.de/docs/payment-status) for more
664
731
  * information.
665
732
  */
666
- status: 'failed' | 'canceled' | 'processing' | 'in_handshake' | 'waiting_for_payment' | 'paid' | 'in_refund' | 'refunded' | 'refund_failed' | 'partially_refunded' | 'in_dispute' | 'disputed' | 'refused';
733
+ status: 'failed' | 'canceled' | 'processing' | 'waiting_for_payment' | 'paid' | 'in_refund' | 'refunded' | 'refund_failed' | 'partially_refunded' | 'in_dispute' | 'disputed' | 'refused';
667
734
  updatedAt: string;
668
735
  /**
669
- * The bank statement reference of the payment for the order. This is the reference
670
- * that will be visible on the bank statement.
736
+ * The unique identifier of Ivy of the chosen bank to make the payment. Not there,
737
+ * if no payment was made.
738
+ */
739
+ bankId?: string;
740
+ /**
741
+ * @deprecated The bank statement reference of the payment for the order. This is
742
+ * the reference that will be visible on the bank statement.
671
743
  */
672
744
  bankStatementReference?: string;
673
745
  /**
674
746
  * The billing address of the user. Required when handshake=true.
675
747
  */
676
- billingAddress?: OrderUpdateResponse.BillingAddress;
748
+ billingAddress?: OrderRetrieveResponse.BillingAddress;
677
749
  /**
678
750
  * The merchant category code or
679
751
  * [MCC](https://en.wikipedia.org/wiki/Merchant_category_code).
@@ -682,7 +754,7 @@ export interface OrderUpdateResponse {
682
754
  /**
683
755
  * @deprecated
684
756
  */
685
- climateActionMode?: OrderUpdateResponse.ClimateActionMode;
757
+ climateActionMode?: OrderRetrieveResponse.ClimateActionMode;
686
758
  /**
687
759
  * @deprecated
688
760
  */
@@ -691,6 +763,7 @@ export interface OrderUpdateResponse {
691
763
  * The unique identifier of the customer who placed the order.
692
764
  */
693
765
  customerId?: string;
766
+ destination?: OrderRetrieveResponse.Destination;
694
767
  /**
695
768
  * The customer facing id. This id is displayed to the user during the checkout and
696
769
  * in the merchant dashboard.
@@ -716,12 +789,12 @@ export interface OrderUpdateResponse {
716
789
  /**
717
790
  * The line items of the Checkout.
718
791
  */
719
- lineItems?: Array<OrderUpdateResponse.LineItem>;
720
- mandate?: OrderUpdateResponse.Mandate;
792
+ lineItems?: Array<OrderRetrieveResponse.LineItem>;
793
+ mandate?: OrderRetrieveResponse.Mandate;
721
794
  /**
722
- * The destination bank account where the money will be sent to.
795
+ * @deprecated
723
796
  */
724
- merchantFinancialAddress?: OrderUpdateResponse.MerchantFinancialAddress;
797
+ merchantFinancialAddress?: OrderRetrieveResponse.MerchantFinancialAddress;
725
798
  /**
726
799
  * Any data which will be stored and returned for this checkout session and
727
800
  * corresponding order. See [here](https://docs.getivy.de/reference/metadata) for
@@ -736,8 +809,8 @@ export interface OrderUpdateResponse {
736
809
  /**
737
810
  * The source bank account where the money is send from.
738
811
  */
739
- payerFinancialAddress?: OrderUpdateResponse.PayerFinancialAddress;
740
- paymentMethodType?: 'sepa_debit' | 'customer_balance';
812
+ payerFinancialAddress?: OrderRetrieveResponse.PayerFinancialAddress;
813
+ paymentMethodType?: 'sepa_debit' | 'customer_balance' | 'manual_bank_transfer';
741
814
  /**
742
815
  * The payment mode of the order. Can be either 'settlement' or 'direct'.
743
816
  */
@@ -746,7 +819,7 @@ export interface OrderUpdateResponse {
746
819
  * @deprecated Deprecated in favor of `status`. Do not use this field to trigger
747
820
  * actions in your system.
748
821
  */
749
- paymentStatus?: 'failed' | 'canceled' | 'processing' | 'requires_action' | 'succeeded' | 'in_refund' | 'refunded' | 'refund_failed' | 'partially_refunded' | 'not_settled' | 'disputed';
822
+ paymentStatus?: 'failed' | 'canceled' | 'processing' | 'requires_action' | 'succeeded' | 'in_refund' | 'refunded' | 'refund_failed' | 'partially_refunded' | 'not_settled' | 'disputed' | 'frozen_due_to_aml';
750
823
  /**
751
824
  * The total amount in the currency of all successful refunds for this order
752
825
  */
@@ -754,16 +827,16 @@ export interface OrderUpdateResponse {
754
827
  /**
755
828
  * The list of refunds connected to this order.
756
829
  */
757
- refunds?: Array<OrderUpdateResponse.Refund>;
830
+ refunds?: Array<OrderRetrieveResponse.Refund>;
758
831
  /**
759
832
  * The shipping address of the user. This is only collected in express Checkouts.
760
833
  */
761
- shippingAddress?: OrderUpdateResponse.ShippingAddress;
834
+ shippingAddress?: OrderRetrieveResponse.ShippingAddress;
762
835
  /**
763
836
  * The selected shipping method by the user. Can either be selected during an
764
837
  * express Checkout Session or passed during Checkout Session creation.
765
838
  */
766
- shippingMethod?: OrderUpdateResponse.ShippingMethod;
839
+ shippingMethod?: OrderRetrieveResponse.ShippingMethod;
767
840
  /**
768
841
  * The logo of the shop provided as a URL.
769
842
  */
@@ -772,18 +845,18 @@ export interface OrderUpdateResponse {
772
845
  * The shopper object. Contains information collected from the user during the
773
846
  * Checkout.
774
847
  */
775
- shopper?: OrderUpdateResponse.Shopper;
848
+ shopper?: OrderRetrieveResponse.Shopper;
776
849
  /**
777
850
  * @deprecated Deprecated in favor of `shopper.email`. The email of the user if
778
851
  * collected in the Checkout.
779
852
  */
780
853
  shopperEmail?: string;
781
- statusClassification?: OrderUpdateResponse.StatusClassification;
854
+ statusClassification?: OrderRetrieveResponse.StatusClassification;
782
855
  /**
783
856
  * List of status history items for the order, used for logging every update on
784
857
  * status.
785
858
  */
786
- statusHistoryList?: Array<OrderUpdateResponse.StatusHistoryList>;
859
+ statusHistoryList?: Array<OrderRetrieveResponse.StatusHistoryList>;
787
860
  /**
788
861
  * The subaccount id of the order.
789
862
  */
@@ -797,35 +870,22 @@ export interface OrderUpdateResponse {
797
870
  */
798
871
  trees?: number;
799
872
  }
800
- export declare namespace OrderUpdateResponse {
873
+ export declare namespace OrderRetrieveResponse {
801
874
  /**
802
- * The price to be paid by the user. All amounts are in decimals, i.e. 10.23
875
+ * The amount to be paid by the user. The amounts is in decimals, i.e. 10.23
803
876
  * represents EUR 10.23. Any amount of decimal places can be provided on
804
877
  * initialization, but the actual transfer amount is rounded to 2 decimal places,
805
878
  * as this is the format accepted by most banks.
806
879
  */
807
880
  interface Price {
808
- currency: 'EUR' | 'GBP' | 'PLN';
881
+ currency: 'EUR' | 'GBP' | 'PLN' | 'SEK' | 'DKK';
809
882
  /**
810
883
  * The total amount to be paid.
811
884
  */
812
885
  total: number;
813
- /**
814
- * The shipping amount.
815
- */
816
886
  shipping?: number;
817
- /**
818
- * The subtotal amount, i.e. the total amount without VAT and shipping.
819
- */
820
887
  subTotal?: number;
821
- /**
822
- * The total net amount, i.e. the total amount without VAT. This value is rounded
823
- * to 2 decimal places for the actual transfer.
824
- */
825
888
  totalNet?: number;
826
- /**
827
- * The VAT amount.
828
- */
829
889
  vat?: number;
830
890
  }
831
891
  /**
@@ -852,6 +912,76 @@ export declare namespace OrderUpdateResponse {
852
912
  amount: number;
853
913
  type: 'transaction' | 'amount';
854
914
  }
915
+ interface Destination {
916
+ /**
917
+ * The validation logic is based on the "type" field. For example, if "type" is set
918
+ * to "iban", the "iban" object must be filled out.
919
+ */
920
+ bankAccount: Destination.BankAccount;
921
+ /**
922
+ * The bank statement reference of the payment for the order. This is the reference
923
+ * that will be visible on the bank statement.
924
+ */
925
+ bankStatementReference: string;
926
+ }
927
+ namespace Destination {
928
+ /**
929
+ * The validation logic is based on the "type" field. For example, if "type" is set
930
+ * to "iban", the "iban" object must be filled out.
931
+ */
932
+ interface BankAccount {
933
+ /**
934
+ * The type of the financial address. The actual destination is determined by this
935
+ * field which can be either "iban", "sortCode", "bankCode", or "bban". The
936
+ * validation will fail if you set e.g. type="iban", but then not fill any values
937
+ * in the "iban" object.
938
+ *
939
+ * - iban: The IBAN of the account
940
+ * - sort_code: The sort code of the account
941
+ * - bank_code: The bank code of the account
942
+ * - bban: The BBAN of the account
943
+ */
944
+ type: string;
945
+ bankCode?: BankAccount.BankCode;
946
+ bban?: BankAccount.Bban;
947
+ iban?: BankAccount.Iban;
948
+ sortCode?: BankAccount.SortCode;
949
+ }
950
+ namespace BankAccount {
951
+ interface BankCode {
952
+ /**
953
+ * The name of the account holder.
954
+ */
955
+ accountHolderName: string;
956
+ accountNumber: string;
957
+ code: string;
958
+ }
959
+ interface Bban {
960
+ /**
961
+ * The name of the account holder.
962
+ */
963
+ accountHolderName: string;
964
+ bban: string;
965
+ bic?: string;
966
+ }
967
+ interface Iban {
968
+ /**
969
+ * The name of the account holder.
970
+ */
971
+ accountHolderName: string;
972
+ iban: string;
973
+ bic?: string;
974
+ }
975
+ interface SortCode {
976
+ /**
977
+ * The name of the account holder.
978
+ */
979
+ accountHolderName: string;
980
+ accountNumber: string;
981
+ sortCode: string;
982
+ }
983
+ }
984
+ }
855
985
  interface LineItem {
856
986
  /**
857
987
  * The total amount of all line items, i.e. single amount \* quantity. Given in
@@ -949,7 +1079,7 @@ export declare namespace OrderUpdateResponse {
949
1079
  * 10.23 EUR.
950
1080
  */
951
1081
  amount?: number;
952
- currency?: 'EUR' | 'GBP' | 'PLN';
1082
+ currency?: 'EUR' | 'GBP' | 'PLN' | 'SEK' | 'DKK';
953
1083
  }
954
1084
  }
955
1085
  /**
@@ -961,7 +1091,7 @@ export declare namespace OrderUpdateResponse {
961
1091
  }
962
1092
  }
963
1093
  /**
964
- * The destination bank account where the money will be sent to.
1094
+ * @deprecated
965
1095
  */
966
1096
  interface MerchantFinancialAddress {
967
1097
  bankCode?: MerchantFinancialAddress.BankCode;
@@ -1211,7 +1341,7 @@ export declare namespace OrderUpdateResponse {
1211
1341
  * attempt. See [the guide](https://docs.getivy.de/docs/payment-status) for more
1212
1342
  * information.
1213
1343
  */
1214
- currentStatus: 'failed' | 'canceled' | 'processing' | 'in_handshake' | 'waiting_for_payment' | 'paid' | 'in_refund' | 'refunded' | 'refund_failed' | 'partially_refunded' | 'in_dispute' | 'disputed' | 'refused';
1344
+ currentStatus: 'failed' | 'canceled' | 'processing' | 'waiting_for_payment' | 'paid' | 'in_refund' | 'refunded' | 'refund_failed' | 'partially_refunded' | 'in_dispute' | 'disputed' | 'refused';
1215
1345
  reason: string;
1216
1346
  updatedAt: string;
1217
1347
  /**
@@ -1219,37 +1349,53 @@ export declare namespace OrderUpdateResponse {
1219
1349
  * attempt. See [the guide](https://docs.getivy.de/docs/payment-status) for more
1220
1350
  * information.
1221
1351
  */
1222
- previousStatus?: 'failed' | 'canceled' | 'processing' | 'in_handshake' | 'waiting_for_payment' | 'paid' | 'in_refund' | 'refunded' | 'refund_failed' | 'partially_refunded' | 'in_dispute' | 'disputed' | 'refused' | null;
1352
+ previousStatus?: 'failed' | 'canceled' | 'processing' | 'waiting_for_payment' | 'paid' | 'in_refund' | 'refunded' | 'refund_failed' | 'partially_refunded' | 'in_dispute' | 'disputed' | 'refused' | null;
1223
1353
  }
1224
1354
  }
1225
- export interface OrderRetrieveParams {
1226
- id: string;
1227
- }
1228
- export interface OrderUpdateParams {
1229
- id: string;
1355
+ export interface OrderCreateParams {
1230
1356
  /**
1231
- * The customer-facing id of the order. This id will also be shown next to the
1232
- * orders in the Ivy Dashboard.
1357
+ * The total amount of the order
1233
1358
  */
1234
- displayId?: string;
1359
+ amount: number;
1235
1360
  /**
1236
- * An internal reference id which will be stored with the checkout & corresponding
1237
- * order. Needs to be unique per shop per order and can be up to 200 characters. We
1238
- * recommend to use your internal order id here.
1361
+ * The currency code of the order
1239
1362
  */
1240
- referenceId?: string;
1363
+ currency: 'EUR' | 'GBP' | 'PLN' | 'SEK' | 'DKK';
1241
1364
  /**
1242
- * The customer-facing name of the shop.
1365
+ * The merchant's unique reference ID for the order
1243
1366
  */
1244
- shopName?: string;
1367
+ referenceId: string;
1245
1368
  /**
1246
- * The order status. This status symbolises the state of the user's payment
1247
- * attempt. See [the guide](https://docs.getivy.de/docs/payment-status) for more
1248
- * information.
1369
+ * The customer of the merchant.
1249
1370
  */
1250
- status?: 'failed' | 'canceled' | 'processing' | 'in_handshake' | 'waiting_for_payment' | 'paid' | 'in_refund' | 'refunded' | 'refund_failed' | 'partially_refunded' | 'in_dispute' | 'disputed' | 'refused';
1371
+ customer?: OrderCreateParams.Email | OrderCreateParams.ID;
1372
+ /**
1373
+ * Optional expiration timestamp in seconds
1374
+ */
1375
+ expiresAt?: string;
1376
+ /**
1377
+ * The subaccount id of the merchant.
1378
+ */
1379
+ subaccountId?: string;
1380
+ }
1381
+ export declare namespace OrderCreateParams {
1382
+ interface Email {
1383
+ /**
1384
+ * The email of the customer.
1385
+ */
1386
+ email: string;
1387
+ }
1388
+ interface ID {
1389
+ /**
1390
+ * The Ivy id of the customer.
1391
+ */
1392
+ id: string;
1393
+ }
1394
+ }
1395
+ export interface OrderRetrieveParams {
1396
+ id: string;
1251
1397
  }
1252
1398
  export declare namespace Orders {
1253
- export { type OrderRetrieveResponse as OrderRetrieveResponse, type OrderUpdateResponse as OrderUpdateResponse, type OrderRetrieveParams as OrderRetrieveParams, type OrderUpdateParams as OrderUpdateParams, };
1399
+ export { type OrderCreateResponse as OrderCreateResponse, type OrderRetrieveResponse as OrderRetrieveResponse, type OrderCreateParams as OrderCreateParams, type OrderRetrieveParams as OrderRetrieveParams, };
1254
1400
  }
1255
1401
  //# sourceMappingURL=orders.d.ts.map