This section details the different types of responses you can expect when interacting with the Localpayment API. Understanding these responses is crucial for properly handling requests and building robust integrations.
HTTP Status Codes
The API uses standard HTTP status codes to indicate the outcome of a request. Below are the most commonly used status codes:
Success Codes
Status Code | Description |
---|---|
200 | OK: The request was successful. The response body will contain the requested data (if applicable). |
201 | Created: The request was successful and a new resource was created. |
Client Errors
Status Code | Description |
---|---|
400 | Bad Request: The request could not be understood due to missing or invalid data. |
401 | Unauthorized: Authentication credentials are required to access the resource. |
403 | Forbidden: The user does not have permission to access the requested resource. |
404 | Not Found: The requested resource was not found. |
429 | Too Many Requests: User has sent too many requests in a given amount of time. |
Server Errors
Status Code | Description |
---|---|
500 | Internal Server Error: An unexpected error occurred on the server. |
501 | Not Implemented: The server does not support the functionality required to fulfill the request. |
Status Object
Many responses will include a status
object that provides more information about the transaction or request. This object typically contains the following properties:
Property | Type | Description |
---|---|---|
code | string | A predefined status code indicating the transaction result. See the Status Codes page for a full list. |
description | string | A short description of the transaction status. |
detail | string | Additional information about the transaction state. |
Example
{
"status": {
"code": "103",
"description": "APPROVED",
"detail": "The payin was confirmed but not credited yet"
},
"internalId": "dd616d71-f5cd-4bb5-9c2c-f421241ab301",
"amount": 2300,
"currency": "ARS",
...
}
Handling Errors
While a full list of errors and their details will be covered in the Error Handling section, it's important to note that errors will typically be returned with a 4xx or 5xx HTTP status code. The response body will often include a status
object with an error code and message to help you understand the issue.
Example Error Response
{
"externalId": "04921510-458f-4556-a42e-bf8e247afe51",
"internalId": "674bc11e-eb3d-417e-8267-18c1cc300ea0",
"status": {
"code": "603",
"description": "REJECTED",
"detail": "Payer Name Payer Lastname with id 20276209079 is in black list."
},
"errors": [
{
"code": "603",
"description": "Payer Name Payer Lastname with id 20276209079 is in black list.",
"detail": "Payer Name Payer Lastname with id 20276209079 is in black list."
}
]
}
Best practices
- Check the
status
Object: When available, review the status object in the API response to understand the outcome of your transaction. - Handle Errors Gracefully: Implement error handling to manage different status codes and provide meaningful feedback to users.
- Refer to Documentation: Use the Status Codes documentation to understand the meaning of each status code and how to handle it.
By understanding the structure and meaning of the API responses, you can effectively integrate with the Localpayment API and handle various transaction states. For more detailed information on error codes and statuses, please refer to the respective documentation pages.