@getivy/node-sdk 0.1.0-alpha.20 → 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.
@@ -1,12 +1,684 @@
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
- retrieve(body: OrderRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<OrderRetrieveResponse>;
13
+ retrieve(body: OrderRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<OrderRetrieveResponse>;
14
+ }
15
+ export interface OrderCreateResponse {
16
+ /**
17
+ * The Ivy unique identifier for the order.
18
+ */
19
+ id: string;
20
+ /**
21
+ * @deprecated The unique identifier for the merchantApp which initiated the order
22
+ * / payment attempt.
23
+ */
24
+ appId: string;
25
+ /**
26
+ * The Ivy fee for the payment.
27
+ */
28
+ applicationFeeAmount: number;
29
+ createdAt: string;
30
+ instantPaymentScheme: boolean;
31
+ /**
32
+ * @deprecated Deprecated in favor of `appId`.
33
+ */
34
+ merchantAppId: string;
35
+ /**
36
+ * The unique identifier for the merchant which initiated the order / payment
37
+ * attempt.
38
+ */
39
+ merchantId: string;
40
+ /**
41
+ * The amount to be paid by the user. The amounts is in decimals, i.e. 10.23
42
+ * represents EUR 10.23. Any amount of decimal places can be provided on
43
+ * initialization, but the actual transfer amount is rounded to 2 decimal places,
44
+ * as this is the format accepted by most banks.
45
+ */
46
+ price: OrderCreateResponse.Price;
47
+ /**
48
+ * An internal reference id which will be stored with the checkout & corresponding
49
+ * order. Needs to be unique per shop per order and can be up to 200 characters.
50
+ */
51
+ referenceId: string;
52
+ /**
53
+ * The name of the merchant which initiated the order.
54
+ */
55
+ shopName: string;
56
+ /**
57
+ * The order status. This status symbolises the state of the user's payment
58
+ * attempt. See [the guide](https://docs.getivy.de/docs/payment-status) for more
59
+ * information.
60
+ */
61
+ status: 'failed' | 'canceled' | 'processing' | 'waiting_for_payment' | 'paid' | 'in_refund' | 'refunded' | 'refund_failed' | 'partially_refunded' | 'in_dispute' | 'disputed' | 'refused';
62
+ updatedAt: string;
63
+ /**
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.
71
+ */
72
+ bankStatementReference?: string;
73
+ /**
74
+ * The billing address of the user. Required when handshake=true.
75
+ */
76
+ billingAddress?: OrderCreateResponse.BillingAddress;
77
+ /**
78
+ * The merchant category code or
79
+ * [MCC](https://en.wikipedia.org/wiki/Merchant_category_code).
80
+ */
81
+ category?: string;
82
+ /**
83
+ * @deprecated
84
+ */
85
+ climateActionMode?: OrderCreateResponse.ClimateActionMode;
86
+ /**
87
+ * @deprecated
88
+ */
89
+ co2Grams?: number;
90
+ /**
91
+ * The unique identifier of the customer who placed the order.
92
+ */
93
+ customerId?: string;
94
+ destination?: OrderCreateResponse.Destination;
95
+ /**
96
+ * The customer facing id. This id is displayed to the user during the checkout and
97
+ * in the merchant dashboard.
98
+ */
99
+ displayId?: string;
100
+ /**
101
+ * False by default. If set to true, customers skip email input and jump directly
102
+ * to their bank login. For express Checkout Sessions this is always false.
103
+ */
104
+ guest?: boolean;
105
+ /**
106
+ * Only valid for sustainable incentive mode. The social / sustainable projects
107
+ * available to the user during Checkout.
108
+ */
109
+ impactOffsetProjects?: Array<string>;
110
+ /**
111
+ * The incentive mode of the checkout session. For any use-case apart from
112
+ * e-commerce, please use `white_label` as the value. If set to `white_label`, the
113
+ * checkout session will be white labeled. If set to `sustainable`, the checkout
114
+ * session will contain sustainable incentives for users.
115
+ */
116
+ incentiveMode?: 'white_label' | 'sustainable';
117
+ /**
118
+ * The line items of the Checkout.
119
+ */
120
+ lineItems?: Array<OrderCreateResponse.LineItem>;
121
+ mandate?: OrderCreateResponse.Mandate;
122
+ /**
123
+ * @deprecated
124
+ */
125
+ merchantFinancialAddress?: OrderCreateResponse.MerchantFinancialAddress;
126
+ /**
127
+ * Any data which will be stored and returned for this checkout session and
128
+ * corresponding order. See [here](https://docs.getivy.de/reference/metadata) for
129
+ * more info.
130
+ */
131
+ metadata?: Record<string, unknown>;
132
+ /**
133
+ * Only valid for sustainable incentive mode. The social / sustainability project
134
+ * chosen by the user during Checkout.
135
+ */
136
+ offsetProject?: string;
137
+ /**
138
+ * The source bank account where the money is send from.
139
+ */
140
+ payerFinancialAddress?: OrderCreateResponse.PayerFinancialAddress;
141
+ paymentMethodType?: 'sepa_debit' | 'customer_balance' | 'manual_bank_transfer';
142
+ /**
143
+ * The payment mode of the order. Can be either 'settlement' or 'direct'.
144
+ */
145
+ paymentMode?: 'settlement' | 'direct';
146
+ /**
147
+ * @deprecated Deprecated in favor of `status`. Do not use this field to trigger
148
+ * actions in your system.
149
+ */
150
+ paymentStatus?: 'failed' | 'canceled' | 'processing' | 'requires_action' | 'succeeded' | 'in_refund' | 'refunded' | 'refund_failed' | 'partially_refunded' | 'not_settled' | 'disputed' | 'frozen_due_to_aml';
151
+ /**
152
+ * The total amount in the currency of all successful refunds for this order
153
+ */
154
+ refundAmount?: number;
155
+ /**
156
+ * The list of refunds connected to this order.
157
+ */
158
+ refunds?: Array<OrderCreateResponse.Refund>;
159
+ /**
160
+ * The shipping address of the user. This is only collected in express Checkouts.
161
+ */
162
+ shippingAddress?: OrderCreateResponse.ShippingAddress;
163
+ /**
164
+ * The selected shipping method by the user. Can either be selected during an
165
+ * express Checkout Session or passed during Checkout Session creation.
166
+ */
167
+ shippingMethod?: OrderCreateResponse.ShippingMethod;
168
+ /**
169
+ * The logo of the shop provided as a URL.
170
+ */
171
+ shopLogo?: string;
172
+ /**
173
+ * The shopper object. Contains information collected from the user during the
174
+ * Checkout.
175
+ */
176
+ shopper?: OrderCreateResponse.Shopper;
177
+ /**
178
+ * @deprecated Deprecated in favor of `shopper.email`. The email of the user if
179
+ * collected in the Checkout.
180
+ */
181
+ shopperEmail?: string;
182
+ statusClassification?: OrderCreateResponse.StatusClassification;
183
+ /**
184
+ * List of status history items for the order, used for logging every update on
185
+ * status.
186
+ */
187
+ statusHistoryList?: Array<OrderCreateResponse.StatusHistoryList>;
188
+ /**
189
+ * The subaccount id of the order.
190
+ */
191
+ subaccountId?: string;
192
+ /**
193
+ * The legal name of the subaccount
194
+ */
195
+ subaccountLegalName?: string;
196
+ /**
197
+ * @deprecated
198
+ */
199
+ trees?: number;
200
+ }
201
+ export declare namespace OrderCreateResponse {
202
+ /**
203
+ * The amount to be paid by the user. The amounts is in decimals, i.e. 10.23
204
+ * represents EUR 10.23. Any amount of decimal places can be provided on
205
+ * initialization, but the actual transfer amount is rounded to 2 decimal places,
206
+ * as this is the format accepted by most banks.
207
+ */
208
+ interface Price {
209
+ currency: 'EUR' | 'GBP' | 'PLN';
210
+ /**
211
+ * The total amount to be paid.
212
+ */
213
+ total: number;
214
+ shipping?: number;
215
+ subTotal?: number;
216
+ totalNet?: number;
217
+ vat?: number;
218
+ }
219
+ /**
220
+ * The billing address of the user. Required when handshake=true.
221
+ */
222
+ interface BillingAddress {
223
+ city: string;
224
+ /**
225
+ * The country code in
226
+ * [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.
227
+ */
228
+ country: 'AF' | 'AL' | 'DZ' | 'AS' | 'AD' | 'AO' | 'AI' | 'AQ' | 'AG' | 'AR' | 'AM' | 'AW' | 'AU' | 'AT' | 'AZ' | 'BS' | 'BH' | 'BD' | 'BB' | 'BY' | 'BE' | 'BZ' | 'BJ' | 'BM' | 'BT' | 'BO' | 'BA' | 'BW' | 'BV' | 'BR' | 'IO' | 'BN' | 'BG' | 'BF' | 'BI' | 'KH' | 'CM' | 'CA' | 'CV' | 'KY' | 'CF' | 'TD' | 'CL' | 'CN' | 'CX' | 'CC' | 'CO' | 'KM' | 'CG' | 'CD' | 'CK' | 'CR' | 'CI' | 'HR' | 'CU' | 'CY' | 'CZ' | 'DK' | 'DJ' | 'DM' | 'DO' | 'EC' | 'EG' | 'SV' | 'GQ' | 'ER' | 'EE' | 'ET' | 'FK' | 'FO' | 'FJ' | 'FI' | 'FR' | 'GF' | 'PF' | 'TF' | 'GA' | 'GM' | 'GE' | 'DE' | 'GH' | 'GI' | 'GR' | 'GL' | 'GD' | 'GP' | 'GU' | 'GT' | 'GN' | 'GW' | 'GY' | 'HT' | 'HM' | 'VA' | 'HN' | 'HK' | 'HU' | 'IS' | 'IN' | 'ID' | 'IR' | 'IQ' | 'IE' | 'IL' | 'IT' | 'JM' | 'JP' | 'JO' | 'KZ' | 'KE' | 'KI' | 'KP' | 'KR' | 'KW' | 'KG' | 'LA' | 'LV' | 'LB' | 'LS' | 'LR' | 'LY' | 'LI' | 'LT' | 'LU' | 'MO' | 'MG' | 'MW' | 'MY' | 'MV' | 'ML' | 'MT' | 'MH' | 'MQ' | 'MR' | 'MU' | 'YT' | 'MX' | 'FM' | 'MD' | 'MC' | 'MN' | 'MS' | 'MA' | 'MZ' | 'MM' | 'NA' | 'NR' | 'NP' | 'NL' | 'NC' | 'NZ' | 'NI' | 'NE' | 'NG' | 'NU' | 'NF' | 'MP' | 'MK' | 'NO' | 'OM' | 'PK' | 'PW' | 'PS' | 'PA' | 'PG' | 'PY' | 'PE' | 'PH' | 'PN' | 'PL' | 'PT' | 'PR' | 'QA' | 'RE' | 'RO' | 'RU' | 'RW' | 'SH' | 'KN' | 'LC' | 'PM' | 'VC' | 'WS' | 'SM' | 'ST' | 'SA' | 'SN' | 'SC' | 'SL' | 'SG' | 'SK' | 'SI' | 'SB' | 'SO' | 'ZA' | 'GS' | 'ES' | 'LK' | 'SD' | 'SR' | 'SJ' | 'SZ' | 'SE' | 'CH' | 'SY' | 'TW' | 'TJ' | 'TZ' | 'TH' | 'TL' | 'TG' | 'TK' | 'TO' | 'TT' | 'TN' | 'TR' | 'TM' | 'TC' | 'TV' | 'UG' | 'UA' | 'AE' | 'GB' | 'US' | 'UM' | 'UY' | 'UZ' | 'VU' | 'VE' | 'VN' | 'VG' | 'VI' | 'WF' | 'EH' | 'YE' | 'ZM' | 'ZW' | 'AX' | 'BQ' | 'CW' | 'GG' | 'IM' | 'JE' | 'ME' | 'BL' | 'MF' | 'RS' | 'SX' | 'SS' | 'XK';
229
+ line1: string;
230
+ zipCode: string;
231
+ firstName?: string;
232
+ lastName?: string;
233
+ line2?: string;
234
+ region?: string;
235
+ }
236
+ /**
237
+ * @deprecated
238
+ */
239
+ interface ClimateActionMode {
240
+ amount: number;
241
+ type: 'transaction' | 'amount';
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
+ }
313
+ interface LineItem {
314
+ /**
315
+ * The total amount of all line items, i.e. single amount \* quantity. Given in
316
+ * decimals, i.e. 10.23 represents EUR 10.23.
317
+ */
318
+ amount: number;
319
+ /**
320
+ * The name of the line item.
321
+ */
322
+ name: string;
323
+ /**
324
+ * The quantity of the line item.
325
+ */
326
+ quantity: number;
327
+ /**
328
+ * The net amount of a single item.
329
+ */
330
+ singleNet: number;
331
+ /**
332
+ * The VAT amount of a single item.
333
+ */
334
+ singleVat: number;
335
+ /**
336
+ * The category as [MCC](https://en.wikipedia.org/wiki/Merchant_category_code) of
337
+ * the line item.
338
+ */
339
+ category?: string;
340
+ /**
341
+ * The
342
+ * [EAN](https://en.wikipedia.org/wiki/International_Article_Number#:~:text=The%20International%20Article%20Number%20(also,configuration%2C%20from%20a%20specific%20manufacturer.)
343
+ * of the line item.
344
+ */
345
+ EAN?: string;
346
+ /**
347
+ * The image of the line item as a URL.
348
+ */
349
+ image?: string;
350
+ /**
351
+ * The internal unique identifier of the line item.
352
+ */
353
+ referenceId?: string;
354
+ }
355
+ interface Mandate {
356
+ /**
357
+ * The name of the account holder who signs the mandate.
358
+ */
359
+ accountHolderName?: string;
360
+ /**
361
+ * Additional information to display to the user during the mandate setup. This
362
+ * information is not used to setup any recurrence on the mandate. It is only
363
+ * displayed to the user during checkout.
364
+ */
365
+ additionalDisplayInformation?: Mandate.AdditionalDisplayInformation;
366
+ /**
367
+ * Mandate creditor data
368
+ */
369
+ creditor?: Mandate.Creditor;
370
+ /**
371
+ * The reference of the mandate going to be setup
372
+ */
373
+ reference?: string;
374
+ /**
375
+ * The mandate referenceId. Set this to match incoming `mandate_setup_started`,
376
+ * `mandate_setup_succeeded` or `mandate_setup_failed` webhook events to your
377
+ * mandate setup request.
378
+ */
379
+ referenceId?: string;
380
+ /**
381
+ * If true, a ready to use mandate will be set up after the payment flow.
382
+ */
383
+ setup?: boolean;
384
+ /**
385
+ * The email of the user who signs the mandate.
386
+ */
387
+ userNotificationEmail?: string;
388
+ }
389
+ namespace Mandate {
390
+ /**
391
+ * Additional information to display to the user during the mandate setup. This
392
+ * information is not used to setup any recurrence on the mandate. It is only
393
+ * displayed to the user during checkout.
394
+ */
395
+ interface AdditionalDisplayInformation {
396
+ /**
397
+ * The intended cadence of charges used for displaying purpose only. On demand
398
+ * would be used for unscheduled charges.
399
+ */
400
+ cadence?: 'BI_WEEKLY' | 'WEEKLY' | 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'ON_DEMAND';
401
+ price?: AdditionalDisplayInformation.Price;
402
+ }
403
+ namespace AdditionalDisplayInformation {
404
+ interface Price {
405
+ /**
406
+ * The amount displayed to the user as decimal e.g. 10.23 would be displayed as
407
+ * 10.23 EUR.
408
+ */
409
+ amount?: number;
410
+ currency?: 'EUR' | 'GBP' | 'PLN';
411
+ }
412
+ }
413
+ /**
414
+ * Mandate creditor data
415
+ */
416
+ interface Creditor {
417
+ id?: string;
418
+ name?: string;
419
+ }
420
+ }
421
+ /**
422
+ * @deprecated
423
+ */
424
+ interface MerchantFinancialAddress {
425
+ bankCode?: MerchantFinancialAddress.BankCode;
426
+ bban?: MerchantFinancialAddress.Bban;
427
+ iban?: MerchantFinancialAddress.Iban;
428
+ /**
429
+ * The payment reference for the order. This is the reference that will be visible
430
+ * on the bank statement.
431
+ */
432
+ paymentReference?: string;
433
+ sortCode?: MerchantFinancialAddress.SortCode;
434
+ /**
435
+ * The type of the financial address. The actual destination is determined by this
436
+ * field which can be either "iban", "sortCode", "bankCode", or "bban". The
437
+ * validation will fail if you set e.g. type="iban", but then not fill any values
438
+ * in the "iban" object.
439
+ *
440
+ * - iban: The IBAN of the account
441
+ * - sort_code: The sort code of the account
442
+ * - bank_code: The bank code of the account
443
+ * - bban: The BBAN of the account
444
+ */
445
+ type?: string;
446
+ }
447
+ namespace MerchantFinancialAddress {
448
+ interface BankCode {
449
+ /**
450
+ * The name of the account holder.
451
+ */
452
+ accountHolderName: string;
453
+ accountNumber: string;
454
+ code: string;
455
+ }
456
+ interface Bban {
457
+ /**
458
+ * The name of the account holder.
459
+ */
460
+ accountHolderName: string;
461
+ bban: string;
462
+ bic?: string;
463
+ }
464
+ interface Iban {
465
+ /**
466
+ * The name of the account holder.
467
+ */
468
+ accountHolderName: string;
469
+ iban: string;
470
+ bic?: string;
471
+ }
472
+ interface SortCode {
473
+ /**
474
+ * The name of the account holder.
475
+ */
476
+ accountHolderName: string;
477
+ accountNumber: string;
478
+ sortCode: string;
479
+ }
480
+ }
481
+ /**
482
+ * The source bank account where the money is send from.
483
+ */
484
+ interface PayerFinancialAddress {
485
+ /**
486
+ * The type of the financial address. The actual destination is determined by this
487
+ * field which can be either "iban", "sortCode", "bankCode", or "bban". The
488
+ * validation will fail if you set e.g. type="iban", but then not fill any values
489
+ * in the "iban" object.
490
+ *
491
+ * - iban: The IBAN of the account
492
+ * - sort_code: The sort code of the account
493
+ * - bank_code: The bank code of the account
494
+ * - bban: The BBAN of the account
495
+ */
496
+ type: string;
497
+ bankCode?: PayerFinancialAddress.BankCode;
498
+ bban?: PayerFinancialAddress.Bban;
499
+ iban?: PayerFinancialAddress.Iban;
500
+ sortCode?: PayerFinancialAddress.SortCode;
501
+ }
502
+ namespace PayerFinancialAddress {
503
+ interface BankCode {
504
+ accountNumber: string;
505
+ code: string;
506
+ /**
507
+ * The name of the account holder.
508
+ */
509
+ accountHolderName?: string;
510
+ }
511
+ interface Bban {
512
+ bban: string;
513
+ /**
514
+ * The name of the account holder.
515
+ */
516
+ accountHolderName?: string;
517
+ bic?: string;
518
+ }
519
+ interface Iban {
520
+ iban: string;
521
+ /**
522
+ * The name of the account holder.
523
+ */
524
+ accountHolderName?: string;
525
+ bic?: string;
526
+ }
527
+ interface SortCode {
528
+ accountNumber: string;
529
+ sortCode: string;
530
+ /**
531
+ * The name of the account holder.
532
+ */
533
+ accountHolderName?: string;
534
+ }
535
+ }
536
+ /**
537
+ * A Refund object. This corresponds to one Refund request.
538
+ */
539
+ interface Refund {
540
+ id: string;
541
+ amount: number;
542
+ createdAt: string;
543
+ referenceId: string;
544
+ /**
545
+ * The status of the refund. Always use the status of the order as your source of
546
+ * truth to trigger actions in your dashboard.
547
+ */
548
+ status: 'pending' | 'succeeded' | 'failed' | 'requires_action' | 'partially_refunded';
549
+ updatedAt: string;
550
+ description?: string;
551
+ }
552
+ /**
553
+ * The shipping address of the user. This is only collected in express Checkouts.
554
+ */
555
+ interface ShippingAddress {
556
+ city: string;
557
+ /**
558
+ * The country code in
559
+ * [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.
560
+ */
561
+ country: 'AF' | 'AL' | 'DZ' | 'AS' | 'AD' | 'AO' | 'AI' | 'AQ' | 'AG' | 'AR' | 'AM' | 'AW' | 'AU' | 'AT' | 'AZ' | 'BS' | 'BH' | 'BD' | 'BB' | 'BY' | 'BE' | 'BZ' | 'BJ' | 'BM' | 'BT' | 'BO' | 'BA' | 'BW' | 'BV' | 'BR' | 'IO' | 'BN' | 'BG' | 'BF' | 'BI' | 'KH' | 'CM' | 'CA' | 'CV' | 'KY' | 'CF' | 'TD' | 'CL' | 'CN' | 'CX' | 'CC' | 'CO' | 'KM' | 'CG' | 'CD' | 'CK' | 'CR' | 'CI' | 'HR' | 'CU' | 'CY' | 'CZ' | 'DK' | 'DJ' | 'DM' | 'DO' | 'EC' | 'EG' | 'SV' | 'GQ' | 'ER' | 'EE' | 'ET' | 'FK' | 'FO' | 'FJ' | 'FI' | 'FR' | 'GF' | 'PF' | 'TF' | 'GA' | 'GM' | 'GE' | 'DE' | 'GH' | 'GI' | 'GR' | 'GL' | 'GD' | 'GP' | 'GU' | 'GT' | 'GN' | 'GW' | 'GY' | 'HT' | 'HM' | 'VA' | 'HN' | 'HK' | 'HU' | 'IS' | 'IN' | 'ID' | 'IR' | 'IQ' | 'IE' | 'IL' | 'IT' | 'JM' | 'JP' | 'JO' | 'KZ' | 'KE' | 'KI' | 'KP' | 'KR' | 'KW' | 'KG' | 'LA' | 'LV' | 'LB' | 'LS' | 'LR' | 'LY' | 'LI' | 'LT' | 'LU' | 'MO' | 'MG' | 'MW' | 'MY' | 'MV' | 'ML' | 'MT' | 'MH' | 'MQ' | 'MR' | 'MU' | 'YT' | 'MX' | 'FM' | 'MD' | 'MC' | 'MN' | 'MS' | 'MA' | 'MZ' | 'MM' | 'NA' | 'NR' | 'NP' | 'NL' | 'NC' | 'NZ' | 'NI' | 'NE' | 'NG' | 'NU' | 'NF' | 'MP' | 'MK' | 'NO' | 'OM' | 'PK' | 'PW' | 'PS' | 'PA' | 'PG' | 'PY' | 'PE' | 'PH' | 'PN' | 'PL' | 'PT' | 'PR' | 'QA' | 'RE' | 'RO' | 'RU' | 'RW' | 'SH' | 'KN' | 'LC' | 'PM' | 'VC' | 'WS' | 'SM' | 'ST' | 'SA' | 'SN' | 'SC' | 'SL' | 'SG' | 'SK' | 'SI' | 'SB' | 'SO' | 'ZA' | 'GS' | 'ES' | 'LK' | 'SD' | 'SR' | 'SJ' | 'SZ' | 'SE' | 'CH' | 'SY' | 'TW' | 'TJ' | 'TZ' | 'TH' | 'TL' | 'TG' | 'TK' | 'TO' | 'TT' | 'TN' | 'TR' | 'TM' | 'TC' | 'TV' | 'UG' | 'UA' | 'AE' | 'GB' | 'US' | 'UM' | 'UY' | 'UZ' | 'VU' | 'VE' | 'VN' | 'VG' | 'VI' | 'WF' | 'EH' | 'YE' | 'ZM' | 'ZW' | 'AX' | 'BQ' | 'CW' | 'GG' | 'IM' | 'JE' | 'ME' | 'BL' | 'MF' | 'RS' | 'SX' | 'SS' | 'XK';
562
+ line1: string;
563
+ zipCode: string;
564
+ firstName?: string;
565
+ lastName?: string;
566
+ line2?: string;
567
+ region?: string;
568
+ }
569
+ /**
570
+ * The selected shipping method by the user. Can either be selected during an
571
+ * express Checkout Session or passed during Checkout Session creation.
572
+ */
573
+ interface ShippingMethod {
574
+ /**
575
+ * The customer-facing name of the shipping method.
576
+ */
577
+ name: string;
578
+ /**
579
+ * The price of the shipping method in decimals, i.e. 10.23 represents EUR 10.23.
580
+ */
581
+ price: number;
582
+ /**
583
+ * The unique identifier of the shipping method within Ivy.
584
+ */
585
+ id?: string;
586
+ /**
587
+ * The list of countries where the shipping method is available.
588
+ */
589
+ countries?: Array<'AF' | 'AL' | 'DZ' | 'AS' | 'AD' | 'AO' | 'AI' | 'AQ' | 'AG' | 'AR' | 'AM' | 'AW' | 'AU' | 'AT' | 'AZ' | 'BS' | 'BH' | 'BD' | 'BB' | 'BY' | 'BE' | 'BZ' | 'BJ' | 'BM' | 'BT' | 'BO' | 'BA' | 'BW' | 'BV' | 'BR' | 'IO' | 'BN' | 'BG' | 'BF' | 'BI' | 'KH' | 'CM' | 'CA' | 'CV' | 'KY' | 'CF' | 'TD' | 'CL' | 'CN' | 'CX' | 'CC' | 'CO' | 'KM' | 'CG' | 'CD' | 'CK' | 'CR' | 'CI' | 'HR' | 'CU' | 'CY' | 'CZ' | 'DK' | 'DJ' | 'DM' | 'DO' | 'EC' | 'EG' | 'SV' | 'GQ' | 'ER' | 'EE' | 'ET' | 'FK' | 'FO' | 'FJ' | 'FI' | 'FR' | 'GF' | 'PF' | 'TF' | 'GA' | 'GM' | 'GE' | 'DE' | 'GH' | 'GI' | 'GR' | 'GL' | 'GD' | 'GP' | 'GU' | 'GT' | 'GN' | 'GW' | 'GY' | 'HT' | 'HM' | 'VA' | 'HN' | 'HK' | 'HU' | 'IS' | 'IN' | 'ID' | 'IR' | 'IQ' | 'IE' | 'IL' | 'IT' | 'JM' | 'JP' | 'JO' | 'KZ' | 'KE' | 'KI' | 'KP' | 'KR' | 'KW' | 'KG' | 'LA' | 'LV' | 'LB' | 'LS' | 'LR' | 'LY' | 'LI' | 'LT' | 'LU' | 'MO' | 'MG' | 'MW' | 'MY' | 'MV' | 'ML' | 'MT' | 'MH' | 'MQ' | 'MR' | 'MU' | 'YT' | 'MX' | 'FM' | 'MD' | 'MC' | 'MN' | 'MS' | 'MA' | 'MZ' | 'MM' | 'NA' | 'NR' | 'NP' | 'NL' | 'NC' | 'NZ' | 'NI' | 'NE' | 'NG' | 'NU' | 'NF' | 'MP' | 'MK' | 'NO' | 'OM' | 'PK' | 'PW' | 'PS' | 'PA' | 'PG' | 'PY' | 'PE' | 'PH' | 'PN' | 'PL' | 'PT' | 'PR' | 'QA' | 'RE' | 'RO' | 'RU' | 'RW' | 'SH' | 'KN' | 'LC' | 'PM' | 'VC' | 'WS' | 'SM' | 'ST' | 'SA' | 'SN' | 'SC' | 'SL' | 'SG' | 'SK' | 'SI' | 'SB' | 'SO' | 'ZA' | 'GS' | 'ES' | 'LK' | 'SD' | 'SR' | 'SJ' | 'SZ' | 'SE' | 'CH' | 'SY' | 'TW' | 'TJ' | 'TZ' | 'TH' | 'TL' | 'TG' | 'TK' | 'TO' | 'TT' | 'TN' | 'TR' | 'TM' | 'TC' | 'TV' | 'UG' | 'UA' | 'AE' | 'GB' | 'US' | 'UM' | 'UY' | 'UZ' | 'VU' | 'VE' | 'VN' | 'VG' | 'VI' | 'WF' | 'EH' | 'YE' | 'ZM' | 'ZW' | 'AX' | 'BQ' | 'CW' | 'GG' | 'IM' | 'JE' | 'ME' | 'BL' | 'MF' | 'RS' | 'SX' | 'SS' | 'XK'>;
590
+ /**
591
+ * The delivery estimate of the shipping method.
592
+ */
593
+ deliveryEstimate?: ShippingMethod.DeliveryEstimate;
594
+ /**
595
+ * The unique identifier within your system of the shipping method.
596
+ */
597
+ reference?: string;
598
+ /**
599
+ * @deprecated Deprecated in favor of deliveryEstimate
600
+ */
601
+ timeFrame?: string;
602
+ }
603
+ namespace ShippingMethod {
604
+ /**
605
+ * The delivery estimate of the shipping method.
606
+ */
607
+ interface DeliveryEstimate {
608
+ /**
609
+ * The maximum delivery time.
610
+ */
611
+ maximum?: DeliveryEstimate.Maximum;
612
+ /**
613
+ * The minimum delivery time.
614
+ */
615
+ minimum?: DeliveryEstimate.Minimum;
616
+ }
617
+ namespace DeliveryEstimate {
618
+ /**
619
+ * The maximum delivery time.
620
+ */
621
+ interface Maximum {
622
+ /**
623
+ * The unit of the time duration.
624
+ */
625
+ unit: 'hour' | 'day' | 'business_day' | 'week' | 'month';
626
+ /**
627
+ * The value of the time duration.
628
+ */
629
+ value: number;
630
+ }
631
+ /**
632
+ * The minimum delivery time.
633
+ */
634
+ interface Minimum {
635
+ /**
636
+ * The unit of the time duration.
637
+ */
638
+ unit: 'hour' | 'day' | 'business_day' | 'week' | 'month';
639
+ /**
640
+ * The value of the time duration.
641
+ */
642
+ value: number;
643
+ }
644
+ }
645
+ }
646
+ /**
647
+ * The shopper object. Contains information collected from the user during the
648
+ * Checkout.
649
+ */
650
+ interface Shopper {
651
+ email?: string;
652
+ phoneNumber?: string;
653
+ }
654
+ interface StatusClassification {
655
+ /**
656
+ * Populated with the primary payment initiation failure classsification if
657
+ * available.
658
+ */
659
+ primary?: string;
660
+ /**
661
+ * Populated with the secondary payment initiation failure classsification if
662
+ * available.
663
+ */
664
+ secondary?: string;
665
+ }
666
+ interface StatusHistoryList {
667
+ /**
668
+ * The order status. This status symbolises the state of the user's payment
669
+ * attempt. See [the guide](https://docs.getivy.de/docs/payment-status) for more
670
+ * information.
671
+ */
672
+ currentStatus: 'failed' | 'canceled' | 'processing' | 'waiting_for_payment' | 'paid' | 'in_refund' | 'refunded' | 'refund_failed' | 'partially_refunded' | 'in_dispute' | 'disputed' | 'refused';
673
+ reason: string;
674
+ updatedAt: string;
675
+ /**
676
+ * The order status. This status symbolises the state of the user's payment
677
+ * attempt. See [the guide](https://docs.getivy.de/docs/payment-status) for more
678
+ * information.
679
+ */
680
+ previousStatus?: 'failed' | 'canceled' | 'processing' | 'waiting_for_payment' | 'paid' | 'in_refund' | 'refunded' | 'refund_failed' | 'partially_refunded' | 'in_dispute' | 'disputed' | 'refused' | null;
681
+ }
10
682
  }
11
683
  export interface OrderRetrieveResponse {
12
684
  /**
@@ -676,10 +1348,50 @@ export declare namespace OrderRetrieveResponse {
676
1348
  previousStatus?: 'failed' | 'canceled' | 'processing' | 'waiting_for_payment' | 'paid' | 'in_refund' | 'refunded' | 'refund_failed' | 'partially_refunded' | 'in_dispute' | 'disputed' | 'refused' | null;
677
1349
  }
678
1350
  }
1351
+ export interface OrderCreateParams {
1352
+ /**
1353
+ * The total amount of the order
1354
+ */
1355
+ amount: number;
1356
+ /**
1357
+ * The currency code of the order
1358
+ */
1359
+ currency: 'EUR' | 'GBP' | 'PLN';
1360
+ /**
1361
+ * The merchant's unique reference ID for the order
1362
+ */
1363
+ referenceId: string;
1364
+ /**
1365
+ * The customer of the merchant.
1366
+ */
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
+ }
679
1391
  export interface OrderRetrieveParams {
680
1392
  id: string;
681
1393
  }
682
1394
  export declare namespace Orders {
683
- export { type OrderRetrieveResponse as OrderRetrieveResponse, type OrderRetrieveParams as OrderRetrieveParams, };
1395
+ export { type OrderCreateResponse as OrderCreateResponse, type OrderRetrieveResponse as OrderRetrieveResponse, type OrderCreateParams as OrderCreateParams, type OrderRetrieveParams as OrderRetrieveParams, };
684
1396
  }
685
1397
  //# sourceMappingURL=orders.d.ts.map