Passa al contenuto principale

Questa pagina è disponibile solo in inglese.Apri in inglese

Errors and limits

Answers​

Every answer is JSON. A success has "success": true and the fields at the top level. An error has "success": false, a code and a sentence in English:

{ "success": false, "error": "not_allowed", "reason": "api_key_read_only", "message": "This API key is read only." }

Decide by error and, in not_allowed, by reason. The sentence in message can change; the codes do not.

ItemFormat
SuccessHTTP status 200
AmountsUS dollars as a number with a dot, like 25.5. In a request: greater than 0, with up to 2 decimals. Dollars and tokens are one to one: 20 dollars are 20 tokens
Amounts on the network (onchain, calls)Units of the token as text, like "20000000" for 20 dollars in a token with 6 decimals
DatesISO 8601 in UTC, like "2026-11-16T12:00:00Z"
IdsA prefix and 13 characters: user_, card_, tx_, evt_, inv_. Products are prd_ followed by a number, and simulations sim_ followed by 20 characters
MethodsGET to read and POST to write

Lists in pages​

/users, /cards and /transactions answer in pages:

ParameterMeaning
limitItems per page, from 1 to 200. Default 50
beforeThe next of the page you received

The answer brings next, the id to ask for the next page, or null at the end. The first page also brings summary, the totals of the list. /events takes limit from 1 to 100, default 20.

Each list comes in a field with its own name: users, cards, transactions, events, invites. GET /v2/users/{id} and GET /v2/cards/{id} answer in the same format as the list, with one item in it. GET /v2/events/{id} answers {"event": {...}} and GET /v2/invites/{id} answers {"invite": {...}}.

Safe retries​

Every POST needs the Idempotency-Key header: a unique text per request, 1 to 64 characters among letters, numbers and - _ : ..

curl -X POST https://api.sandbox.creditcard/v2/cards/card_7KQ2M9XF3TB1A/freeze \
-H "Authorization: Bearer w3c_test_YOUR_SECRET" \
-H "Idempotency-Key: freeze-card_7KQ2M9XF3TB1A-0001"
  • The same key with the same request returns the same answer, without running again. The answer is kept for 24 hours.
  • The same key with another request: 409 idempotency_conflict, This Idempotency-Key was already used with a different request.
  • Without the header: 400 invalid_input, Send an Idempotency-Key header with every write.
  • The key counts for your whole company, not for one API key or one route.
  • A new intention needs a new key: freezing a card again after an unfreeze, each secure screen, or a new card request after the reservation expired.

This is how Stripe does it. Use a key you can rebuild, like the id of the operation in your system, so a retry after a network failure is safe.

Error codes​

HTTPerrorWhen
400invalid_inputA field is missing or is not valid
400below_minimumThe amount is below the minimum. The message says the minimum
401unauthorizedThe key is missing, is not valid or belongs to the other environment
403forbiddenA request from a browser, or from an IP that is not allowed
403not_allowedThe action is not allowed now. See reason
403kyc_requiredThe user has no approved identity
403trial_limitThe free trial limit was reached
403simulation_not_supportedThe test purchase asked for something the card program does not simulate
404not_foundThe record does not exist. Ids of other companies and the ids of the panel answer the same way
409idempotency_conflictThe same Idempotency-Key with another request
409operation_pendingThe card already has an operation on its way (see pendingOp in the card)
409card_limit, cards_lifetime_limitThe person reached the limit of cards
409wallet_in_useThe wallet belongs to another account of your program
409insufficient_credit, invite_exists, person_already_registeredRefusals of invites
409cardholder_pending and the other cardholder_*The card issuer has not accepted the person yet, or refused
429rate_limitToo many requests. See the limits

The most common reason of not_allowed:

reasonMeaning
plan_not_activeThe company has no active paid plan
company_verification_requiredThe company is not verified
company_suspendedThe company is suspended
api_key_read_onlyA write with a read-only key
api_key_suspendedThe key was suspended by the automatic stop
contract_requiredThe program contract was not created yet
program_pausedNew cards and loads of this program are paused
country_not_servedThe country cannot be served
account_paused, account_revokedThe invite of the person was paused or revoked
embedded_onlyThe action is only for embedded accounts
nothing_to_doThe record is already in that state
reveal_unavailableThe card details cannot be shown now

Limits​

The limits are the ones of the platform. The API only adds the protection of each key: the requests per minute and the stop for ids that do not exist.

LimitValue
Pending card requestsOne per user, and one for the company itself. Asking again for the same user before signing returns the same reservation, with the new data
Reservation of a card request30 minutes. It expires by itself, at no cost
Cards per person5 active cards in the program, plus the lifetime limit of the account
Free trialThe limits of cards and users shown in the panel, until a paid plan
Who can get a cardUsers with an approved identity
Requests per minute600 per key, counted in windows of 60 seconds. Over it: 429 rate_limit, Too many requests. Try again in a minute. The answer has no Retry-After: wait up to 60 seconds and try again
Ids that do not exist20 in 10 minutes block the key for 15 minutes (429 rate_limit, Too many requests for records that do not exist. Try again later.). 3 blocks in 24 hours suspend the key, and the owner reactivates it in the panel
Deposit or withdrawalUp to 10,000,000 dollars per request

One pending card request per user: sign it, or let it expire, before asking for another card for the same user.