@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
@@ -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
@@ -12,16 +23,9 @@ export class Orders extends APIResource {
12
23
  retrieve(body: OrderRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<OrderRetrieveResponse> {
13
24
  return this._client.post('/api/service/order/details', { body, ...options });
14
25
  }
15
-
16
- /**
17
- * Update certain fields of the specified order.
18
- */
19
- update(body: OrderUpdateParams, options?: Core.RequestOptions): Core.APIPromise<OrderUpdateResponse> {
20
- return this._client.post('/api/service/order/update', { body, ...options });
21
- }
22
26
  }
23
27
 
24
- export interface OrderRetrieveResponse {
28
+ export interface OrderCreateResponse {
25
29
  /**
26
30
  * The Ivy unique identifier for the order.
27
31
  */
@@ -54,12 +58,12 @@ export interface OrderRetrieveResponse {
54
58
  merchantId: string;
55
59
 
56
60
  /**
57
- * The price to be paid by the user. All amounts are in decimals, i.e. 10.23
61
+ * The amount to be paid by the user. The amounts is in decimals, i.e. 10.23
58
62
  * represents EUR 10.23. Any amount of decimal places can be provided on
59
63
  * initialization, but the actual transfer amount is rounded to 2 decimal places,
60
64
  * as this is the format accepted by most banks.
61
65
  */
62
- price: OrderRetrieveResponse.Price;
66
+ price: OrderCreateResponse.Price;
63
67
 
64
68
  /**
65
69
  * An internal reference id which will be stored with the checkout & corresponding
@@ -81,7 +85,6 @@ export interface OrderRetrieveResponse {
81
85
  | 'failed'
82
86
  | 'canceled'
83
87
  | 'processing'
84
- | 'in_handshake'
85
88
  | 'waiting_for_payment'
86
89
  | 'paid'
87
90
  | 'in_refund'
@@ -95,15 +98,21 @@ export interface OrderRetrieveResponse {
95
98
  updatedAt: string;
96
99
 
97
100
  /**
98
- * The bank statement reference of the payment for the order. This is the reference
99
- * that will be visible on the bank statement.
101
+ * The unique identifier of Ivy of the chosen bank to make the payment. Not there,
102
+ * if no payment was made.
103
+ */
104
+ bankId?: string;
105
+
106
+ /**
107
+ * @deprecated The bank statement reference of the payment for the order. This is
108
+ * the reference that will be visible on the bank statement.
100
109
  */
101
110
  bankStatementReference?: string;
102
111
 
103
112
  /**
104
113
  * The billing address of the user. Required when handshake=true.
105
114
  */
106
- billingAddress?: OrderRetrieveResponse.BillingAddress;
115
+ billingAddress?: OrderCreateResponse.BillingAddress;
107
116
 
108
117
  /**
109
118
  * The merchant category code or
@@ -114,7 +123,7 @@ export interface OrderRetrieveResponse {
114
123
  /**
115
124
  * @deprecated
116
125
  */
117
- climateActionMode?: OrderRetrieveResponse.ClimateActionMode;
126
+ climateActionMode?: OrderCreateResponse.ClimateActionMode;
118
127
 
119
128
  /**
120
129
  * @deprecated
@@ -126,6 +135,8 @@ export interface OrderRetrieveResponse {
126
135
  */
127
136
  customerId?: string;
128
137
 
138
+ destination?: OrderCreateResponse.Destination;
139
+
129
140
  /**
130
141
  * The customer facing id. This id is displayed to the user during the checkout and
131
142
  * in the merchant dashboard.
@@ -155,14 +166,14 @@ export interface OrderRetrieveResponse {
155
166
  /**
156
167
  * The line items of the Checkout.
157
168
  */
158
- lineItems?: Array<OrderRetrieveResponse.LineItem>;
169
+ lineItems?: Array<OrderCreateResponse.LineItem>;
159
170
 
160
- mandate?: OrderRetrieveResponse.Mandate;
171
+ mandate?: OrderCreateResponse.Mandate;
161
172
 
162
173
  /**
163
- * The destination bank account where the money will be sent to.
174
+ * @deprecated
164
175
  */
165
- merchantFinancialAddress?: OrderRetrieveResponse.MerchantFinancialAddress;
176
+ merchantFinancialAddress?: OrderCreateResponse.MerchantFinancialAddress;
166
177
 
167
178
  /**
168
179
  * Any data which will be stored and returned for this checkout session and
@@ -180,9 +191,9 @@ export interface OrderRetrieveResponse {
180
191
  /**
181
192
  * The source bank account where the money is send from.
182
193
  */
183
- payerFinancialAddress?: OrderRetrieveResponse.PayerFinancialAddress;
194
+ payerFinancialAddress?: OrderCreateResponse.PayerFinancialAddress;
184
195
 
185
- paymentMethodType?: 'sepa_debit' | 'customer_balance';
196
+ paymentMethodType?: 'sepa_debit' | 'customer_balance' | 'manual_bank_transfer';
186
197
 
187
198
  /**
188
199
  * The payment mode of the order. Can be either 'settlement' or 'direct'.
@@ -204,7 +215,8 @@ export interface OrderRetrieveResponse {
204
215
  | 'refund_failed'
205
216
  | 'partially_refunded'
206
217
  | 'not_settled'
207
- | 'disputed';
218
+ | 'disputed'
219
+ | 'frozen_due_to_aml';
208
220
 
209
221
  /**
210
222
  * The total amount in the currency of all successful refunds for this order
@@ -214,18 +226,18 @@ export interface OrderRetrieveResponse {
214
226
  /**
215
227
  * The list of refunds connected to this order.
216
228
  */
217
- refunds?: Array<OrderRetrieveResponse.Refund>;
229
+ refunds?: Array<OrderCreateResponse.Refund>;
218
230
 
219
231
  /**
220
232
  * The shipping address of the user. This is only collected in express Checkouts.
221
233
  */
222
- shippingAddress?: OrderRetrieveResponse.ShippingAddress;
234
+ shippingAddress?: OrderCreateResponse.ShippingAddress;
223
235
 
224
236
  /**
225
237
  * The selected shipping method by the user. Can either be selected during an
226
238
  * express Checkout Session or passed during Checkout Session creation.
227
239
  */
228
- shippingMethod?: OrderRetrieveResponse.ShippingMethod;
240
+ shippingMethod?: OrderCreateResponse.ShippingMethod;
229
241
 
230
242
  /**
231
243
  * The logo of the shop provided as a URL.
@@ -236,7 +248,7 @@ export interface OrderRetrieveResponse {
236
248
  * The shopper object. Contains information collected from the user during the
237
249
  * Checkout.
238
250
  */
239
- shopper?: OrderRetrieveResponse.Shopper;
251
+ shopper?: OrderCreateResponse.Shopper;
240
252
 
241
253
  /**
242
254
  * @deprecated Deprecated in favor of `shopper.email`. The email of the user if
@@ -244,13 +256,13 @@ export interface OrderRetrieveResponse {
244
256
  */
245
257
  shopperEmail?: string;
246
258
 
247
- statusClassification?: OrderRetrieveResponse.StatusClassification;
259
+ statusClassification?: OrderCreateResponse.StatusClassification;
248
260
 
249
261
  /**
250
262
  * List of status history items for the order, used for logging every update on
251
263
  * status.
252
264
  */
253
- statusHistoryList?: Array<OrderRetrieveResponse.StatusHistoryList>;
265
+ statusHistoryList?: Array<OrderCreateResponse.StatusHistoryList>;
254
266
 
255
267
  /**
256
268
  * The subaccount id of the order.
@@ -268,40 +280,27 @@ export interface OrderRetrieveResponse {
268
280
  trees?: number;
269
281
  }
270
282
 
271
- export namespace OrderRetrieveResponse {
283
+ export namespace OrderCreateResponse {
272
284
  /**
273
- * The price to be paid by the user. All amounts are in decimals, i.e. 10.23
285
+ * The amount to be paid by the user. The amounts is in decimals, i.e. 10.23
274
286
  * represents EUR 10.23. Any amount of decimal places can be provided on
275
287
  * initialization, but the actual transfer amount is rounded to 2 decimal places,
276
288
  * as this is the format accepted by most banks.
277
289
  */
278
290
  export interface Price {
279
- currency: 'EUR' | 'GBP' | 'PLN';
291
+ currency: 'EUR' | 'GBP' | 'PLN' | 'SEK' | 'DKK';
280
292
 
281
293
  /**
282
294
  * The total amount to be paid.
283
295
  */
284
296
  total: number;
285
297
 
286
- /**
287
- * The shipping amount.
288
- */
289
298
  shipping?: number;
290
299
 
291
- /**
292
- * The subtotal amount, i.e. the total amount without VAT and shipping.
293
- */
294
300
  subTotal?: number;
295
301
 
296
- /**
297
- * The total net amount, i.e. the total amount without VAT. This value is rounded
298
- * to 2 decimal places for the actual transfer.
299
- */
300
302
  totalNet?: number;
301
303
 
302
- /**
303
- * The VAT amount.
304
- */
305
304
  vat?: number;
306
305
  }
307
306
 
@@ -589,6 +588,95 @@ export namespace OrderRetrieveResponse {
589
588
  type: 'transaction' | 'amount';
590
589
  }
591
590
 
591
+ export interface Destination {
592
+ /**
593
+ * The validation logic is based on the "type" field. For example, if "type" is set
594
+ * to "iban", the "iban" object must be filled out.
595
+ */
596
+ bankAccount: Destination.BankAccount;
597
+
598
+ /**
599
+ * The bank statement reference of the payment for the order. This is the reference
600
+ * that will be visible on the bank statement.
601
+ */
602
+ bankStatementReference: string;
603
+ }
604
+
605
+ export namespace Destination {
606
+ /**
607
+ * The validation logic is based on the "type" field. For example, if "type" is set
608
+ * to "iban", the "iban" object must be filled out.
609
+ */
610
+ export interface BankAccount {
611
+ /**
612
+ * The type of the financial address. The actual destination is determined by this
613
+ * field which can be either "iban", "sortCode", "bankCode", or "bban". The
614
+ * validation will fail if you set e.g. type="iban", but then not fill any values
615
+ * in the "iban" object.
616
+ *
617
+ * - iban: The IBAN of the account
618
+ * - sort_code: The sort code of the account
619
+ * - bank_code: The bank code of the account
620
+ * - bban: The BBAN of the account
621
+ */
622
+ type: string;
623
+
624
+ bankCode?: BankAccount.BankCode;
625
+
626
+ bban?: BankAccount.Bban;
627
+
628
+ iban?: BankAccount.Iban;
629
+
630
+ sortCode?: BankAccount.SortCode;
631
+ }
632
+
633
+ export namespace BankAccount {
634
+ export interface BankCode {
635
+ /**
636
+ * The name of the account holder.
637
+ */
638
+ accountHolderName: string;
639
+
640
+ accountNumber: string;
641
+
642
+ code: string;
643
+ }
644
+
645
+ export interface Bban {
646
+ /**
647
+ * The name of the account holder.
648
+ */
649
+ accountHolderName: string;
650
+
651
+ bban: string;
652
+
653
+ bic?: string;
654
+ }
655
+
656
+ export interface Iban {
657
+ /**
658
+ * The name of the account holder.
659
+ */
660
+ accountHolderName: string;
661
+
662
+ iban: string;
663
+
664
+ bic?: string;
665
+ }
666
+
667
+ export interface SortCode {
668
+ /**
669
+ * The name of the account holder.
670
+ */
671
+ accountHolderName: string;
672
+
673
+ accountNumber: string;
674
+
675
+ sortCode: string;
676
+ }
677
+ }
678
+ }
679
+
592
680
  export interface LineItem {
593
681
  /**
594
682
  * The total amount of all line items, i.e. single amount \* quantity. Given in
@@ -705,7 +793,7 @@ export namespace OrderRetrieveResponse {
705
793
  */
706
794
  amount?: number;
707
795
 
708
- currency?: 'EUR' | 'GBP' | 'PLN';
796
+ currency?: 'EUR' | 'GBP' | 'PLN' | 'SEK' | 'DKK';
709
797
  }
710
798
  }
711
799
 
@@ -720,7 +808,7 @@ export namespace OrderRetrieveResponse {
720
808
  }
721
809
 
722
810
  /**
723
- * The destination bank account where the money will be sent to.
811
+ * @deprecated
724
812
  */
725
813
  export interface MerchantFinancialAddress {
726
814
  bankCode?: MerchantFinancialAddress.BankCode;
@@ -1542,7 +1630,6 @@ export namespace OrderRetrieveResponse {
1542
1630
  | 'failed'
1543
1631
  | 'canceled'
1544
1632
  | 'processing'
1545
- | 'in_handshake'
1546
1633
  | 'waiting_for_payment'
1547
1634
  | 'paid'
1548
1635
  | 'in_refund'
@@ -1566,7 +1653,6 @@ export namespace OrderRetrieveResponse {
1566
1653
  | 'failed'
1567
1654
  | 'canceled'
1568
1655
  | 'processing'
1569
- | 'in_handshake'
1570
1656
  | 'waiting_for_payment'
1571
1657
  | 'paid'
1572
1658
  | 'in_refund'
@@ -1580,7 +1666,7 @@ export namespace OrderRetrieveResponse {
1580
1666
  }
1581
1667
  }
1582
1668
 
1583
- export interface OrderUpdateResponse {
1669
+ export interface OrderRetrieveResponse {
1584
1670
  /**
1585
1671
  * The Ivy unique identifier for the order.
1586
1672
  */
@@ -1613,12 +1699,12 @@ export interface OrderUpdateResponse {
1613
1699
  merchantId: string;
1614
1700
 
1615
1701
  /**
1616
- * The price to be paid by the user. All amounts are in decimals, i.e. 10.23
1702
+ * The amount to be paid by the user. The amounts is in decimals, i.e. 10.23
1617
1703
  * represents EUR 10.23. Any amount of decimal places can be provided on
1618
1704
  * initialization, but the actual transfer amount is rounded to 2 decimal places,
1619
1705
  * as this is the format accepted by most banks.
1620
1706
  */
1621
- price: OrderUpdateResponse.Price;
1707
+ price: OrderRetrieveResponse.Price;
1622
1708
 
1623
1709
  /**
1624
1710
  * An internal reference id which will be stored with the checkout & corresponding
@@ -1640,7 +1726,6 @@ export interface OrderUpdateResponse {
1640
1726
  | 'failed'
1641
1727
  | 'canceled'
1642
1728
  | 'processing'
1643
- | 'in_handshake'
1644
1729
  | 'waiting_for_payment'
1645
1730
  | 'paid'
1646
1731
  | 'in_refund'
@@ -1654,15 +1739,21 @@ export interface OrderUpdateResponse {
1654
1739
  updatedAt: string;
1655
1740
 
1656
1741
  /**
1657
- * The bank statement reference of the payment for the order. This is the reference
1658
- * that will be visible on the bank statement.
1742
+ * The unique identifier of Ivy of the chosen bank to make the payment. Not there,
1743
+ * if no payment was made.
1744
+ */
1745
+ bankId?: string;
1746
+
1747
+ /**
1748
+ * @deprecated The bank statement reference of the payment for the order. This is
1749
+ * the reference that will be visible on the bank statement.
1659
1750
  */
1660
1751
  bankStatementReference?: string;
1661
1752
 
1662
1753
  /**
1663
1754
  * The billing address of the user. Required when handshake=true.
1664
1755
  */
1665
- billingAddress?: OrderUpdateResponse.BillingAddress;
1756
+ billingAddress?: OrderRetrieveResponse.BillingAddress;
1666
1757
 
1667
1758
  /**
1668
1759
  * The merchant category code or
@@ -1673,7 +1764,7 @@ export interface OrderUpdateResponse {
1673
1764
  /**
1674
1765
  * @deprecated
1675
1766
  */
1676
- climateActionMode?: OrderUpdateResponse.ClimateActionMode;
1767
+ climateActionMode?: OrderRetrieveResponse.ClimateActionMode;
1677
1768
 
1678
1769
  /**
1679
1770
  * @deprecated
@@ -1685,6 +1776,8 @@ export interface OrderUpdateResponse {
1685
1776
  */
1686
1777
  customerId?: string;
1687
1778
 
1779
+ destination?: OrderRetrieveResponse.Destination;
1780
+
1688
1781
  /**
1689
1782
  * The customer facing id. This id is displayed to the user during the checkout and
1690
1783
  * in the merchant dashboard.
@@ -1714,14 +1807,14 @@ export interface OrderUpdateResponse {
1714
1807
  /**
1715
1808
  * The line items of the Checkout.
1716
1809
  */
1717
- lineItems?: Array<OrderUpdateResponse.LineItem>;
1810
+ lineItems?: Array<OrderRetrieveResponse.LineItem>;
1718
1811
 
1719
- mandate?: OrderUpdateResponse.Mandate;
1812
+ mandate?: OrderRetrieveResponse.Mandate;
1720
1813
 
1721
1814
  /**
1722
- * The destination bank account where the money will be sent to.
1815
+ * @deprecated
1723
1816
  */
1724
- merchantFinancialAddress?: OrderUpdateResponse.MerchantFinancialAddress;
1817
+ merchantFinancialAddress?: OrderRetrieveResponse.MerchantFinancialAddress;
1725
1818
 
1726
1819
  /**
1727
1820
  * Any data which will be stored and returned for this checkout session and
@@ -1739,9 +1832,9 @@ export interface OrderUpdateResponse {
1739
1832
  /**
1740
1833
  * The source bank account where the money is send from.
1741
1834
  */
1742
- payerFinancialAddress?: OrderUpdateResponse.PayerFinancialAddress;
1835
+ payerFinancialAddress?: OrderRetrieveResponse.PayerFinancialAddress;
1743
1836
 
1744
- paymentMethodType?: 'sepa_debit' | 'customer_balance';
1837
+ paymentMethodType?: 'sepa_debit' | 'customer_balance' | 'manual_bank_transfer';
1745
1838
 
1746
1839
  /**
1747
1840
  * The payment mode of the order. Can be either 'settlement' or 'direct'.
@@ -1763,7 +1856,8 @@ export interface OrderUpdateResponse {
1763
1856
  | 'refund_failed'
1764
1857
  | 'partially_refunded'
1765
1858
  | 'not_settled'
1766
- | 'disputed';
1859
+ | 'disputed'
1860
+ | 'frozen_due_to_aml';
1767
1861
 
1768
1862
  /**
1769
1863
  * The total amount in the currency of all successful refunds for this order
@@ -1773,18 +1867,18 @@ export interface OrderUpdateResponse {
1773
1867
  /**
1774
1868
  * The list of refunds connected to this order.
1775
1869
  */
1776
- refunds?: Array<OrderUpdateResponse.Refund>;
1870
+ refunds?: Array<OrderRetrieveResponse.Refund>;
1777
1871
 
1778
1872
  /**
1779
1873
  * The shipping address of the user. This is only collected in express Checkouts.
1780
1874
  */
1781
- shippingAddress?: OrderUpdateResponse.ShippingAddress;
1875
+ shippingAddress?: OrderRetrieveResponse.ShippingAddress;
1782
1876
 
1783
1877
  /**
1784
1878
  * The selected shipping method by the user. Can either be selected during an
1785
1879
  * express Checkout Session or passed during Checkout Session creation.
1786
1880
  */
1787
- shippingMethod?: OrderUpdateResponse.ShippingMethod;
1881
+ shippingMethod?: OrderRetrieveResponse.ShippingMethod;
1788
1882
 
1789
1883
  /**
1790
1884
  * The logo of the shop provided as a URL.
@@ -1795,7 +1889,7 @@ export interface OrderUpdateResponse {
1795
1889
  * The shopper object. Contains information collected from the user during the
1796
1890
  * Checkout.
1797
1891
  */
1798
- shopper?: OrderUpdateResponse.Shopper;
1892
+ shopper?: OrderRetrieveResponse.Shopper;
1799
1893
 
1800
1894
  /**
1801
1895
  * @deprecated Deprecated in favor of `shopper.email`. The email of the user if
@@ -1803,13 +1897,13 @@ export interface OrderUpdateResponse {
1803
1897
  */
1804
1898
  shopperEmail?: string;
1805
1899
 
1806
- statusClassification?: OrderUpdateResponse.StatusClassification;
1900
+ statusClassification?: OrderRetrieveResponse.StatusClassification;
1807
1901
 
1808
1902
  /**
1809
1903
  * List of status history items for the order, used for logging every update on
1810
1904
  * status.
1811
1905
  */
1812
- statusHistoryList?: Array<OrderUpdateResponse.StatusHistoryList>;
1906
+ statusHistoryList?: Array<OrderRetrieveResponse.StatusHistoryList>;
1813
1907
 
1814
1908
  /**
1815
1909
  * The subaccount id of the order.
@@ -1827,40 +1921,27 @@ export interface OrderUpdateResponse {
1827
1921
  trees?: number;
1828
1922
  }
1829
1923
 
1830
- export namespace OrderUpdateResponse {
1924
+ export namespace OrderRetrieveResponse {
1831
1925
  /**
1832
- * The price to be paid by the user. All amounts are in decimals, i.e. 10.23
1926
+ * The amount to be paid by the user. The amounts is in decimals, i.e. 10.23
1833
1927
  * represents EUR 10.23. Any amount of decimal places can be provided on
1834
1928
  * initialization, but the actual transfer amount is rounded to 2 decimal places,
1835
1929
  * as this is the format accepted by most banks.
1836
1930
  */
1837
1931
  export interface Price {
1838
- currency: 'EUR' | 'GBP' | 'PLN';
1932
+ currency: 'EUR' | 'GBP' | 'PLN' | 'SEK' | 'DKK';
1839
1933
 
1840
1934
  /**
1841
1935
  * The total amount to be paid.
1842
1936
  */
1843
1937
  total: number;
1844
1938
 
1845
- /**
1846
- * The shipping amount.
1847
- */
1848
1939
  shipping?: number;
1849
1940
 
1850
- /**
1851
- * The subtotal amount, i.e. the total amount without VAT and shipping.
1852
- */
1853
1941
  subTotal?: number;
1854
1942
 
1855
- /**
1856
- * The total net amount, i.e. the total amount without VAT. This value is rounded
1857
- * to 2 decimal places for the actual transfer.
1858
- */
1859
1943
  totalNet?: number;
1860
1944
 
1861
- /**
1862
- * The VAT amount.
1863
- */
1864
1945
  vat?: number;
1865
1946
  }
1866
1947
 
@@ -2148,6 +2229,95 @@ export namespace OrderUpdateResponse {
2148
2229
  type: 'transaction' | 'amount';
2149
2230
  }
2150
2231
 
2232
+ export interface Destination {
2233
+ /**
2234
+ * The validation logic is based on the "type" field. For example, if "type" is set
2235
+ * to "iban", the "iban" object must be filled out.
2236
+ */
2237
+ bankAccount: Destination.BankAccount;
2238
+
2239
+ /**
2240
+ * The bank statement reference of the payment for the order. This is the reference
2241
+ * that will be visible on the bank statement.
2242
+ */
2243
+ bankStatementReference: string;
2244
+ }
2245
+
2246
+ export namespace Destination {
2247
+ /**
2248
+ * The validation logic is based on the "type" field. For example, if "type" is set
2249
+ * to "iban", the "iban" object must be filled out.
2250
+ */
2251
+ export interface BankAccount {
2252
+ /**
2253
+ * The type of the financial address. The actual destination is determined by this
2254
+ * field which can be either "iban", "sortCode", "bankCode", or "bban". The
2255
+ * validation will fail if you set e.g. type="iban", but then not fill any values
2256
+ * in the "iban" object.
2257
+ *
2258
+ * - iban: The IBAN of the account
2259
+ * - sort_code: The sort code of the account
2260
+ * - bank_code: The bank code of the account
2261
+ * - bban: The BBAN of the account
2262
+ */
2263
+ type: string;
2264
+
2265
+ bankCode?: BankAccount.BankCode;
2266
+
2267
+ bban?: BankAccount.Bban;
2268
+
2269
+ iban?: BankAccount.Iban;
2270
+
2271
+ sortCode?: BankAccount.SortCode;
2272
+ }
2273
+
2274
+ export namespace BankAccount {
2275
+ export interface BankCode {
2276
+ /**
2277
+ * The name of the account holder.
2278
+ */
2279
+ accountHolderName: string;
2280
+
2281
+ accountNumber: string;
2282
+
2283
+ code: string;
2284
+ }
2285
+
2286
+ export interface Bban {
2287
+ /**
2288
+ * The name of the account holder.
2289
+ */
2290
+ accountHolderName: string;
2291
+
2292
+ bban: string;
2293
+
2294
+ bic?: string;
2295
+ }
2296
+
2297
+ export interface Iban {
2298
+ /**
2299
+ * The name of the account holder.
2300
+ */
2301
+ accountHolderName: string;
2302
+
2303
+ iban: string;
2304
+
2305
+ bic?: string;
2306
+ }
2307
+
2308
+ export interface SortCode {
2309
+ /**
2310
+ * The name of the account holder.
2311
+ */
2312
+ accountHolderName: string;
2313
+
2314
+ accountNumber: string;
2315
+
2316
+ sortCode: string;
2317
+ }
2318
+ }
2319
+ }
2320
+
2151
2321
  export interface LineItem {
2152
2322
  /**
2153
2323
  * The total amount of all line items, i.e. single amount \* quantity. Given in
@@ -2264,7 +2434,7 @@ export namespace OrderUpdateResponse {
2264
2434
  */
2265
2435
  amount?: number;
2266
2436
 
2267
- currency?: 'EUR' | 'GBP' | 'PLN';
2437
+ currency?: 'EUR' | 'GBP' | 'PLN' | 'SEK' | 'DKK';
2268
2438
  }
2269
2439
  }
2270
2440
 
@@ -2279,7 +2449,7 @@ export namespace OrderUpdateResponse {
2279
2449
  }
2280
2450
 
2281
2451
  /**
2282
- * The destination bank account where the money will be sent to.
2452
+ * @deprecated
2283
2453
  */
2284
2454
  export interface MerchantFinancialAddress {
2285
2455
  bankCode?: MerchantFinancialAddress.BankCode;
@@ -3101,7 +3271,6 @@ export namespace OrderUpdateResponse {
3101
3271
  | 'failed'
3102
3272
  | 'canceled'
3103
3273
  | 'processing'
3104
- | 'in_handshake'
3105
3274
  | 'waiting_for_payment'
3106
3275
  | 'paid'
3107
3276
  | 'in_refund'
@@ -3125,7 +3294,6 @@ export namespace OrderUpdateResponse {
3125
3294
  | 'failed'
3126
3295
  | 'canceled'
3127
3296
  | 'processing'
3128
- | 'in_handshake'
3129
3297
  | 'waiting_for_payment'
3130
3298
  | 'paid'
3131
3299
  | 'in_refund'
@@ -3139,57 +3307,63 @@ export namespace OrderUpdateResponse {
3139
3307
  }
3140
3308
  }
3141
3309
 
3142
- export interface OrderRetrieveParams {
3143
- id: string;
3144
- }
3310
+ export interface OrderCreateParams {
3311
+ /**
3312
+ * The total amount of the order
3313
+ */
3314
+ amount: number;
3145
3315
 
3146
- export interface OrderUpdateParams {
3147
- id: string;
3316
+ /**
3317
+ * The currency code of the order
3318
+ */
3319
+ currency: 'EUR' | 'GBP' | 'PLN' | 'SEK' | 'DKK';
3148
3320
 
3149
3321
  /**
3150
- * The customer-facing id of the order. This id will also be shown next to the
3151
- * orders in the Ivy Dashboard.
3322
+ * The merchant's unique reference ID for the order
3152
3323
  */
3153
- displayId?: string;
3324
+ referenceId: string;
3154
3325
 
3155
3326
  /**
3156
- * An internal reference id which will be stored with the checkout & corresponding
3157
- * order. Needs to be unique per shop per order and can be up to 200 characters. We
3158
- * recommend to use your internal order id here.
3327
+ * The customer of the merchant.
3159
3328
  */
3160
- referenceId?: string;
3329
+ customer?: OrderCreateParams.Email | OrderCreateParams.ID;
3161
3330
 
3162
3331
  /**
3163
- * The customer-facing name of the shop.
3332
+ * Optional expiration timestamp in seconds
3164
3333
  */
3165
- shopName?: string;
3334
+ expiresAt?: string;
3166
3335
 
3167
3336
  /**
3168
- * The order status. This status symbolises the state of the user's payment
3169
- * attempt. See [the guide](https://docs.getivy.de/docs/payment-status) for more
3170
- * information.
3337
+ * The subaccount id of the merchant.
3171
3338
  */
3172
- status?:
3173
- | 'failed'
3174
- | 'canceled'
3175
- | 'processing'
3176
- | 'in_handshake'
3177
- | 'waiting_for_payment'
3178
- | 'paid'
3179
- | 'in_refund'
3180
- | 'refunded'
3181
- | 'refund_failed'
3182
- | 'partially_refunded'
3183
- | 'in_dispute'
3184
- | 'disputed'
3185
- | 'refused';
3339
+ subaccountId?: string;
3340
+ }
3341
+
3342
+ export namespace OrderCreateParams {
3343
+ export interface Email {
3344
+ /**
3345
+ * The email of the customer.
3346
+ */
3347
+ email: string;
3348
+ }
3349
+
3350
+ export interface ID {
3351
+ /**
3352
+ * The Ivy id of the customer.
3353
+ */
3354
+ id: string;
3355
+ }
3356
+ }
3357
+
3358
+ export interface OrderRetrieveParams {
3359
+ id: string;
3186
3360
  }
3187
3361
 
3188
3362
  export declare namespace Orders {
3189
3363
  export {
3364
+ type OrderCreateResponse as OrderCreateResponse,
3190
3365
  type OrderRetrieveResponse as OrderRetrieveResponse,
3191
- type OrderUpdateResponse as OrderUpdateResponse,
3366
+ type OrderCreateParams as OrderCreateParams,
3192
3367
  type OrderRetrieveParams as OrderRetrieveParams,
3193
- type OrderUpdateParams as OrderUpdateParams,
3194
3368
  };
3195
3369
  }