Get Purchase Invoice
Use this endpoint to retrieve a single inbound purchase invoice by documentId.
Endpoint
GET /api/v3/documents/{documentId}?type=purchases
Purpose
This endpoint returns the full stored purchase invoice payload for a buyer-side document. The response can include:
- normalized invoice data
- processing state
- terminal status flag
- validation errors
- XML and XML response data
- compliance metadata
- government metadata when available
Authorization: Bearer <YOUR_API_KEY>
Accept: application/json
Path and Query Parameters
| Field | Required | Description |
|---|
documentId | ✅ Required | Purchase invoice document identifier |
type | ✅ Required | Must be purchases |
Example Request
curl --location 'https://prod.gets.complyance.io/api/v3/documents/01KT0SHAH3K21158AC72ZXVX4Z?type=purchases' \
--header 'Authorization: Bearer YOUR_API_KEY' \
-H 'Accept: application/json' \
Example Success Response
{
"success": true,
"data": {
"documentId": "01KT0SHAH3K21158AC72ZXVX4Z",
"documentNumber": "INV-2026-001",
"country": "AE",
"environment": "production",
"state": "final_valid",
"isTerminal": true,
"lastUpdatedAt": "2026-06-08T09:15:00.000Z",
"errors": [],
"government": {
"status": "APPROVED"
},
"compliance": {
"uuid": "4Q2H2R3YSSYZTX5TRWZF2M2K10",
"ftaApprovedStatus": "APPROVED",
"businessProcessIdentifier": null,
"specificationIdentifier": null
},
"validationResults": {
"status": "Valid",
"validationSteps": [
{
"name": "schema",
"status": "Valid",
"error": null
}
]
},
"invoice": {
"header": {
"documentNumber": "INV-2026-001"
}
},
"xml": "<Invoice>...</Invoice>"
}
}
Response Fields
| Field | Description |
|---|
data.documentId | Unique purchase invoice identifier |
data.documentNumber | Supplier invoice number when available |
data.country | Country code |
data.environment | Source environment of the stored purchase invoice |
data.state | Current processing state |
data.isTerminal | Whether the document has reached a terminal state |
data.lastUpdatedAt | Timestamp of latest known update |
data.errors | Validation, delivery, or government errors |
data.government | Government-side metadata when available |
data.compliance | Compliance metadata such as UUID and approval status |
data.validationResults | Structured validation outcome |
data.invoice | Full normalized invoice payload |
data.xml | XML payload when available |
data.xmlResponse | Alternative wrapped XML response when available |
Common Errors
| Status | Code | Meaning |
|---|
400 | VALIDATION_ERROR | Missing or invalid documentId or type |
401 | AUTHORIZATION_ERROR | Authentication failed |
404 | NOT_FOUND | Purchase invoice not found for the authenticated workspace |
500 | INTERNAL_ERROR | Unexpected retrieval failure |
Notes
type=purchases is mandatory for purchase invoice retrieval
- this endpoint is for inbound buyer-side documents, not outbound sales submissions
- not every response includes
xml, xmlResponse, government, or compliance