Skip to main content
Vendor Document Upload API
curl --request POST \
  --url https://api.pazy.io/v1.0/vendor/:vendorId/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
vendorIdstringYesUnique identifier of the vendor 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/vendor/<vendorId>/documents \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -F "files=@/path/to/document.pdf"

Success Response

HTTP Status: 200 OK Response Fields:
FieldTypeDescription
okbooleanIndicates whether the request was successful
insertbooleanIndicates that the documents were inserted against the vendor
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"
  }
}

Vendor Not Found

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

Access Denied

HTTP Status: 403 Forbidden
{
  "ok": false,
  "error": {
    "code": "ACCESS_DENIED",
    "message": "Access denied: You can only view vendors you own"
  }
}
Returned when the caller is neither an admin / bookkeeper nor the vendor’s owner.

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 vendor documents
  • Use the Vendor Documents API to list the documents already attached to a vendor before deciding what to upload
  • Each file is capped at 50 MB; split larger files before uploading