Skip to main content
Invoice Supporting Document Upload API
curl --request POST \
  --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
Content-Type: multipart/form-data

Request

Content-Type: multipart/form-data

Path Parameters

ParameterTypeRequiredDescription
invoiceIdstringYesUnique identifier of the invoice to attach documents to

Form Fields

FieldTypeRequiredDescription
filesfileYesThe file(s) to upload. Repeat the field name to upload multiple files in a single request. Max file size 50 MB per file.

Code Examples

curl -X POST https://api.pazy.io/v1.0/invoice/<invoiceId>/supporting-documents \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -F "files=@/path/to/receipt.pdf"

Success Response

HTTP Status: 200 OK Response Fields:
FieldTypeDescription
okbooleanIndicates whether the request was successful
insertbooleanIndicates that the documents were inserted against the invoice
contextobjectContainer for upload metadata
context.fileUploadednumberNumber of files that were successfully uploaded in this request

Response Example

{
  "ok": true,
  "insert": true,
  "context": {
    "fileUploaded": 1
  }
}

Error Responses

Missing File

HTTP Status: 400 Bad Request
{
  "ok": false,
  "error": {
    "code": "MISSING_REQUIRED_FIELD",
    "message": "Files field 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

  • Repeat the files field name to upload multiple documents in a single call — they are saved as separate supporting documents
  • Use the Invoice Supporting Documents API to list the documents already attached to an invoice
  • Each file is capped at 50 MB; split larger files before uploading
  • Supporting documents are stored separately from the original invoice file uploaded via the Invoice Creation API