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

# Invoice Comments API

> Retrieve all comments about a specific invoice 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 invoice to retrieve |

## Code Examples

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

  ```javascript JavaScript (Fetch API) theme={null}
  const response = await fetch(
    "https://api.pazy.io/v1.0/invoice/invoice_identifier/comments",
    {
      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/invoice/invoice_identifier/comments"
  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 invoice comments response data                                                            |
| `data.comments`               | array   | List of comments associated with the invoice                                                           |
| `data.comments[].content`     | string  | The content of the comment                                                                             |
| `data.comments[].type`        | string  | The type of the comment. It is one of five values: `GENERAL`, `DECLINE`, `APPROVAL`, `REMARKS`, `FLAG` |
| `data.comments[].dateCreated` | string  | Date when the comment was created (ISO 8601 format)                                                    |
| `data.comments[].user`        | object  | Information about the user who made the comment                                                        |
| `data.comments[].user.id`     | string  | Unique identifier for the user                                                                         |
| `data.comments[].user.name`   | string  | Name of the user                                                                                       |
| `data.context`                | object  | Additional context for the comments                                                                    |
| `data.context.count`          | number  | The total number of comments                                                                           |

### Response Example

```json theme={null}
{
  "ok": true,
  "data": {
    "comments": [
      {
        "content": "@Jane Smith Hello Hi testing @John Q",
        "type": "GENERAL",
        "dateCreated": "2026-03-28T09:11:30.293Z",
        "user": {
          "id": "<userId>",
          "name": "John Doe"
        }
      },
      {
        "content": "Hello",
        "type": "GENERAL",
        "dateCreated": "2026-03-28T08:54:42.476Z",
        "user": {
          "id": "<userId>",
          "name": "John Doe"
        }
      },
      {
        "content": "@Jane Smith @John Q Testing",
        "type": "GENERAL",
        "dateCreated": "2026-03-28T08:52:28.625Z",
        "user": {
          "id": "<userId>",
          "name": "John Doe"
        }
      },
      {
        "content": "@Jane Smith Hi",
        "type": "GENERAL",
        "dateCreated": "2026-03-28T08:50:15.571Z",
        "user": {
          "id": "<userId>",
          "name": "John Doe"
        }
      }
    ],
    "context": {
      "count": 4
    }
  }
}
```

## Error Responses

### Missing Invoice ID

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

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

### Invoice Not Found

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

```json theme={null}
{
  "ok": false,
  "error": {
    "code": "INVOICE_NOT_FOUND",
    "message": "Invoice 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 invoices or invoices 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 invoices you created or where you are the vendor owner are accessible (unless you have admin or auditor role)
* Use the invoice `id` returned from the invoice creation endpoint to retrieve comments
