Complyance Logo

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

Required Headers

Authorization: Bearer <YOUR_API_KEY>
Accept: application/json

Path and Query Parameters

FieldRequiredDescription
documentId✅ RequiredPurchase invoice document identifier
type✅ RequiredMust 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

FieldDescription
data.documentIdUnique purchase invoice identifier
data.documentNumberSupplier invoice number when available
data.countryCountry code
data.environmentSource environment of the stored purchase invoice
data.stateCurrent processing state
data.isTerminalWhether the document has reached a terminal state
data.lastUpdatedAtTimestamp of latest known update
data.errorsValidation, delivery, or government errors
data.governmentGovernment-side metadata when available
data.complianceCompliance metadata such as UUID and approval status
data.validationResultsStructured validation outcome
data.invoiceFull normalized invoice payload
data.xmlXML payload when available
data.xmlResponseAlternative wrapped XML response when available

Common Errors

StatusCodeMeaning
400VALIDATION_ERRORMissing or invalid documentId or type
401AUTHORIZATION_ERRORAuthentication failed
404NOT_FOUNDPurchase invoice not found for the authenticated workspace
500INTERNAL_ERRORUnexpected 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