Skip to main content
Invoice Supporting Documents API
curl --request GET \
  --url https://api.pazy.io/v1.0/invoice/:invoiceId/supporting-documents

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.

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

ParameterTypeRequiredDescription
invoiceIdstringYesUnique identifier of the invoice whose supporting documents are to be fetched

Code Examples

curl -X GET https://api.pazy.io/v1.0/invoice/<invoiceId>/supporting-documents \
  -H "Authorization: Api-Key YOUR_API_KEY"

Success Response

HTTP Status: 200 OK Response Fields:
FieldTypeDescription
okbooleanIndicates whether the request was successful
dataobjectContains the supporting documents response data
data.documentsarrayList of supporting documents attached to the invoice
data.documents[].idstringUnique identifier for the document
data.documents[].namestringOriginal file name
data.documents[].sizenumberFile size in bytes
data.documents[].createdOnstringDate the document was attached (ISO 8601 format)
data.documents[].extensionstringUppercased file extension (e.g., PDF, PNG, JPG)
data.documents[].downloadUrlstringPre-signed URL to download the document (consume with the Download File API)
data.documents[].userobjectInformation about the user who uploaded the document
data.documents[].user.idstringUnique identifier for the user
data.documents[].user.namestringName of the user
data.contextobjectContainer for metadata
data.context.countnumberTotal number of documents returned

Response Example

{
  "ok": true,
  "data": {
    "documents": [
      {
        "id": "<documentId>",
        "name": "purchase_proof.jpeg",
        "size": 1739231,
        "createdOn": "2026-05-16T11:34:11.672Z",
        "extension": "JPG",
        "downloadUrl": "https://api.pazy.io/v1.0/download/invoice-attachment?fileKey=<fileKey>.jpg",
        "user": {
          "id": "<userId>",
          "name": "John Doe"
        }
      },
      {
        "id": "<documentId>",
        "name": "delivery_receipt.png",
        "size": 65250,
        "createdOn": "2026-05-16T13:36:00.812Z",
        "extension": "PNG",
        "downloadUrl": "https://api.pazy.io/v1.0/download/invoice-attachment?fileKey=<fileKey>.png",
        "user": {
          "id": "<userId>",
          "name": "Jane Smith"
        }
      }
    ],
    "context": {
      "count": 2
    }
  }
}

Empty Results

When the invoice has no supporting documents attached, an empty array is returned:
{
  "ok": true,
  "data": {
    "documents": [],
    "context": { "count": 0 }
  }
}

Error Responses

Missing Invoice ID

HTTP Status: 400 Bad Request
{
  "ok": false,
  "error": {
    "code": "MISSING_REQUIRED_FIELD",
    "message": "Invoice ID is required"
  }
}

Invoice Not Found

HTTP Status: 404 Not Found
{
  "ok": false,
  "error": {
    "code": "INVOICE_NOT_FOUND",
    "message": "Invoice not found"
  }
}

Access Denied

HTTP Status: 403 Forbidden
{
  "ok": false,
  "error": {
    "code": "ACCESS_DENIED",
    "message": "Access denied: You can only view your own invoices or invoices where you are the vendor owner"
  }
}
Returned when the caller is not an admin / bookkeeper, did not create the invoice, and is not the owner of its vendor.

Authentication Errors

HTTP Status: 401 Unauthorized
{
  "ok": false,
  "error": {
    "code": "MISSING_CREDENTIALS",
    "message": "Missing Credentials"
  }
}
{
  "ok": false,
  "error": {
    "code": "INVALID_API_KEY",
    "message": "Invalid API Key"
  }
}

Permission Errors

HTTP Status: 403 Forbidden
{
  "ok": false,
  "error": {
    "code": "INSUFFICIENT_PERMISSIONS",
    "message": "Permission check failed - PERMISSION_CHECK_FAILED"
  }
}

Internal Error

HTTP Status: 500 Internal Server Error
{
  "ok": false,
  "error": {
    "code": "INTERNAL_ERROR",
    "message": "Internal error"
  }
}

Best Practices

  • The downloadUrl points at the Download File API — call it with the same Authorization header to retrieve the file bytes
  • Use the Invoice Supporting Document Upload API to add more files against the same invoice
  • The extension field is uppercased and falls back to UNK if the underlying MIME type is missing