@takeal/cusfront-sdk 0.6.1 → 0.6.3

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 (55) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +87 -0
  3. package/dist/{cards-CF3-He2x.d.ts → cards-BrqeBqLV.d.ts} +442 -1
  4. package/dist/{cards-qfHz6xZY.d.cts → cards-ofoGRU9v.d.cts} +442 -1
  5. package/dist/index.cjs +329 -205
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.cts +14 -8
  8. package/dist/index.d.ts +14 -8
  9. package/dist/index.js +329 -205
  10. package/dist/index.js.map +1 -1
  11. package/dist/react/index.d.cts +3 -2
  12. package/dist/react/index.d.ts +3 -2
  13. package/dist/resources/auth.cjs +48 -5
  14. package/dist/resources/auth.cjs.map +1 -1
  15. package/dist/resources/auth.d.cts +53 -7
  16. package/dist/resources/auth.d.ts +53 -7
  17. package/dist/resources/auth.js +48 -5
  18. package/dist/resources/auth.js.map +1 -1
  19. package/dist/resources/cards.cjs +36 -0
  20. package/dist/resources/cards.cjs.map +1 -1
  21. package/dist/resources/cards.d.cts +2 -1
  22. package/dist/resources/cards.d.ts +2 -1
  23. package/dist/resources/cards.js +36 -1
  24. package/dist/resources/cards.js.map +1 -1
  25. package/dist/resources/consents.cjs +91 -0
  26. package/dist/resources/consents.cjs.map +1 -0
  27. package/dist/resources/consents.d.cts +83 -0
  28. package/dist/resources/consents.d.ts +83 -0
  29. package/dist/resources/consents.js +89 -0
  30. package/dist/resources/consents.js.map +1 -0
  31. package/dist/resources/deposits.cjs +2 -0
  32. package/dist/resources/deposits.cjs.map +1 -1
  33. package/dist/resources/deposits.d.cts +2 -2
  34. package/dist/resources/deposits.d.ts +2 -2
  35. package/dist/resources/deposits.js +2 -0
  36. package/dist/resources/deposits.js.map +1 -1
  37. package/dist/resources/funding-options.d.cts +2 -2
  38. package/dist/resources/funding-options.d.ts +2 -2
  39. package/dist/resources/me.d.cts +2 -0
  40. package/dist/resources/me.d.ts +2 -0
  41. package/dist/resources/receipts.cjs +22 -0
  42. package/dist/resources/receipts.cjs.map +1 -0
  43. package/dist/resources/receipts.d.cts +51 -0
  44. package/dist/resources/receipts.d.ts +51 -0
  45. package/dist/resources/receipts.js +20 -0
  46. package/dist/resources/receipts.js.map +1 -0
  47. package/dist/telegram.cjs +367 -205
  48. package/dist/telegram.cjs.map +1 -1
  49. package/dist/telegram.d.cts +3 -2
  50. package/dist/telegram.d.ts +3 -2
  51. package/dist/telegram.js +367 -205
  52. package/dist/telegram.js.map +1 -1
  53. package/package.json +11 -1
  54. package/dist/deposits-B2LBe2k1.d.ts +0 -373
  55. package/dist/deposits-ZjT_btgi.d.cts +0 -373
@@ -1,3 +1,4 @@
1
+ import { ConsentKind, ConsentChannel } from './resources/consents.cjs';
1
2
  import { H as HttpClient } from './http-DeANAoTs.cjs';
2
3
 
