Status codes and the error object.

The Tremendous API formats errors as follows:

{
  "errors": {
    "message": "Order failed: validation failure",
    "payload": {
      "payment": {
        "funding_source_id": "Your request was missing a funding_source_id. Tremendous requires this to determine how to pay for your order."
      }
    }
  }
}

The returned JSON object has a single top-level property error. Nested under that property is another object, that comes with two (2) properties:

  • message: (string) A message written in plain English describing the error
  • payload: (object) Each (nested) property in this object references back to the exact same property in the request body you sent. At the lowest level, this object contains messages that describe the specific problem that occurred in that specific field of your request body.

In the example above, the user tried to create an order, which failed. The request body was missing the property funding_source_id nested under a payment object at the top level of the request.

A single endpoint may result in different error states. Our API reference describes all possible error states for each endpoint.

Response codes

The API uses HTTP status codes to communicate the result of a request.

HTTP status code

Meaning

200

API request successful (no new resource created)

201

API request successful (new resource created)

202

API request successful (no new resource created yet, but new resource will be created asynchronously in the background)

400

Validation error of the sent parameters or request body

401

Authorization error e.g. due to an invalid or missing API key

402

Not enough funds in your account

404

No resource could be found for the provided ID

422

Request lacks one of the required parameters

429

Rate limit exceeded

500

Unexpected error. If this persists, please contact [email protected]