@getivy/node-sdk 0.1.0-alpha.9 → 1.1.0

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