> For the complete documentation index, see [llms.txt](https://pivot-payment.gitbook.io/pivot-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pivot-payment.gitbook.io/pivot-docs/api-references/api-information/response.md).

# Response

## HTTP Status

Pivot uses standard and conventional HTTP Status Codes for each API Response given in a single API Request. In brief, the HTTP Status code <mark style="color:green;">`2xx`</mark> indicates that the request is accepted and successfully processed by Pivot, <mark style="color:orange;">`4xx`</mark> indicating that the failure is caused by the information provided. (E.g., missing some required parameters, credentials are not valid). <mark style="color:orange;">`5xx`</mark> indicates that the error is on the Pivot side.

### **HTTP Status List used in Pivot API**

| HTTP Status               | Description                      |
| ------------------------- | -------------------------------- |
| 200 OK                    | The request is successful        |
| 400 Bad Request           | Format / missing fields          |
| 401 Unauthorized          | Invalid API key / token          |
| 403 Forbidden             | Feature not enabled / blocked    |
| 404 Not Found             | Invalid reference ID             |
| 422 Unprocessable Entity  | Valid request, invalid state     |
| 429 Too Many Requests     | Merchant-specific guard          |
| 500 Internal Server Error | Bug / unexpected failure         |
| 502 Bad Gateway           | Invalid response from downstream |
| 503 Service Unavailable   | Downstream downtime              |
| 504 Gateway Timeout       | No response within SLA           |

### Timeout

Pivot sets a default API timeout of 60 seconds. If the request takes longer than 60 seconds, then Pivot will return an HTTP code 408 for a timeout response.

### Response Format

#### **Response Format Example**

```json
{
    "code": "00",
    "message": "OK",
    "error": {      
        // error object
    },
    "data": { 
        // resource object
    },
    "pagination": { 
        "page": 2,
        "perPage": 20,
        "totalItems": 400,
        "totalPages": 20
    }
}
```

Pivot API returns a uniform response format, which helps you traverse the response easily. The payload contains the following information:

<table><thead><tr><th>Parameter</th><th width="114.1171875">Data Type</th><th width="130.4453125">Requirement</th><th>Description</th></tr></thead><tbody><tr><td>code</td><td>String</td><td>M</td><td>A code that represents the success or failure of your request. The List of response codes can be found in each section of API Services</td></tr><tr><td>message</td><td>String</td><td>M</td><td>A human-readable format that explains the response</td></tr><tr><td>error</td><td>Object</td><td>Conditional</td><td>An extended payload that explains the error in detail. See <a data-mention href="/pages/k3SwM64MkhSFKAJCPGIP">/pages/k3SwM64MkhSFKAJCPGIP</a></td></tr><tr><td>data</td><td>Object</td><td>Conditional</td><td>Contains the response data related with the accessed resources</td></tr><tr><td>pagination</td><td>Object</td><td>Conditional</td><td>Contains pagination information such as page number, how many records shows in page, total records, and total pages available</td></tr></tbody></table>
