Billingrails uses standard HTTP response codes to indicate the success or failure of an API request. Codes in the 2xx range indicate success, codes in the 4xx range indicate client errors, and codes in the 5xx range indicate a server error that we will immediately work to fix. All Billingrails errors conform to the following schema:

Example API error
{
  "error": {
    "type": "request_error",
	"code": "validation_error",
    "message": "Validation error",
    "details": [
      {
        "field": "account",
        "message": "Account is required.",
      }
    ]
  }
}

Response Codes

Billingrails uses conventional HTTP response codes to indicate the success or failure of an API request:

  • 200 OK - Request succeeded
  • 400 Bad Request - Request contains invalid parameters
  • 401 Unauthorized - Invalid API key provided
  • 404 Not Found - The requested resource doesn’t exist
  • 422 Unprocessable Entity - The request was well-formed but invalid
  • 429 Too Many Requests - Too many requests hit the API
  • 500 Internal Server Error - Something went wrong on our end