Skip to content

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 ​

ItemValue
MethodPOST
Path/api/v1/openapi/card/recharge
AuthHMAC
Idempotency KeyRequired Idempotency-Key header

Request Fields ​

FieldTypeRequiredDescription
card_idstring✅card_<id> — must belong to your account
amountstring (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 ​

json
{ "card_id": "card_12345", "amount": "100.00" }

Required header:

http
Idempotency-Key: 7b3e9d5c-1a2b-4f3e-8c7d-6f5e4a3b2c1d

Amount semantics ​

  1. Unit — amount is denominated in the card package's recharge asset (echoed as currency in this endpoint's response, e.g. USDT). It is the amount debited from your wallet, not the amount credited to the card.
  2. Freeze — the full amount is frozen in your wallet when the order is created. If the recharge asset is USDT and 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 with insufficient_balance — nothing is frozen and no order is created.
  3. Fee & conversion — the package's recharge fee (recharge_fee: fixed / percent / fixed + percent; when its asset_symbol differs from the recharge asset it is converted first) is deducted from amount; 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 than amount — otherwise the request is rejected with 40000 recharge_amount_below_fee before any order is created (nothing frozen).
  4. Package limits — amount (recharge-asset units) is compared directly with the package's min_recharge / max_recharge (card_configs/list). Outside the range → recharge_amount_too_small / recharge_amount_too_large; the message includes the limit.
  5. Card minimum — for virtual_v / virtual_r / virtual_g / virtual_a / virtual_s921 cards 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 ​

FieldTypeDescription
transaction_idstringtxn_<...> — opaque; the same value appears in the card.recharged / card.recharge_failed webhook
card_idstringEcho
amountstringAccepted 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
currencystringRecharge asset symbol (e.g. USDT) — not the card currency
statusint1 = 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_descstringprocessing / success / failed
created_atstringRFC3339 timestamp

Example Response ​

json
{
  "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.

HTTPcodeerror_keyMeaning
20040001validation_failedRequest body cannot be parsed
20040000openapi_invalid_card_idcard_id missing or malformed (expected card_<number>)
20040000amount_requiredamount is empty
20040000invalid_recharge_amountamount is not a valid positive number
40440400card_not_foundCard does not exist or is not owned by your account (before v1.5: HTTP 200 / 40000 bank_card_not_found)
20040000recharge_amount_too_smallBelow the package minimum (message includes the minimum)
20040000recharge_amount_too_largeAbove the package maximum (message includes the maximum)
20040000recharge_limit_exceededAccount recharge limit exceeded
20040000insufficient_balanceWallet cannot cover amount — nothing frozen, no order
20040000recharge_amount_below_feeamount does not cover the recharge fee — increase the amount; nothing frozen, no order
20040000card_is_closingCard is being closed (status=4)
20040000card_not_activeCard is not active (pending / frozen / closed / failed, or flagged as closed by the provider)
20040000card_number_not_readyCard number not issued yet (virtual_s921 right after opening — usually seconds, up to ~90 s). Nothing frozen; retry later
20040000card_recharge_disabledCard recharge is disabled for your account
20040000user_not_activeAccount is not active
20040000recharge_disabledRecharge is switched off for this card type / header / package
20040000card_type_not_support_rechargeCard type does not support recharge
20040000recharge_not_supportedPackage has no recharge asset configured
20040000card_type_mismatchPackage / card type mismatch (platform data — contact us)
20040000account_currency_not_configuredPlatform configuration — contact us
20040000same_currency_not_allowedPlatform configuration — contact us
20040000unsupported_card_providerPlatform configuration — contact us
20040000exchange_rate_not_availableExchange rate temporarily unavailable — retry later
20040000card_status_not_rechargeableProvider refused because of the card's status (closed / closing / frozen / not activated); the funds have already been returned to your wallet
20040000recharge_rejectedProvider refused synchronously (e.g. below the provider minimum); the funds have already been returned to your wallet
20040000openapi_idempotency_key_required / openapi_idempotency_key_too_long / openapi_idempotency_key_invalid_charsIdempotency-Key header missing, longer than 128 characters, or containing characters outside printable ASCII (spaces not allowed)
40140100openapi_invalid_credentialsAuthentication failure
40940900openapi_idempotency_key_conflictSame key reused with a different body
40940900openapi_idempotency_key_in_progressThe first request with this key is still running — retry shortly with the same key
42942900too_many_requestsRate limited — honor Retry-After (see Rate limit)
20050000openapi_recharge_failedUnexpected server error. An order may or may not exist — check /card/transactions/list (or wait for a webhook) before retrying with a new key
20050000openapi_internal_errorIdempotency 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 header X-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) or card.recharge_failed (status: 3). Match on transaction_id; amount / currency are the same values as in this response (request amount, recharge asset) — compare amount numerically, 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_s921 top-ups never produced them.
  • Synchronous rejections (any error response above) produce no webhook. On card.recharge_failed the frozen funds have been returned to your wallet.

Notes ​

  • virtual_s921 right after opening: card.opened (and status=2) can arrive before the card number is issued. Wait until /card/info returns a non-empty masked_card_no before the first top-up; otherwise the request is rejected with card_number_not_ready (nothing is frozen). See S921 constraints.
  • A closing card (status=4) cannot be recharged (card_is_closing) — this includes virtual_s921 cards during their ~1-day close-clearing period. See Close Card.
  • Use a fresh Idempotency-Key for every new top-up; reuse a key only to retry the same request (network retry).

Released under MIT-equivalent terms.