3
4
  /**
@@ -31,6 +32,375 @@ interface CustomerInfo {
31
32
  billing_address?: Address;
32
33
  }
33
34
 
35
+ /**
36
+ * Funding options resource — `client.fundingOptions.*`.
37
+ *
38
+ * The ways the user can top up on this deployment: each funding connector,
39
+ * where its top-ups may land and which payment methods it takes. Build the
40
+ * top-up screen from this list instead of fixed connector names: a
41
+ * deployment may top up the wallet only, cards only (no wallet at all), or
42
+ * let the user choose.
43
+ *
44
+ * Mirrors `GET /me/funding-options`.
45
+ */
46
+ /**
47
+ * Where a funding connector's top-ups may land: `wallet` (the wallet
48
+ * only), `spool` (straight onto cards only) or `mixed` (either).
49
+ */
50
+ type FunderMode = "wallet" | "spool" | "mixed";
51
+ /** Where one top-up goes: the wallet, or one of the user's cards. */
52
+ type DepositTarget = "wallet" | "card";
53
+ /**
54
+ * What one way of paying through a funding connector costs and allows.
55
+ * Draw the top-up form from it: the currency to ask for, the fee to show
56
+ * (or not, for a markup), the floor, the cap and the day's limit.
57
+ */
58
+ interface MethodTerms {
59
+ method: DepositMethod;
60
+ /** ISO 4217 code the user pays in this way; `null` when any the quote accepts. */
61
+ source_currency: string | null;
62
+ fee_kind: FeeKind;
63
+ /** The fee in basis points (2000 = 20 %). */
64
+ fee_bps: number;
65
+ /** How long a quote through this method stays executable, and the deposit waits for its payment. */
66
+ quote_ttl_seconds: number;
67
+ /** Smallest single top-up in the source currency; `null` for no floor. */
68
+ min_amount: string | null;
69
+ /** Largest single top-up in the source currency; `null` for no cap. */
70
+ max_amount: string | null;
71
+ /** What one user may top up this way over 24 hours; `null` for no limit. */
72
+ daily_limit_per_user: string | null;
73
+ }
74
+ /** One way to top up. */
75
+ interface FundingOption {
76
+ /** Pass it as `funder_slug` to `deposits.initiate`. */
77
+ slug: string;
78
+ mode: FunderMode;
79
+ /** Where a top-up through it may land. */
80
+ targets: DepositTarget[];
81
+ /** Payment methods it takes. */
82
+ methods: DepositMethod[];
83
+ /**
84
+ * Whether a new card can be issued with a top-up through it
85
+ * (`issue_card` on `deposits.initiate`).
86
+ */
87
+ issue_card: boolean;
88
+ /** The terms of each method in `methods`. */
89
+ method_terms: MethodTerms[];
90
+ }
91
+ declare class FundingOptionsResource {
92
+ private readonly http;
93
+ constructor(http: HttpClient);
94
+ /** The ways to top up, preferred first. Empty when none is configured. */
95
+ list(): Promise<FundingOption[]>;
96
+ }
97
+
98
+ /**
99
+ * Deposits resource — `client.deposits.*`.
100
+ *
101
+ * The "money IN" surface: an end user tops up their wallet balance via a
102
+ * funder connector, or one of their cards straight away, past the wallet
103
+ * (`card_id`, or `issue_card` for a new card). Which of the two a
104
+ * deployment allows is in `client.fundingOptions.list()`. Mirrors the
105
+ * Takeal API's `/me/deposits` routes:
106
+ *
107
+ * POST /me/deposits → initiate
108
+ * GET /me/deposits → list (most recent first)
109
+ * GET /me/deposits/{id} → get
110
+ * POST /me/deposits/{id}/refunds → refund
111
+ *
112
+ * A deposit is rarely terminal on the initiate call: real PSPs return
113
+ * `redirect_required` (3DS / APM redirect) and flip to `confirmed` later via
114
+ * a connector → Takeal API inbound event. Poll `get(id)` or watch the user's
115
+ * webhook stream for the `deposit.confirmed` / `deposit.failed` outcome.
116
+ */
117
+ /**
118
+ * Lifecycle of a deposit. `redirect_required` carries `redirect_url`.
119
+ * `expired`: nobody paid before `expires_at`; the user starts over with a
120
+ * new quote. A payment that still arrives is credited at the stored rate
121
+ * and the deposit turns `confirmed` after all.
122
+ */
123
+ type DepositStatus = "pending" | "redirect_required" | "confirmed" | "failed" | "expired";
124
+ /**
125
+ * Top-up rail. The chosen funder decides which it supports; `sbp` is
126
+ * Russia's instant payments through a payment page, paid in roubles.
127
+ */
128
+ type DepositMethod = "card" | "crypto" | "bank_transfer" | "sbp";
129
+ /**
130
+ * A deposit record as the Takeal API returns it. Mirrors the `deposits` table; the
131
+ * server-side `id` is the stable handle the SDK polls against. `idempotency_key`
132
+ * and `request_fingerprint` are server-internal and never serialised.
133
+ */
134
+ /** Input for `quote()` — price a cross-currency deposit before paying. */
135
+ interface CreateQuoteInput {
136
+ /** Decimal string, e.g. `"5000.00"`. */
137
+ amount: string;
138
+ /** ISO 4217 source currency — must differ from the currency credited. */
139
+ currency: string;
140
+ /**
141
+ * Quote a top-up of this card: credited in the card's currency. Pass the
142
+ * same `card_id` to `initiate()`.
143
+ */
144
+ card_id?: string;
145
+ /**
146
+ * Quote into this currency instead of the wallet's: the currency of a
147
+ * card issued with the top-up (`issue_card`). Ignored with `card_id`.
148
+ */
149
+ target_currency?: string;
150
+ /**
151
+ * The funding connector the deposit will go through (`funder_slug` of
152
+ * `initiate()`). With `method`, the quote is priced on that method's own
153
+ * terms from `fundingOptions.list()`: its fee and kind, its rate source,
154
+ * its lifetime, its limits. Sent as `connector_slug`.
155
+ */
156
+ connectorSlug?: string;
157
+ /** The way the user pays. Pass the same method to `initiate()`. */
158
+ method?: DepositMethod;
159
+ }
160
+ /**
161
+ * How a method's fee reads. `spread`: taken off the credited amount at the
162
+ * deployment's rate. `markup`: in the rate the user sees, so show the rate
163
+ * and nothing else. `commission`: the rate is the provider's and the fee is
164
+ * a line of its own on the credited amount.
165
+ */
166
+ type FeeKind = "spread" | "markup" | "commission";
167
+ /** How far a top-up meant for a card has got. */
168
+ type CardLoadStatus = "pending" | "succeeded" | "failed";
169
+ /**
170
+ * A card to issue with the top-up: the fields of `cards.create` without
171
+ * its idempotency key (the deposit's covers both). The card's price is
172
+ * paid from the top-up and the rest becomes its starting balance.
173
+ */
174
+ type IssueCardInput = Omit<CreateCardInput, "idempotencyKey" | "currency"> & {
175
+ /** Optional with `productId`: the product names the currency. */
176
+ currency?: string;
177
+ };
178
+ /**
179
+ * A rate-locked funding quote: pay `source_amount source_currency`, the
180
+ * wallet is credited `credited_amount credited_currency` (net of the
181
+ * platform's conversion spread). Execute by passing `id` as `quote_id` to
182
+ * `initiate()` before `expires_at`; after that the API returns 409 and a new
183
+ * quote is needed.
184
+ */
185
+ interface FundingQuote {
186
+ id: string;
187
+ source_amount: string;
188
+ source_currency: string;
189
+ credited_amount: string;
190
+ credited_currency: string;
191
+ /**
192
+ * Provider rate before the fee, credited units per 1 source unit. The
193
+ * rate to show the user is `credited_amount / source_amount`, which has
194
+ * the fee in it; see the README for the rouble-per-dollar form.
195
+ */
196
+ rate: string;
197
+ /** The fee in basis points; the same figure as `fee_bps`, under its old name. */
198
+ spread_bps: number;
199
+ /** The fee in basis points (2000 = 20 %). */
200
+ fee_bps: number;
201
+ fee_kind: FeeKind;
202
+ provider: string;
203
+ /** The pair the quote was priced for, when the request named one. */
204
+ connector_slug?: string;
205
+ method?: DepositMethod;
206
+ /** The rate is locked until then; the deposit made with it waits for its payment as long. */
207
+ expires_at: string;
208
+ }
209
+ interface Deposit {
210
+ id: string;
211
+ user_id: string;
212
+ /** Slug of the funder that handled this deposit, as configured by the deployment. */
213
+ connector_slug: string;
214
+ /** The connector's own reference, populated once it responds. */
215
+ provider_reference: string | null;
216
+ status: DepositStatus;
217
+ /** Decimal serialised as a string to avoid float drift. */
218
+ amount: string;
219
+ currency: string;
220
+ method: DepositMethod;
221
+ /** Present when `status === "redirect_required"` — send the user here. */
222
+ redirect_url: string | null;
223
+ failure_reason: string | null;
224
+ /** Final settled amount once confirmed (may differ from `amount` on FX). */
225
+ confirmed_amount: string | null;
226
+ confirmed_at: string | null;
227
+ /** Set on cross-currency deposits: the quote this deposit executed against. */
228
+ quote_id?: string | null;
229
+ /** Locked provider rate (credited units per 1 source unit). */
230
+ fx_rate?: string | null;
231
+ fx_spread_bps?: number | null;
232
+ /** How `fx_spread_bps` was taken; see `FeeKind`. */
233
+ fx_fee_kind?: FeeKind | null;
234
+ /** When the deposit stops waiting for its payment; `null` for one without a term. */
235
+ expires_at?: string | null;
236
+ /** The wallet's local currency the deposit converted into. */
237
+ credited_currency?: string | null;
238
+ /** What the wallet was actually credited, net of spread. */
239
+ credited_amount?: string | null;
240
+ /** Bonuses added on top of the top-up, when any were. */
241
+ bonus_units?: string | null;
242
+ /** What those bonuses added to the wallet, in the credited currency. */
243
+ bonus_value?: string | null;
244
+ /** The promo code the top-up was made with; its discount came off the commission. */
245
+ promo_code?: string | null;
246
+ /** Where the money goes. Older deployments leave it out: the wallet. */
247
+ target?: DepositTarget;
248
+ /** For a top-up onto a card: the card. */
249
+ card_id?: string | null;
250
+ /** The funding connector's mode when the top-up was made. */
251
+ funder_mode?: FunderMode | null;
252
+ /** True when the card was issued with this top-up. */
253
+ issues_card?: boolean;
254
+ /**
255
+ * For a top-up onto a card: `pending` until the card provider has loaded
256
+ * the card, then `succeeded` or `failed`. Show the top-up as done only
257
+ * once it is `succeeded`, or once `returned_to_wallet_at` is set.
258
+ */
259
+ card_load_status?: CardLoadStatus | null;
260
+ /** Why the card could not take it, when `card_load_status` is `failed`. */
261
+ card_load_error?: string | null;
262
+ /** What went towards the card, in its currency, bonuses included. */
263
+ card_amount?: string | null;
264
+ /** The commission taken from a top-up onto a card, in the card's currency. */
265
+ card_commission?: string | null;
266
+ /** The money part of the price of a card issued with the top-up. */
267
+ issue_fee?: string | null;
268
+ /** The bonus part of that price. */
269
+ issue_bonus_units?: string | null;
270
+ issue_bonus_value?: string | null;
271
+ card_loaded_at?: string | null;
272
+ /**
273
+ * Set when the card could not take the top-up and the money went to the
274
+ * wallet instead (funding connectors in `mixed` mode). The user is told.
275
+ */
276
+ returned_to_wallet_at?: string | null;
277
+ created_at: string;
278
+ updated_at: string;
279
+ }
280
+ interface InitiateDepositInput {
281
+ /** Decimal as a string (`"100.00"`) — avoids float-precision loss on the wire. */
282
+ amount: string;
283
+ /** ISO 4217 code, e.g. `"USD"`. */
284
+ currency: string;
285
+ method: DepositMethod;
286
+ /**
287
+ * Optional. Slug of a specific funder to route through. Omit to
288
+ * let the Takeal API pick the first active funder. Unknown slug → 400; empty
289
+ * funder list → 503.
290
+ */
291
+ funder_slug?: string;
292
+ /**
293
+ * Passed to the funding connector and stored with the deposit. Two keys
294
+ * work across connectors: `return_url`, where the provider sends the user
295
+ * back after a 3-D Secure step (pair it with `redirect_required`), and on
296
+ * test deployments with the mock funder `mock_scenario`, which picks the
297
+ * outcome: `happy` (confirmed at once, the default), `pending` (confirmed
298
+ * about 15 s later), `redirect` (a hosted page where the user approves or
299
+ * declines), `late` (paid after the term) or `fail`.
300
+ */
301
+ metadata?: Record<string, string>;
302
+ /** Structured billing details — real PSPs require these for 3DS / compliance. */
303
+ customer?: CustomerInfo;
304
+ /**
305
+ * Required by the Takeal API on this write endpoint. Same key + body replays the
306
+ * original deposit; same key + different body returns 409. Supply a stable
307
+ * UUID per logical attempt so a retried network call is safe.
308
+ */
309
+ idempotencyKey: string;
310
+ /**
311
+ * Required when `currency` differs from the wallet's local currency: a
312
+ * fresh quote id from `quote()`. Cross-currency deposits without one are
313
+ * rejected with 400; expired quotes with 409.
314
+ */
315
+ quote_id?: string;
316
+ /**
317
+ * Add bonuses on top of the top-up: the user pays `amount`, the wallet
318
+ * gets `amount` plus what the bonuses add. On by default whenever the
319
+ * user has bonuses that can go to a top-up (only ones that came with a
320
+ * payment can); `false` tops up without them.
321
+ */
322
+ use_bonus?: boolean;
323
+ /** The most bonuses to add, decimal string. Omit to add as many as allowed. */
324
+ bonus_amount?: string;
325
+ /**
326
+ * Top up this card instead of the wallet. It must be the user's, active
327
+ * and prepaid. A funding connector that tops up the wallet only answers
328
+ * 400 `target_not_allowed`; one that tops up cards only needs `card_id`
329
+ * or `issue_card`. Paying in another currency than the card's needs a
330
+ * quote made with the same `card_id`.
331
+ */
332
+ card_id?: string;
333
+ /**
334
+ * Issue a new card and put this top-up on it. The card shows up as
335
+ * `pending_payment` and is issued once the top-up is confirmed; if the
336
+ * top-up fails, so does the card. Too small to cover the price → 400
337
+ * `amount_too_small`. Not together with `card_id`.
338
+ */
339
+ issue_card?: IssueCardInput;
340
+ /**
341
+ * A promo code for this top-up, to the wallet or to a card. Its discount
342
+ * comes off the commission; bonuses or a gift that come with the code
343
+ * arrive once the top-up is confirmed. A code that can't be used fails the
344
+ * request with 400 `promo_code_*` and the reason. `client.codes.validate`
345
+ * checks it first.
346
+ */
347
+ promo_code?: string;
348
+ }
349
+ interface CreateDepositRefundInput {
350
+ /** Omit for a full refund of the original confirmed amount; same currency. */
351
+ amount?: string;
352
+ /** Human-readable reason, e.g. `"customer_request"`. */
353
+ reason?: string;
354
+ metadata?: Record<string, string>;
355
+ /** Required. Replays are keyed on this. */
356
+ idempotencyKey: string;
357
+ }
358
+ /** A refund row as the Takeal API returns it (`refunds` table, deposit-targeted). */
359
+ interface Refund {
360
+ id: string;
361
+ target_type: string;
362
+ deposit_id?: string;
363
+ payment_id?: string;
364
+ connector_slug: string;
365
+ amount: string;
366
+ currency: string;
367
+ reason: string;
368
+ status: string;
369
+ provider_refund_reference?: string;
370
+ failure_reason?: string;
371
+ requestor_type: string;
372
+ requestor_id: string;
373
+ created_at: string;
374
+ updated_at: string;
375
+ }
376
+ declare class DepositsResource {
377
+ private readonly http;
378
+ constructor(http: HttpClient);
379
+ /**
380
+ * Initiate a top-up. Resolves to the freshly-created `Deposit`, whose
381
+ * `status` may already be `confirmed` (synchronous rails / mock) or
382
+ * `redirect_required` (3DS / APM — forward the user to `redirect_url`).
383
+ */
384
+ /**
385
+ * Price a cross-currency deposit BEFORE paying. The rate is locked
386
+ * server-side until `expires_at`; deposits already in the currency they
387
+ * credit (the wallet's, or the card's with `card_id`) need no quote (the
388
+ * API answers 400 `no_quote_needed`).
389
+ */
390
+ quote(input: CreateQuoteInput): Promise<FundingQuote>;
391
+ initiate(input: InitiateDepositInput): Promise<Deposit>;
392
+ /** Fetch one deposit by id — the poll target while a redirect resolves. */
393
+ get(id: string): Promise<Deposit>;
394
+ /** List the caller's deposits, most recent first. */
395
+ list(): Promise<Deposit[]>;
396
+ /**
397
+ * Refund a previously-confirmed deposit. Synchronous when the
398
+ * connector settles inline; otherwise the row stays `pending` and flips
399
+ * later via the inbound `deposit.refunded` event.
400
+ */
401
+ refund(depositId: string, input: CreateDepositRefundInput): Promise<Refund>;
402
+ }
403
+
34
404
  /**
35
405
  * Cards resource — `client.cards.*`.
36
406
  *
@@ -294,6 +664,15 @@ interface CreateCardInput {
294
664
  * `promo_code` on the top-up there.
295
665
  */
