Skip to main content

Error Responses

All Card Management API errors follow a consistent JSON shape:

{
"success": false,
"error": "Human-readable error message"
}

HTTP status codes​

StatusMeaningTypical cause
200SuccessRequest completed normally
201CreatedResource created (e.g. card issued, individual onboarded)
400Bad RequestValidation failed (missing/invalid body fields, malformed payload)
401UnauthorizedJWT missing, expired, signature invalid, or partner inactive
403ForbiddenPartner authenticated but doesn't own the target resource
404Not FoundResource id doesn't exist or isn't visible in the partner's scope
409ConflictResource already exists (e.g. duplicate clientCode)
429Too Many RequestsRate limit exceeded
500Internal Server ErrorUpstream card-issuing platform failure or unexpected exception

Authorization failures​

ScenarioStatusError message
Missing Authorization header401Authentication required
JWT expired401Token expired
JWT signature invalid401Invalid token signature
iss does not match Partner.url401Unknown issuer
sub does not resolve to a known partner401Unknown partner
Partner status is not active401Partner not active
Partner authenticated but resource is out of scope403Forbidden or Resource not owned by partner

Validation failures​

When the request body or query fails Joi validation, the response is shaped like:

{
"success": false,
"error": "ValidationError: \"email\" must be a valid email",
"details": [{ "path": ["email"], "message": "\"email\" must be a valid email" }]
}

Validation is performed with abortEarly: false, so all errors are returned in a single response.

Upstream failures​

When the card-issuing platform returns a non-2xx response, the card management API surfaces the upstream error code and message. Common cases:

Upstream errorCard Management API response
Card not found upstream404 with the upstream message
Card locked upstream409 with restriction details
Upstream 5xx502 Bad Gateway or 500 Internal Server Error

If the card management API itself can't reach the upstream platform (network failure, DNS), the response is 503 Service Unavailable.