> ## 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 Payments API

> Retrieve payments 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 |

### Query Parameters

| Parameter | Type   | Required | Description                               |
| --------- | ------ | -------- | ----------------------------------------- |
| `fields`  | string | Yes      | CSV string of extra field you want to get |

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET https://api.pazy.io/v1.0/vendor/vendor_identifier/payments?fields=accountNumber \
    -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/payments?fields=accountNumber",
    {
      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/payments?fields=accountNumber"
  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 payments response data                                     |
| `data.vendorPayments[].transactionId`          | string  | Unique transaction identifier for the payment                                  |
| `data.vendorPayments[].resourceId`             | string  | Unique identifier of the associated resource                                   |
| `data.vendorPayments[].resourceType`           | string  | Type of the resource e.g. `INVOICE`, `PURCHASE_ORDER`                          |
| `data.vendorPayments[].invoiceNo`              | string  | Human-readable invoice number                                                  |
| `data.vendorPayments[].currency`               | string  | Currency code for the payment e.g. `INR`, `USD`                                |
| `data.vendorPayments[].amount`                 | string  | Amount paid to the vendor                                                      |
| `data.vendorPayments[].paidVia`                | string  | Payment method used e.g. `PLATFORM`, `MANUAL`                                  |
| `data.vendorPayments[].paidBy`                 | object  | Information about the user who made the payment                                |
| `data.vendorPayments[].paidBy.id`              | string  | Unique identifier for the user                                                 |
| `data.vendorPayments[].paidBy.name`            | string  | Name of the user                                                               |
| `data.vendorPayments[].paymentState`           | string  | Current state of the payment e.g. `FINISHED`, `PENDING`                        |
| `data.vendorPayments[].paymentDate`            | string  | ISO 8601 timestamp of when the payment was made                                |
| `data.vendorPayments[].utr`                    | string  | Unique Transaction Reference number for the payment                            |
| `data.context.count`                           | number  | Total number of vendor payments                                                |
| `data.context.totalAmountByCurrency`           | object  | Total payment amounts grouped by currency code                                 |
| `data.context.vendorBankDetails`               | object  | Bank account details of the vendor                                             |
| `data.context.vendorBankDetails.accountName`   | string  | Name on the vendor's bank account                                              |
| `data.context.vendorBankDetails.accountIFSC`   | string  | IFSC code of the vendor's bank                                                 |
| `data.context.vendorBankDetails.accountType`   | string  | Type of account identifier e.g. `IFSC`                                         |
| `data.context.vendorBankDetails.accountNumber` | string  | Vendor's bank account number (Only if you ask for this in fields query params) |

### Response Example

```json theme={null}
{
  "ok": true,
  "data": {
    "vendorPayments": [
      {
        "transactionId": "<transactionId>",
        "resourceId": "<invoiceId>",
        "resourceType": "INVOICE",
        "invoiceNo": "INV-2026-001",
        "currency": "INR",
        "amount": 10,
        "paidVia": "PLATFORM",
        "paidBy": {
          "id": "<userId>",
          "name": "John Doe"
        },
        "paymentState": "FINISHED",
        "paymentDate": "2026-02-18T02:51:02.615Z",
        "utr": "<utrNumber>"
      },
      {
        "transactionId": "<transactionId>",
        "resourceId": "<invoiceId>",
        "resourceType": "INVOICE",
        "invoiceNo": "INV-2026-002",
        "currency": "INR",
        "amount": 13,
        "paidVia": "PLATFORM",
        "paidBy": {
          "id": "<userId>",
          "name": "John Doe"
        },
        "paymentState": "CONFIRMATION_PENDING",
        "paymentDate": "2026-02-10T07:39:01.460Z",
        "utr": ""
      }
    ],
    "context": {
      "count": 2,
      "totalAmountByCurrency": {
        "INR": 23
      },
      "vendorBankDetails": {
        "accountName": "John Doe",
        "accountIFSC": "ABCD0123456",
        "accountType": "IFSC",
        "accountNumber": "<accountNumber>"
      }
    }
  }
}
```

## 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 payments