296
666
  promoCode?: string;
667
+ /**
668
+ * Consents the user gave with the order (`terms`, `personal_data`,
669
+ * `marketing`). Recorded with the card, or with the top-up inside
670
+ * `deposits.initiate({ issue_card })`, at the version of their documents
671
+ * in force now.
672
+ */
673
+ consents?: ConsentKind[];
674
+ /** Where they were given. Sent as `consent_channel`. */
675
+ consentChannel?: ConsentChannel;
297
676
  /**
298
677
  * Required by the Takeal API on this write endpoint. Same key + body replays the
299
678
  * original card; same key + different body returns 409.
@@ -308,6 +687,56 @@ interface CreateCardInput {
308
687
  declare function cardRequestBody(input: Omit<CreateCardInput, "idempotencyKey" | "currency"> & {
309
688
  currency?: string;
310
689
  }): Record<string, unknown>;
690
+ /**
691
+ * A card bought in one step with {@link CardsResource.order}: the product and
692
+ * how the user pays. The platform works out the amount to pay in the
693
+ * payment's currency, locks the rate and opens the top-up that issues the
694
+ * card.
695
+ */
696
+ interface CardOrderInput {
697
+ /** A product id from {@link CardsResource.listProducts}. Sent as `product_id`. */
698
+ productId: string;
699
+ /** One of the product's designs; omit for its default. Sent as `design_id`. */
700
+ designId?: string;
701
+ /** A name for the card, 1 to 40 characters; defaults to the product name. */
702
+ name?: string;
703
+ /** How the user pays, e.g. `"sbp"`. */
704
+ method: DepositMethod;
705
+ /** The funding connector to pay through; omit to let the API pick one that takes `method`. Sent as `funder_slug`. */
706
+ funderSlug?: string;
707
+ /** ISO 4217 code of the payment; defaults to the currency the method is priced in. */
708
+ currency?: string;
709
+ /** Money to put on the card on top of its price, decimal string in the card's currency. Sent as `extra_load`. */
710
+ extraLoad?: string;
711
+ /** A promo code for the payment. Sent as `promo_code`. */
712
+ promoCode?: string;
713
+ /** Pay part of the price with bonuses; on by default. Sent as `use_bonus`. */
714
+ useBonus?: boolean;
715
+ /** Consents given with the order. */
716
+ consents?: ConsentKind[];
717
+ /** Where they were given. Sent as `consent_channel`. */
718
+ consentChannel?: ConsentChannel;
719
+ /** Passed to the payment provider; `return_url` is where the payment page sends the user back. */
720
+ metadata?: Record<string, string>;
721
+ }
722
+ /** What {@link CardsResource.order} returns: the top-up to pay and its price. */
723
+ interface CardOrder {
724
+ /** Send the user to `deposit.redirect_url` when `deposit.status` is `redirect_required`. The card is issued once the payment is confirmed. */
725
+ deposit: Deposit;
726
+ /** What the user pays, decimal string, in `currency`. */
727
+ amount: string;
728
+ currency: string;
729
+ /** What reaches the card: its price plus its starting balance, in `card_currency`. */
730
+ card_amount: string;
731
+ card_currency: string;
732
+ }
733
+ /** Why a card ordered with the sign-up was not placed. The account exists all the same. */
734
+ interface CardOrderError {
735
+ code: string;
736
+ message: string;
737
+ }
738
+ /** Build the API body of a card order. */
739
+ declare function cardOrderBody(input: CardOrderInput): Record<string, unknown>;
311
740
  /** Remaining balance of a prepaid card. */
