# Get income document

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

## Credentials

- Header `Authorization: Bearer <token>`

Retrieve a specific income document by ID.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | Document ID |

## Code samples

### curl

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

### Node.js

```javascript
const response = await fetch("https://sandbox.payme.io/api/seller/api/documents/income/<id>", {
  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/<id>",
    headers={
        "Authorization": "Bearer <YOUR_TOKEN>",
    },
)

print(response.text)
```

### PHP

```php
<?php

$ch = curl_init('https://sandbox.payme.io/api/seller/api/documents/income/<id>');
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 |
| --- | --- | --- |
| `id` | string |  |
| `docType` | string |  |
| `docNumber` | string | Document number |
| `docRegulationNumber` | string | Tax authority regulation number |
| `valueDate` | string |  |
| `dueDate` | string |  |
| `client` | object |  |
| `client.name` | string | Client/customer name |
| `client.email` | string | Client email address |
| `client.phone` | string | Client phone number |
| `client.socialId` | string | Client's social/business ID number (ת.ז. / ח.פ.) |
| `totalWithoutVat` | number |  |
| `vatAmount` | number |  |
| `totalAmount` | number |  |
| `currency` | string |  |
| `status` | string |  |
| `url` | string | Document download URL |
| `createdAt` | string |  |

### 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"
}
```

### 404 — Not Found (error)

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

```json
{
  "statusCode": 404,
  "message": "Document not found",
  "error": "Not Found"
}
```
