The HTTP code, present in the header of every response, indicates the status of the communication between your system and the API E-commerce.
Success responses (2xx)
| HTTP Code | Description | Example scenario |
|---|---|---|
| 200 OK | Your request was received and processed successfully. | Returned in query (GET), capture (PUT), and void (PUT) operations. |
| 201 Created | Your request to create a resource was successful. | Returned when creating a payment transaction, for all payment methods. |
Response examples for a credit card transaction:
{
(...)
"Payment": {
(...)
"Status": 1,
"ProviderReturnMessage": "Operation Successful",
"ProviderReturnCode": "4",
}
}{
(...)
"Payment": {
(...)
"Status": 3,
"ProviderReturnMessage": "Autorizacao negada",
"ProviderReturnCode": "51",
}
}Client error responses (4xx)
Indicate a problem with your request. Generally, you must fix the error before resending the same request.
| HTTP Code | Description | Example scenario | Response body |
|---|---|---|---|
| 400 Bad Request | The request is malformed or contains invalid data. | Syntax error in the sent JSON; invalid PaymentId in a query. | Generally contains the Code and Message fields with error details. |
| 401 Unauthorized | Authentication error. The credentials (MerchantId and MerchantKey) are incorrect or were not sent. | Sending an incorrect MerchantId or MerchantKey in the header. | Returns no body. |
| 403 Forbidden | Access denied. | Not authorized due to IP restriction at the merchant. | Returns no body. |
| 404 Not Found | The requested resource was not found. | Incorrect endpoint; query for a PaymentId that does not exist or belongs to another merchant; query for a PaymentId older than three months. | Returns no body. |
| 405 Method Not Allowed | The HTTP method (GET, POST, PUT) used is incorrect for the endpoint. | Using GET on the transaction creation endpoint, which expects POST. | Returns no body. |
HTTP 400 (Bad Request) error example:
HTTP 400 (Bad Request) errors generally contain the Code and Message fields in the body:
[
{
"Code": 132,
"Message": "MerchantKey is invalid"
}
]Code represents the error code, equivalent to ReturnCode, and Message represents the message corresponding to the error, equivalent to ReturnMessage.
Check the codes returned in
CodeandMessagein ReturnCode and ReturnMessage Table.
Server error responses (5xx)
Indicate an internal failure at Cielo's servers, the card brand or issuer, the unavailability of a payment method, or slowness. In these cases, it is recommended to wait and, if the error persists, contact support.
| HTTP Code | Description |
|---|---|
| 500 Internal Server Error | An unexpected error occurred on the server. |
| 502 Bad Gateway | The server acting as a gateway received an invalid response from an upstream server. |
| 503 Service Unavailable | The server is not ready to handle the request (e.g., overload or maintenance). |
See the API status page to check service availability.