@getivy/node-sdk 0.1.0-alpha.2 → 0.1.0-alpha.21

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