Get a purchase invoice

Retrieve a received purchase invoice by its document identifier.

Endpoint

http
GET https://prod.gets.complyance.io/api/v3/documents/{documentId}?type=purchases

Authentication

Send Authorization: Bearer YOUR_API_KEY for the workspace and environment where the invoice was received.

Parameters

ParameterLocationRequiredDescription
documentIdPathYesIdentifier returned by purchase listing or a purchase webhook
typeQueryYespurchases
Retrieve the document returned by a webhookbash
curl "https://prod.gets.complyance.io/api/v3/documents/${DOCUMENT_ID}?type=purchases" \
  --header "Authorization: Bearer ${COMPLYANCE_API_KEY}" \
  --header 'Accept: application/json'

Set DOCUMENT_ID to the actual identifier from the list response or purchase event.

Response

HTTP 200 returns success: true and data.

This example shows a production document. The invoice and xml values are abbreviated; the response contains the available document data.

Purchase document — HTTP 200json
{
  "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>"
  }
}
FieldDescription
documentIdRetrieved document identifier
country, environmentDocument’s country and environment
invoiceFull invoice data
xml, xmlResponseXML information, when available
state, isTerminalProcessing state and whether processing has finished, when returned
errors, validationResultsValidation or processing details, when returned

Optional fields depend on the document and its processing result. Use invoice for invoice data and handle absent optional values. Do not treat an HTTP 200 alone as evidence that every document check passed.

Errors

Document not available to this requestjson
{
  "success": false,
  "code": "NOT_FOUND",
  "message": "Document not found"
}
HTTP / codeAction
401Check the key and Bearer header; see authentication failures
422Send type=purchases; the body lists the checks that failed in its own format
404 NOT_FOUNDCheck the identifier, workspace and key environment
500 INTERNAL_ERRORRetry the read with backoff

A 404 is not a reason to create or resubmit the supplier’s invoice. Check your saved identifier and request scope first.

Last updated