Card Operations
Concepts behind issuing, recharging, and managing cards — including the asynchronous operation pattern used by createCard and rechargeCard. For full parameter and response details, see the Card section of the API Reference.
Why Card Operations Are Async
Issuing or funding a card involves downstream processing that doesn't complete instantly. Rather than holding your request open, createCard and rechargeCard return immediately with an operation ID and a status. You then poll a separate endpoint to find out when — and how — the operation finished.
The Pattern
- Kick off the operation — call
createCard(with aproductId) orrechargeCard(with acardIdandamount). The response is aCardOperationobject with an operation ID and status. - Check the status — if it's
PROCESSING, the operation hasn't finished. CallgetCardOperationStatuswith the operation ID. - Poll until terminal — keep checking, with a delay between attempts, until the status is no longer
PROCESSING. See the Card Reference for the full list of terminal statuses and what each means.
Implementation Notes
- Don't assume success from a
200alone — that means the operation was accepted, not completed. Always check the status field. - Use backoff when polling rather than a tight loop.
- Persist the operation ID so you can resume checking status after a client-side restart or timeout.
- Design for idempotency on your side — retrying
createCard/rechargeCardafter a network error, without knowing if the original request landed, risks a duplicate operation.
Other Card Endpoints
Once a card exists, the rest of the Card API is synchronous:
getProducts— available card products (needed to choose aproductIdforcreateCard)getStatuses— possible card statusesgetCards— list cards, optionally filtered bystatusgetCardTransactions— paginated transaction history, filterable bycardIdgetCardInfo— details for a specific cardgetCardSensitive— sensitive card details (avoid logging this; limit how long it's held in memory)remarkCard— attach or update a label on a card
Updated 1 day ago
Did this page help you?
