# List income documents

- Sandbox: `GET https://sandbox.payme.io/api/seller/api/documents/income`
- Production: `GET https://live.payme.io/api/seller/api/documents/income`

## Credentials

- Header `Authorization: Bearer <token>`

Retrieve a list of income documents for the authenticated seller.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `page` | query | integer | no | Page number |
| `limit` | query | integer | no | Items per page |
| `docType` | query | string | no | Filter by document type |
| `fromDate` | query | string | no | Filter documents from this date |
| `toDate` | query | string | no | Filter documents until this date |

## Code samples

### curl

```bash
curl -X GET 'https://sandbox.payme.io/api/seller/api/documents/income' \
  -H 'Authorization: Bearer <YOUR_TOKEN>'
```

### Node.js

```javascript
const response = await fetch("https://sandbox.payme.io/api/seller/api/documents/income", {
  method: "GET",
  headers: {
    "Authorization": "Bearer <YOUR_TOKEN>",
  },
});

console.log(await response.text());
```

### Python

```python
import requests

response = requests.get(
    "https://sandbox.payme.io/api/seller/api/documents/income",
    headers={
        "Authorization": "Bearer <YOUR_TOKEN>",
    },
)

print(response.text)
```

### PHP

```php
<?php

$ch = curl_init('https://sandbox.payme.io/api/seller/api/documents/income');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer <YOUR_TOKEN>',
    ],
]);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
```

## Responses

### 200 — Successful response (success)

| Field | Type | Description |
| --- | --- | --- |
| `payload` | object |  |
| `payload.page` | integer |  |
| `payload.limit` | integer |  |
| `payload.total` | integer |  |
| `payload.items` | array |  |
| `payload.items[].id` | string |  |
| `payload.items[].docType` | string |  |
| `payload.items[].docNumber` | string | Document number |
| `payload.items[].docRegulationNumber` | string | Tax authority regulation number |
| `payload.items[].valueDate` | string |  |
| `payload.items[].dueDate` | string |  |
| `payload.items[].client` | object |  |
| `payload.items[].client.name` | string | Client/customer name |
| `payload.items[].client.email` | string | Client email address |
| `payload.items[].client.phone` | string | Client phone number |
| `payload.items[].client.socialId` | string | Client's social/business ID number (ת.ז. / ח.פ.) |
| `payload.items[].totalWithoutVat` | number |  |
| `payload.items[].vatAmount` | number |  |
| `payload.items[].totalAmount` | number |  |
| `payload.items[].currency` | string |  |
| `payload.items[].status` | string |  |
| `payload.items[].url` | string | Document download URL |
| `payload.items[].createdAt` | string |  |

### 400 — Bad Request (error)

| Field | Type | Description |
| --- | --- | --- |
| `statusCode` | integer | HTTP status code |
| `message` | string | Error message(s) |
| `error` | string | Error type |

```json
{
  "statusCode": 400,
  "message": [
    "Validation failed"
  ],
  "error": "Bad Request"
}
```

### 401 — Unauthorized (error)

| Field | Type | Description |
| --- | --- | --- |
| `statusCode` | integer | HTTP status code |
| `message` | string | Error message(s) |
| `error` | string | Error type |

```json
{
  "statusCode": 401,
  "message": "Unauthorized",
  "error": "Unauthorized"
}
```
