> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pazy.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Vendor Document API

> Retrieve documents for a specific vendor by its identifier

## Authentication

All requests require an API key in the request headers.

**Headers:**

```
Authorization: Api-Key YOUR_API_KEY
```

## Request

**Content-Type:** `application/json`

### Path Parameters

| Parameter | Type   | Required | Description                                     |
| --------- | ------ | -------- | ----------------------------------------------- |
| `id`      | string | Yes      | The unique identifier of the Vendor to retrieve |

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET https://api.pazy.io/v1.0/vendor/vendor_identifier/documents \
    -H "Authorization: Api-Key YOUR_API_KEY"
  ```

  ```javascript JavaScript (Fetch API) theme={null}
  const response = await fetch(
    "https://api.pazy.io/v1.0/vendor/vendor_identifier/documents",
    {
      method: "GET",
      headers: {
        Authorization: "Api-Key YOUR_API_KEY",
      },
    },
  );

  const result = await response.json();
  ```

  ```python Python (requests) theme={null}
  import requests

  url = "https://api.pazy.io/v1.0/vendor/vendor_identifier/documents"
  headers = {
      "Authorization": "Api-Key YOUR_API_KEY"
  }

  response = requests.get(url, headers=headers)
  result = response.json()
  ```
</CodeGroup>

## Success Response

**HTTP Status:** `200 OK`

**Response Fields:**

| Field                                | Type    | Description                                                                        |
| ------------------------------------ | ------- | ---------------------------------------------------------------------------------- |
| `ok`                                 | boolean | Indicates whether the request was successful                                       |
| `data`                               | object  | Contains the vendor document response data                                         |
| `data.vendorDocuments`               | array   | List of document entries associated with the vendor                                |
| `data.vendorDocuments[].id`          | string  | The unique identifier for the document                                             |
| `data.vendorDocuments[].createdOn`   | string  | The date when the document entry was created (ISO 8601 format)                     |
| `data.vendorDocuments[].name`        | string  | The name of the document                                                           |
| `data.vendorDocuments[].size`        | string  | The size of the document                                                           |
| `data.vendorDocuments[].type`        | string  | The type of the document. Like: `GENERAL`, `PAN_CERTIFICATE`, `REIMBURSEMENT_ITEM` |
| `data.vendorDocuments[].extension`   | string  | The file extension of the document                                                 |
| `data.vendorDocuments[].downloadUrl` | string  | The URL to download the document                                                   |
| `data.vendorDocuments[].user`        | object  | Information about the user who made the comment                                    |
| `data.vendorDocuments[].user.id`     | string  | Unique identifier for the user                                                     |
| `data.vendorDocuments[].user.name`   | string  | Name of the user                                                                   |
| `data.context`                       | object  | Additional context for the document                                                |
| `data.context.count`                 | number  | The total number of document                                                       |

### Response Example

```json theme={null}
{
  "ok": true,
  "data": {
    "vendorDocuments": [
      {
        "id": "<fileKey>.png",
        "name": "gst_certificate.png",
        "size": "422141",
        "type": "GENERAL",
        "createdOn": "2026-03-28T08:12:25.088Z",
        "extension": "PNG",
        "downloadUrl": "https://app.pazy.io/v1.0/download/vendor?fileKey=<fileKey>.png",
        "user": {
          "id": "<userId>",
          "name": "John Doe"
        }
      }
    ],
    "context": {
      "count": 1
    }
  }
}
```

## Error Responses

### Missing Vendor ID

**HTTP Status:** `400 Bad Request`

```json theme={null}
{
  "ok": false,
  "error": {
    "code": "MISSING_REQUIRED_FIELD",
    "message": "Vendor ID is required"
  }
}
```

### Vendor Not Found

**HTTP Status:** `404 Not Found`

```json theme={null}
{
  "ok": false,
  "error": {
    "code": "VENDOR_NOT_FOUND",
    "message": "Vendor not found"
  }
}
```

### Access Denied

**HTTP Status:** `403 Forbidden`

```json theme={null}
{
  "ok": false,
  "error": {
    "code": "ACCESS_DENIED",
    "message": "Access denied: You can only view your own vendors or vendors where you are the vendor owner"
  }
}
```

### Authentication Errors

**HTTP Status:** `401 Unauthorized`

```json theme={null}
{
  "ok": false,
  "error": {
    "code": "MISSING_CREDENTIALS",
    "message": "Missing Credentials"
  }
}
```

```json theme={null}
{
  "ok": false,
  "error": {
    "code": "INVALID_API_KEY",
    "message": "Invalid API Key"
  }
}
```

### Permission Errors

**HTTP Status:** `403 Forbidden`

```json theme={null}
{
  "ok": false,
  "error": {
    "code": "INSUFFICIENT_PERMISSIONS",
    "message": "Permission check failed - PERMISSION_CHECK_FAILED"
  }
}
```

## Best Practices

### Access Control

* Only vendors you created or where you are the vendor owner are accessible (unless you have admin or auditor role)
* Use the vendor `id` returned from the vendor creation endpoint to retrieve document
