Skip to main content
Invoice Creation API
curl --request POST \
  --url https://api.pazy.io/v1.0/invoice

Authentication

All requests require an API key in the request headers. Headers:
Authorization: Api-Key YOUR_API_KEY

Request

Content-Type: multipart/form-data

Body Parameters

ParameterTypeRequiredDescription
fileFileYesThe invoice file to upload. Supported formats: PDF, JPEG, JPG, PNG

File Requirements

  • Maximum file size: 50 MB
  • Supported formats: PDF (application/pdf), JPEG (image/jpeg), JPG (image/jpg), PNG (image/png)
  • The file should contain a readable invoice document

Code Examples

curl -X POST https://api.pazy.io/v1.0/invoice \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -F "file=@/path/to/invoice.pdf"

Success Response

HTTP Status: 200 OK Response Fields:
FieldTypeDescription
okbooleanIndicates whether the request was successful
dataobjectContains the invoice creation response data
data.idstringUnique identifier for the invoice. Use this ID to retrieve invoice details later
data.statusstringCurrent processing status. Possible values: PROCESSING, QUEUED
data.processingIdstringIdentifier for the processing job. Used for tracking invoice processing status
data.isReadybooleanIndicates whether the invoice is ready for use. Initially false as the invoice is being processed

Response Example

{
  "ok": true,
  "data": {
    "id": "invoice_identifier",
    "status": "PROCESSING",
    "processingId": "job_123456",
    "isReady": false
  }
}

Status Values

  • PROCESSING: The invoice is currently being processed and parsed
  • QUEUED: The invoice has been queued for processing
After successful upload, the invoice will be processed asynchronously. Use the returned id to check the invoice status and retrieve details once processing is complete.

Error Responses

Missing File

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

Invalid File Type

HTTP Status: 400 Bad Request
{
  "ok": false,
  "error": {
    "code": "INVALID_FILE_TYPE",
    "message": "Invalid file type. Only PDF, JPEG, JPG, and PNG files are allowed"
  }
}

File Too Large

HTTP Status: 413 Payload Too Large (or 400 Bad Request)
{
  "ok": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Validation failed: fileSize: File size exceeds maximum allowed size"
  }
}

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"
  }
}

Processing Errors

HTTP Status: 500 Internal Server Error
{
  "ok": false,
  "error": {
    "code": "INVOICE_CREATION_FAILED",
    "message": "Failed to create invoice"
  }
}

Best Practices

File Uploads

  • Verify file size before upload (max 50 MB)
  • Ensure file format is supported (PDF, JPEG, JPG, PNG)
  • Use appropriate MIME types when setting Content-Type headers
  • Handle upload errors gracefully with retry logic

Invoice Processing

  • Store the returned id for future reference
  • Poll the invoice status using the invoice detail endpoint
  • Wait for isReady to become true before using the invoice data
  • The status field will indicate if the invoice is still being processed