Skip to main content
Tesouro will present you with errors when a successful response cannot be returned due to invalid data, broken business rules, or an internal critical error. Types of errors:
A declined transaction from the card network is NOT an error.
Error responses contain:
  • message - An explanation of what went wrong
  • path - The mutation or query containing the error
  • code - A set value Tesouro uses to identify the error.
  • advice - Information on how to fix and avoid the error if applicable
Error structure
{
  "data": null,
  "errors": [
    {
      "message": "<a message describing the error>",
       "path": [
         "<name of mutation or query"
      ],
      "extensions": {
        "code": "<the error code>"
        ... // <optional additional fields>
      },
      ... // <optional additional fields>
    },
    ... // additional errors, if present
  ]
}

Tips

  • If you use a table to lookup, it is important that you key off the “code” and not the “message”, as the code is a set value and should not change.
  • In the case of multiple errors occurring within a single request, each error will be listed separately In the array.
  • Errors returned by the Tesouro GraphQL API can be expected to be in compliance with the official GraphQL specification.