Create Recharge
Async recharge (top-up) endpoint. Freezes amount in your wallet, submits the top-up to the card provider and returns transaction_id + status: 1 (processing); the final result is delivered via the card.recharged / card.recharge_failed webhook.
Endpoint
| Item | Value |
|---|---|
| Method | POST |
| Path | /api/v1/openapi/card/recharge |
| Auth | HMAC |
| Idempotency Key | Required Idempotency-Key header |
Request Fields
| Field | Type | Required | Description |
|---|---|---|---|
card_id | string | ✅ | card_<id> — must belong to your account |
amount | string (decimal) | ✅ | Amount to pay, in the package's recharge asset (e.g. USDT — returned as currency in the response), not in the card currency. Must be > 0; at most 2 decimals (extra decimals are truncated, not rounded). See Amount semantics |
Example Request
{ "card_id": "card_12345", "amount": "100.00" }Required header:
Idempotency-Key: 7b3e9d5c-1a2b-4f3e-8c7d-6f5e4a3b2c1dAmount semantics
- Unit —
amountis denominated in the card package's recharge asset (echoed ascurrencyin this endpoint's response, e.g.USDT). It is the amount debited from your wallet, not the amount credited to the card. - Freeze — the full
amountis frozen in your wallet when the order is created. If the recharge asset isUSDTand your USDT balance is short, the shortfall is covered 1:1 from your USD balance. If the wallet still cannot cover it, the request is rejected withinsufficient_balance— nothing is frozen and no order is created. - Fee & conversion — the package's recharge fee (
recharge_fee: fixed / percent / fixed + percent; when itsasset_symboldiffers from the recharge asset it is converted first) is deducted fromamount; the remainder is converted into the card currency at the platform's exchange rate and that is what the card receives. The fee must be smaller thanamount— otherwise the request is rejected with40000 recharge_amount_below_feebefore any order is created (nothing frozen). - Package limits —
amount(recharge-asset units) is compared directly with the package'smin_recharge/max_recharge(card_configs/list). Outside the range →recharge_amount_too_small/recharge_amount_too_large; themessageincludes the limit. - Card minimum — for
virtual_v/virtual_r/virtual_g/virtual_a/virtual_s921cards a top-up must deliver at least 10 (card currency) to the card, measured on the converted amount after the fee. Below that the top-up is rejected synchronously →recharge_rejected, and the frozen funds are returned to your wallet.
Response Fields
| Field | Type | Description |
|---|---|---|
transaction_id | string | txn_<...> — opaque; the same value appears in the card.recharged / card.recharge_failed webhook |
card_id | string | Echo |
amount | string | Accepted amount in the recharge asset: the request value truncated to 2 decimals, without trailing zeros ("100.00" → "100", "25.50" → "25.5"). Compare amounts as decimal numbers, not as strings |
currency | string | Recharge asset symbol (e.g. USDT) — not the card currency |
status | int | 1 = processing (the normal case). 2 = success / 3 = failed only when the provider settled the top-up synchronously (possible on virtual_l / virtual_p) — that status is final and no webhook follows for this transaction |
status_desc | string | processing / success / failed |
created_at | string | RFC3339 timestamp |
Example Response
{
"code": 0,
"message": "Success",
"data": {
"transaction_id": "txn_KCZ20260429120000123456",
"card_id": "card_12345",
"amount": "100",
"currency": "USDT",
"status": 1,
"status_desc": "processing",
"created_at": "2026-04-29T12:00:00Z"
}
}Outcome unknown → still a processing success
If the call to the provider times out or fails with a gateway / 5xx error, the provider may or may not have accepted the top-up. The order already exists, the funds stay frozen and the order stays processing — so the endpoint returns the same success envelope with status: 1 and a transaction_id (before v1.5 this case returned 50000 openapi_recharge_failed). The final result is settled by the provider callback / reconciliation and delivered as card.recharged or card.recharge_failed.
Do not retry with a new Idempotency-Key
A status: 1 response means an order exists and funds are frozen. Sending the same top-up again with a new key creates a second order and freezes the money twice. Wait for the webhook (or look for the top-up in /card/transactions/list) instead.
Common Errors
Business errors come back with HTTP 200 and a non-zero code — always check code (0 = success) and branch on error_key. message is localized and must not be parsed.
| HTTP | code | error_key | Meaning |
|---|---|---|---|
| 200 | 40001 | validation_failed | Request body cannot be parsed |
| 200 | 40000 | openapi_invalid_card_id | card_id missing or malformed (expected card_<number>) |
| 200 | 40000 | amount_required | amount is empty |
| 200 | 40000 | invalid_recharge_amount | amount is not a valid positive number |
| 404 | 40400 | card_not_found | Card does not exist or is not owned by your account (before v1.5: HTTP 200 / 40000 bank_card_not_found) |
| 200 | 40000 | recharge_amount_too_small | Below the package minimum (message includes the minimum) |
| 200 | 40000 | recharge_amount_too_large | Above the package maximum (message includes the maximum) |
| 200 | 40000 | recharge_limit_exceeded | Account recharge limit exceeded |
| 200 | 40000 | insufficient_balance | Wallet cannot cover amount — nothing frozen, no order |
| 200 | 40000 | recharge_amount_below_fee | amount does not cover the recharge fee — increase the amount; nothing frozen, no order |
| 200 | 40000 | card_is_closing | Card is being closed (status=4) |
| 200 | 40000 | card_not_active | Card is not active (pending / frozen / closed / failed, or flagged as closed by the provider) |
| 200 | 40000 | card_number_not_ready | Card number not issued yet (virtual_s921 right after opening — usually seconds, up to ~90 s). Nothing frozen; retry later |
| 200 | 40000 | card_recharge_disabled | Card recharge is disabled for your account |
| 200 | 40000 | user_not_active | Account is not active |
| 200 | 40000 | recharge_disabled | Recharge is switched off for this card type / header / package |
| 200 | 40000 | card_type_not_support_recharge | Card type does not support recharge |
| 200 | 40000 | recharge_not_supported | Package has no recharge asset configured |
| 200 | 40000 | card_type_mismatch | Package / card type mismatch (platform data — contact us) |
| 200 | 40000 | account_currency_not_configured | Platform configuration — contact us |
| 200 | 40000 | same_currency_not_allowed | Platform configuration — contact us |
| 200 | 40000 | unsupported_card_provider | Platform configuration — contact us |
| 200 | 40000 | exchange_rate_not_available | Exchange rate temporarily unavailable — retry later |
| 200 | 40000 | card_status_not_rechargeable | Provider refused because of the card's status (closed / closing / frozen / not activated); the funds have already been returned to your wallet |
| 200 | 40000 | recharge_rejected | Provider refused synchronously (e.g. below the provider minimum); the funds have already been returned to your wallet |
| 200 | 40000 | openapi_idempotency_key_required / openapi_idempotency_key_too_long / openapi_idempotency_key_invalid_chars | Idempotency-Key header missing, longer than 128 characters, or containing characters outside printable ASCII (spaces not allowed) |
| 401 | 40100 | openapi_invalid_credentials | Authentication failure |
| 409 | 40900 | openapi_idempotency_key_conflict | Same key reused with a different body |
| 409 | 40900 | openapi_idempotency_key_in_progress | The first request with this key is still running — retry shortly with the same key |
| 429 | 42900 | too_many_requests | Rate limited — honor Retry-After (see Rate limit) |
| 200 | 50000 | openapi_recharge_failed | Unexpected server error. An order may or may not exist — check /card/transactions/list (or wait for a webhook) before retrying with a new key |
| 200 | 50000 | openapi_internal_error | Idempotency store temporarily unavailable — nothing executed; retry with the same key |
Idempotency & replay
- The key is scoped to your
AppID; max 128 characters, printable ASCII only. See Idempotency. - Every HTTP 2xx response is stored under the key for 24 h — including HTTP-200 business errors (
40000/40001/50000). Resending the same key with the same body replays the stored response byte-for-byte with headerX-Idempotent-Replay: true; nothing is executed again. - Consequence: after fixing the cause of a business error (e.g. topping up your wallet after
insufficient_balance), send the retry with a new key — the old key would only replay the old error. - Non-2xx responses (
401/404/409/429/500) are not stored; a retry with the same key executes again. - Same key + different body →
409 openapi_idempotency_key_conflict. Don't reuse one key for different amounts.
Webhooks
- The final result arrives as
card.recharged(status: 2) orcard.recharge_failed(status: 3). Match ontransaction_id;amount/currencyare the same values as in this response (request amount, recharge asset) — compareamountnumerically, the number of decimal places in the string may differ. - Since v1.5 these events are delivered for all OpenAPI virtual card types (
virtual_l/virtual_p/virtual_v/virtual_r/virtual_g/virtual_a/virtual_s921). Before v1.5,virtual_v/virtual_r/virtual_g/virtual_a/virtual_s921top-ups never produced them. - Synchronous rejections (any error response above) produce no webhook. On
card.recharge_failedthe frozen funds have been returned to your wallet.
Notes
virtual_s921right after opening:card.opened(andstatus=2) can arrive before the card number is issued. Wait until/card/inforeturns a non-emptymasked_card_nobefore the first top-up; otherwise the request is rejected withcard_number_not_ready(nothing is frozen). See S921 constraints.- A closing card (
status=4) cannot be recharged (card_is_closing) — this includesvirtual_s921cards during their ~1-day close-clearing period. See Close Card. - Use a fresh
Idempotency-Keyfor every new top-up; reuse a key only to retry the same request (network retry).