Invoice Supporting Documents API
curl --request GET \
--url https://api.pazy.io/v1.0/invoice/:invoiceId/supporting-documentsimport requests
url = "https://api.pazy.io/v1.0/invoice/:invoiceId/supporting-documents"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.pazy.io/v1.0/invoice/:invoiceId/supporting-documents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pazy.io/v1.0/invoice/:invoiceId/supporting-documents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pazy.io/v1.0/invoice/:invoiceId/supporting-documents"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.pazy.io/v1.0/invoice/:invoiceId/supporting-documents")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pazy.io/v1.0/invoice/:invoiceId/supporting-documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyInvoice APIs
Invoice Supporting Documents API
Retrieve the list of supporting documents attached to a specific invoice
Invoice Supporting Documents API
curl --request GET \
--url https://api.pazy.io/v1.0/invoice/:invoiceId/supporting-documentsimport requests
url = "https://api.pazy.io/v1.0/invoice/:invoiceId/supporting-documents"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.pazy.io/v1.0/invoice/:invoiceId/supporting-documents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pazy.io/v1.0/invoice/:invoiceId/supporting-documents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pazy.io/v1.0/invoice/:invoiceId/supporting-documents"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.pazy.io/v1.0/invoice/:invoiceId/supporting-documents")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pazy.io/v1.0/invoice/:invoiceId/supporting-documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyAuthentication
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 |
|---|---|---|---|
invoiceId | string | Yes | Unique 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"
const response = await fetch('https://api.pazy.io/v1.0/invoice/<invoiceId>/supporting-documents', {
method: 'GET',
headers: {
'Authorization': 'Api-Key YOUR_API_KEY'
}
});
const result = await response.json();
import requests
url = "https://api.pazy.io/v1.0/invoice/<invoiceId>/supporting-documents"
headers = { "Authorization": "Api-Key YOUR_API_KEY" }
response = requests.get(url, headers=headers)
result = response.json()
Success Response
HTTP Status:200 OK
Response Fields:
| Field | Type | Description |
|---|---|---|
ok | boolean | Indicates whether the request was successful |
data | object | Contains the supporting documents response data |
data.documents | array | List of supporting documents attached to the invoice |
data.documents[].id | string | Unique identifier for the document |
data.documents[].name | string | Original file name |
data.documents[].size | number | File size in bytes |
data.documents[].createdOn | string | Date the document was attached (ISO 8601 format) |
data.documents[].extension | string | Uppercased file extension (e.g., PDF, PNG, JPG) |
data.documents[].downloadUrl | string | Pre-signed URL to download the document (consume with the Download File API) |
data.documents[].user | object | Information about the user who uploaded the document |
data.documents[].user.id | string | Unique identifier for the user |
data.documents[].user.name | string | Name of the user |
data.context | object | Container for metadata |
data.context.count | number | Total 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"
}
}
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
downloadUrlpoints at the Download File API — call it with the sameAuthorizationheader to retrieve the file bytes - Use the Invoice Supporting Document Upload API to add more files against the same invoice
- The
extensionfield is uppercased and falls back toUNKif the underlying MIME type is missing
Was this page helpful?