Errors

HTTP status codes, error shapes, and troubleshooting.

This page provides a comprehensive reference of Core API error codes. You can use this information to diagnose failed transactions and fine-tune your exception-handling capabilities. DiVA API error codes are listed separately.

Error codes are based on HTTP response codes: the first three digits specify the HTTP response code, and the last three digits represent the error.

Note
In contrast to an error code, a transaction response code is a value that is returned by a payment gateway or card issuer to indicate the result of a transaction. This code indicates whether the transaction was approved or declined, as well as why it was declined, if applicable.

See the full list of supported transaction response codes in the Transactions guide.

HTTP response codes

The Core API uses standard HTTP response codes to indicate the status of requests:

  • Codes in the 2xx range typically indicate success.

  • Codes in the 4xx range typically indicate an error in the request.

  • Codes in the 5xx range typically indicate an error at the Marqeta platform.

The following table shows some common response codes:

Response CodeDescription
200 OKYour request completed successfully.
201 CreatedResource created successfully.
204 No ContentReturned on a successful DELETE.
401 UnauthorizedEnter valid credentials to continue.
403 ForbiddenAccess to the requested resource is denied.
405 Method Not AllowedThe method you supplied is not allowed for that resource, for example a PUT method on a read-only resource.
413 Request Entity Too LargeThe request body is too large or the GET request count parameter is too large.
422 Velocity rules violation or non-sufficient fundsUnprocessable entity.
500 Internal Server ErrorAn error occurred that could not be handled by the application.
502 Bad GatewayAn invalid response was received by the server.
503 Service UnavailableThe server is temporarily unable to handle this request.
504 Gateway TimeoutThe server timed out while attempting to complete this request.

If a POST or PUT request causes a validation failure, the Marqeta platform returns a response code of 400 and a body containing details about the exception. For example, a request to associate a card with a non-existent card product returns the following response body:

{
   "bad request": "Card product not found."
}

400001–400099 error codes

Mirrored from the Marqeta reference and truncated here so the MDX compile stays cheap while we demo the devdocs.dev skin. The full parameter table / response schema for this endpoint will be rendered from OpenAPI once the fumadocs-openapi integration lands.