312
741
  interface CardBalance {
313
742
  amount: string;
@@ -521,6 +950,18 @@ declare class CardsResource {
521
950
  * `failure_reason` on the result.
522
951
  */
523
952
  create(input: CreateCardInput): Promise<Card>;
953
+ /**
954
+ * Buy a card in one step: the API prices the product in the payment's
955
+ * currency, locks the rate and opens the top-up that issues the card.
956
+ * Send the user to `order.deposit.redirect_url`; the card shows as
957
+ * `pending_payment` until the payment is confirmed. The same
958
+ * `idempotencyKey` returns the same order.
959
+ * Errors: 400 `unknown_product` / `method_not_available` / a limit of the
960
+ * way of paying, 503 no funding connector or no exchange rate.
961
+ */
962
+ order(input: CardOrderInput & {
963
+ idempotencyKey: string;
964
+ }): Promise<CardOrder>;
524
965
  /**
525
966
  * The cards the caller can order, in the order the storefront shows them
526
967
  * (`is_default` marks the one issued when none is chosen). Each item
@@ -635,4 +1076,4 @@ declare class CardsResource {
635
1076
  terminate(id: string, reason?: string): Promise<Card>;
636
1077
  }
637
1078
 
638
- export { type Address as A, type BillingAddress as B, type CardProduct as C, type IssuanceBonus as I, type RevealCardInput as R, type SetPinInput as S, type TopUpInput as T, type UpdateCardInput as U, type Card as a, CardsResource as b, type CardBalance as c, type CardDesignRef as d, type CardForm as e, type CardProductPrice as f, type CardStatus as g, type CardStatusSource as h, type CardTopUp as i, type CardTopUpStatus as j, type CardTransfer as k, type CardType as l, type Cardholder as m, type CloseBlockedReason as n, type CreateCardInput as o, type CustomerInfo as p, type RevealedCard as q, type TopUpResult as r, type TopUpTerms as s, type TransferInput as t, type TransferResult as u, cardRequestBody as v };
1079
+ export { type Address as A, type BillingAddress as B, type CardProduct as C, type Deposit as D, type FeeKind as E, FundingOptionsResource as F, type FunderMode as G, type FundingOption as H, type FundingQuote as I, type InitiateDepositInput as J, type IssuanceBonus as K, type IssueCardInput as L, type MethodTerms as M, type RevealCardInput as N, type RevealedCard as O, type TopUpResult as P, type TopUpTerms as Q, type Refund as R, type SetPinInput as S, type TopUpInput as T, type TransferInput as U, type TransferResult as V, type UpdateCardInput as W, cardOrderBody as X, cardRequestBody as Y, type Card as a, DepositsResource as b, CardsResource as c, type CardBalance as d, type CardDesignRef as e, type CardForm as f, type CardLoadStatus as g, type CardOrder as h, type CardOrderError as i, type CardOrderInput as j, type CardProductPrice as k, type CardStatus as l, type CardStatusSource as m, type CardTopUp as n, type CardTopUpStatus as o, type CardTransfer as p, type CardType as q, type Cardholder as r, type CloseBlockedReason as s, type CreateCardInput as t, type CreateDepositRefundInput as u, type CreateQuoteInput as v, type CustomerInfo as w, type DepositMethod as x, type DepositStatus as y, type DepositTarget as z };