The fault objects in this section describe possible API operation errors. All fault objects extend from the base fault, serviceFault
, for easier exception handling for languages that support it.
serviceFault
Whenever an error occurs, the Billing service returns a fault object containing an HTTP error response code that denotes the type of error.
The response body contains either code
or referenceCode
depending on the point of failure. The error message might also include optional details
, showing more information about the error. The message
might be inside the details
field.
badRequest
The badRequest
fault indicates that something should be changed in the request, and the response has details about failure.
Response Code: 400
Example: badRequest fault response
{
"badRequest": {
"referenceCode": "bc568dd7-54c2-4811-b535-105cf70cc159",
"details": [
{
"faultCode": "INVALID_ARGUMENT",
"resourceName": "Get Billng Summary",
"resourceProperty": "Billing Summary",
"message": "Invalid type."
}
]
}
}
notFound
The notFound
fault is returned when a requested resource is not found.
Response Code: 404
Example: notFound fault response
{
"notFound": {
"message": "Account not Found",
"referenceCode": "4440ba39-d2cf-4085-9b95-a3a4faca8825"
}
}
unauthorized
The unauthorized
fault is returned when you are not authorized to perform an attempted operation.
Response Code: 401
Example: unauthorized fault response
{
"Error": {
"code": 401,
"message": "Unauthorized"
}
}
notAcceptable
The notAcceptable
fault is a text message that is returned when a requested resource is not acceptable.
Response Code: 406
Example: notAcceptable fault response
Accept Type not Supported
methodNotAllowed
The methodNotAllowed
fault is returned when a requested method is not found or is not allowed.
Response Code: 405
Example: methodNotAllowed fault response
{
"Error": {
"code": 405,
"message": "Method Not Allowed"
}
}