# Common Response Format

#### Most responses from the Customer API use a common format, with slight differences depending on whether the data returned is a JSON object or an array.

## Response Body Parameters

Refer to the following table for parameters produced in response to the Customer API.

| Body Parameter     | Type            | Description                                                                                               |
| ------------------ | --------------- | --------------------------------------------------------------------------------------------------------- |
| id                 | Integer         | Identity of entity modified, or 0 if unused.                                                              |
| details            | Object or Array | Detailed response, or null if response is not success.                                                    |
| pageSize           | Integer         | Requested number of detail entries per page (fewer than pageSize items may be returned on the last page). |
| pageNumber         | Integer         | Requested page of data, if details is an array. Default is 1.                                             |
| errors             | Array           | Details of errors that occurred.                                                                          |
| errors.fieldName   | String          | Request item or step in handling the request that caused of the error.                                    |
| errors.messageCode | String          | Code identifying the error.                                                                               |
| status             | String          | <p>• “1” indicates success</p><p>• “0” indicates an error</p>                                             |

## Example Responses

### Successful Response for an Object

```json
{
    "id": 0,
    "details": {
        ... object content ...
    },
    "status": "1",
    "errors": []
}
```

### Successful Response for an Array

```json
{
    "id": 0,
    "details": [
        ... array content ...
    ],
    "pageSize": 10,
    "pageNumber": 1,
    "status": "1",
    "errors": []
}
```

### Error Response

```json
{
    "id": 0,
    "details": null,
    "status": "0",
    "errors": [
        {
            "fieldName": "...",
            "messageCode": "..."
        }
    ]
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://customer-api-docs.ibanera.com/getting-started/common-response-format.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
