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 provider (IT-Card) 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 IT-Card or another upstream provider returns a non-2xx response, the card management API surfaces the upstream error code and message. Common cases:

Upstream errorCard Management API response
IT-Card card not found404 with IT-Card's cardMask/message
IT-Card card locked409 with restriction details
IT-Card 5xx502 Bad Gateway or 500 Internal Server Error

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