๐Ÿšจ Error Handling

The API returns HTTP status codes to indicate success or failure of requests.

2xx codes indicate success.

4xx codes indicate failures caused by the information sent by the customer or by the current state of the entities.

5xx codes indicate service problems on the API side.

Listed below are the types of errors and possible API violations.

๐ŸšฉGeneral

This section collects errors that could be returned by any endpoints listed in the API.

HTTP Status CodeDescription
400 Bad RequestInvalid request
401 UnauthorizedJWT is required
403 ForbiddenRequest from an authenticated participant that violates an authorization rule
404 Not FoundResource not found
405 Not AllowedMethod Not Allowed
409 ConflictThe Resource you want to create has a data conflict with another Resource
415 Unsupported Media TypeInvalid Content-Type
500 Internal Server ErrorUnexpected condition when processing request. Contact the Liber Capital API Support for more information.
503 Service UnavailableThe service is currently unavailable. The requested service may be under maintenance or outage
504 Gateway TimeoutIndicates that the service took longer than expected to return

๐Ÿง Problem + JSON

  1. a matter or situation regarded as unwelcome or harmful and needing to be dealt with and overcome.

The Liber Capital's API use this content example for all kind of errors, but the details field can be present or not, depends on the kind of error you received. The Content-Type is always application/problem+json.

This errors has the same fields to represent our Response Error following the RFC 7807:

FieldTypeDescription
typestringOptional A URL of this documentation about the kind of error the Client received.
titlestringRequired A description about the error.
statusintRequired Status code equals HTTP Response.
detailstringRequired Indicates the message detail about this error.
invalid_paramsarray(object)Optional human-friendly message and fields about this error. i.e {"name":"field_name", "reason": "is required"}

The invalid_params only appear when is invalid input, then you will see always name and reason properties, the reason property always there will be key word, as said on RFC 2129.