Skip to content

Freeze Card ​

Freezes an active virtual card. Once frozen the card cannot be used for any payment/authorization until you unfreeze it.

  • The freeze is recorded as a user-initiated freeze and can be reversed by the Unfreeze Card endpoint.
  • Only cards owned by the current AppID account and of a virtual card type are accepted.
  • No money moves — freezing/unfreezing has no fee and does not touch the card balance or your wallet.
  • A successful freeze also emits a card.status_changed webhook (active → frozen).

Endpoint ​

ItemValue
MethodPOST
Path/api/v1/openapi/card/freeze
AuthHMAC
IdempotencyNot required

No Idempotency-Key needed

Freeze is protected by the card state machine: retrying on an already-frozen card returns 40000 card_already_frozen rather than double-applying. There is no monetary effect to protect against, so no Idempotency-Key header is required.

Request Fields ​

FieldTypeRequiredDescription
card_idstring✅card_<id> — must belong to your account and be a virtual card
reasonstringoptionalFree-text reason recorded with the freeze. At most 500 characters are kept — longer text is truncated before the provider is called

Example Request ​

json
{
  "card_id": "card_12345",
  "reason": "suspected fraud on merchant side"
}

Response Fields ​

FieldTypeDescription
card_idstringEcho of the card ID
statusintCard status after the operation — always 6 (frozen) on success
status_descstringEnglish status description — frozen
successbooltrue on success

Example Response ​

json
{
  "code": 0,
  "message": "Success",
  "data": {
    "card_id": "card_12345",
    "status": 6,
    "status_desc": "frozen",
    "success": true
  }
}

Preconditions & Rules ​

  1. Ownership — card_id must belong to the authenticated account, else 404 card_not_found (no distinction from "not found", to prevent enumeration).
  2. Card type — only virtual cards (virtual_l / virtual_p / virtual_v / virtual_r / virtual_g / virtual_a / virtual_s921) may be operated via OpenAPI.
  3. State — only status=2 (active) cards may be frozen. An already-frozen card returns card_already_frozen; a pending / failed / closing / closed card returns card_status_cannot_freeze.

Common Errors ​

Business errors come back with HTTP 200 and a non-zero code — always check code (0 = success) and branch on error_key, never on the localized message.

HTTPcodeerror_keyDescription
20040001validation_failedRequest body cannot be parsed
20040000openapi_invalid_card_idcard_id missing or malformed (expected card_<number>)
20040000openapi_card_type_not_supportedCard is not a virtual card type
20040000card_already_frozenCard is already frozen — treat as "already in the desired state" (before v1.5 this case returned card_status_cannot_freeze)
20040000card_status_cannot_freezeCard is not active (pending / failed / closing / closed); cannot be frozen
20040000operation_not_supportedThis provider / card type does not support freeze
20040000card_type_mismatchCard-type data inconsistency (platform side)
40140100openapi_invalid_credentialsAuth failure
40440400card_not_foundCard not found / not owned
42942900too_many_requestsRate limited — honor Retry-After
20050000openapi_freeze_card_failedServer error or provider call failed — check /card/info before retrying

Notes ​

  • After a successful freeze, /card/info reports status=6, and a card.status_changed webhook (from_status: "active", to_status: "frozen") is delivered.
  • To reverse, call Unfreeze Card. Only user-initiated freezes (this endpoint) are reversible by you; freezes applied by risk control / admin / the system are not.
  • Freezes applied by the platform (admin, risk control, system) or pushed by the card provider are also notified via card.status_changed — subscribe to it to keep your card state in sync.

Integration pitfalls & best practices ​

Read before integrating

These are the failure modes most likely to leave your system's card-state / bookkeeping out of sync with reality.

  1. Synchronous, provider-bound call — allow up to ~60 s. Freeze calls the upstream card provider inline. Latency is usually a few seconds but can reach 10–15 s, and the server permits up to 60 s. Set your HTTP client timeout to ≥ 60 s for this endpoint. A short timeout (10–30 s) invites the next problem.
  2. A client-side timeout does NOT mean the freeze failed. If your client times out (or the connection drops) after the provider already froze the card, you get an error but the card is frozen. Never record a timeout as "not frozen". On any timeout / network error, reconcile via /card/info (or wait for card.status_changed): status=6 → freeze succeeded (proceed); status=2 → not applied (safe to retry).
  3. The response is the primary signal; card.status_changed confirms it. Since v1.5 every successful freeze also emits a card.status_changed webhook after the change is committed (before v1.5 freeze/unfreeze produced no webhook). Use the synchronous response for the immediate result and the webhook for reconciliation — deduplicate on Webhook-Id as for every webhook.
  4. No Idempotency-Key, but safe to retry. Retries are not deduplicated (each one hits the provider), but the card state machine protects you: re-freezing an already-frozen card returns 40000 card_already_frozen. Treat card_already_frozen as "already in the desired state", not a hard error. Prefer the reconcile-via-/card/info pattern over blind retry loops.
  5. Freeze only blocks new payments. It does not reverse authorizations already approved before the freeze, and moves no money (no fee, balance untouched).

Released under MIT-equivalent terms.