Card errors
The HTTP status is the answer. type is what you branch on, and field names the input when one is at fault.
Errors look like this, with field when one input is at fault:
{
"error": {
"type": "insufficient_card_balance",
"message": "Your NGN card balance is too low for that. NGN 3,500.00 is available to spend."
}
}#Every type
| HTTP | type |
|---|---|
| 401 | unauthorized |
| 403 | card_api_not_enabled, card_programme_suspended, ip_not_allowed, account_inactive, not_verified, test_mode_only |
| 404 | cardholder_not_found, card_not_found, not_found |
| 409 | cardholder_exists, reference_in_use, card_limit_reached, brand_unavailable, currency_unavailable (a card currency we've paused on live), bad_state, fee_unpaid, not_yet, card_busy |
| 422 | invalid_request (with field), insufficient_card_balance, identity_mismatch, identity_not_found, cardholder_refused, dollar_needs_bvn, below_minimum, over_maximum, daily_limit |
| 202 | pending_confirmation |
| 429 | rate limited; slow down and retry |
| 502 | provider_error (nothing was taken) |
| 503 | identity_check_unavailable, temporarily_unavailable |
#Three that look like bugs and are not
403 card_api_not_enabledis a switch on our side, not a problem with your key. Ask for access, and once we approve it, it answers in test and live.202 pending_confirmationonPOST /cardsmeans the card was asked for. Wait forcard.created, and do not retry with a new reference.502 provider_errormeans nothing was taken. Your balance is untouched and no card exists.
The rest of the API has its own table: errors.