Skip to content

Create Recharge

Async recharge endpoint. Returns transaction_id + initial status: 1 (processing); final result is delivered via card.recharged / card.recharge_failed webhook.

Endpoint

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

Request Fields

FieldTypeRequiredDescription
card_idstringcard_<id>
amountstring (decimal)Recharge amount (in card currency)

Example Request

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

Required header:

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

Response Fields

FieldTypeDescription
transaction_idstringtxn_<...>
card_idstringEcho
amountstringRequested amount
currencystringCard currency
statusint1=processing 2=success 3=failed
status_descstringEnglish description
created_atstringRFC3339 timestamp

Example Response

json
{
  "code": 200,
  "message": "OK",
  "data": {
    "transaction_id": "txn_OO20260429120000xyz",
    "card_id": "card_12345",
    "amount": "100.00",
    "currency": "USD",
    "status": 1,
    "status_desc": "processing",
    "created_at": "2026-04-29T12:00:00Z"
  }
}

Common Errors

HTTPmessage_keyDescription
400amount_requiredamount missing
400insufficient_balanceInsufficient balance
400openapi_invalid_card_idBad card ID
400openapi_idempotency_key_requiredMissing idempotency key
401openapi_invalid_credentialsAuth failure
404card_not_foundCard not found
409openapi_idempotency_key_conflictSame key, different body
500openapi_recharge_failedServer error

Notes

  • Don't reuse the same Idempotency-Key for different amounts on the front-end (will 409)
  • Same key used as a safety net for network retries → returns the original response
  • transaction_id is txn_<...> — match it against the transaction_id in webhooks (treat as opaque)

Released under MIT-equivalent terms.