Documents and status

Read the status of a sales document you submitted through Unify: its state, whether processing has finished, and what the tax authority or the Peppol network returned.

Endpoint

Get a sales documenthttp
GET https://prod.gets.complyance.io/api/v3/documents/{documentId}?type=sales

Use the documentId from the submit response. The same request with type=purchases returns a received invoice; see Get a purchase invoice.

GET /api/v3/documents/{documentId}/status returns the same status object. When the document is compliant, it also returns the invoice PDF, Base64-encoded, in pdfBase64, which is null if the PDF could not be produced. Use either one; the examples in these docs use ?type=sales.

Authentication

Send Authorization: Bearer YOUR_API_KEY with a key from the workspace that submitted the document. See Authentication.

Parameters

ParameterLocationRequiredDescription
documentIdPathYesThe identifier returned when the document was submitted
typeQueryYessales
Check the statusbash
curl "https://prod.gets.complyance.io/api/v3/documents/${DOCUMENT_ID}?type=sales" \
  --header "Authorization: Bearer ${COMPLYANCE_API_KEY}" \
  --header 'Accept: application/json'

Response

HTTP 200 returns success: true and the document’s status in data.

Compliant UAE invoice — HTTP 200 (shortened)json
{
  "success": true,
  "data": {
    "documentId": "01K5EXAMPLE00000000000142",
    "documentNumber": "INV-2026-000184",
    "country": "AE",
    "environment": "sandbox",
    "state": "final_valid",
    "isTerminal": true,
    "lastUpdatedAt": "2026-09-22T10:00:04.000Z",
    "errors": [],
    "compliance": {
      "uuid": "6f1c2a9e-3b4d-4e8f-9a7b-1c2d3e4f5a6b",
      "ftaApprovedStatus": "APPROVED",
      "businessProcessIdentifier": "urn:peppol:bis:billing",
      "specificationIdentifier": "urn:peppol:pint:billing-1@ae-1"
    },
    "validationResults": {
      "status": "Valid",
      "validationSteps": [
        { "name": "Validation Passed", "status": "Valid", "error": null },
        { "name": "Queue Admitted", "status": "Valid", "error": null },
        { "name": "Delivery Processing Started", "status": "Valid", "error": null },
        { "name": "Final Valid", "status": "Valid", "error": null }
      ]
    }
  }
}

This example leaves out government and artifacts.

FieldTypeDescription
documentIdstringThe document’s identifier
documentNumberstring or nullThe number from your payload
countrystringThe document’s country
environmentstringsandbox or production
statestringWhere the document is. See States.
isTerminalbooleantrue when processing has finished and state will not change on its own
lastUpdatedAtstringWhen the status last changed, in UTC (ISO 8601)
errorsobject[]What went wrong, when something did. Each has a code, a message, a path to the field as a list of names, and a source: validation, delivery or government. Can be empty while the document is in progress.
governmentobject or nullWhat the tax authority or the Peppol network returned. See The government object.
artifactsobject or nullThe e-invoice: invoiceXmlBase64, the XML Base64-encoded, with invoiceXmlEncoding set to base64. For the UAE, also tddXmlBase64, the tax data document reported to the Federal Tax Authority, when it exists. null before the XML is produced.
complianceobjectUAE, Belgium and Germany only. See Compliance.
validationResultsobjectstatus (Valid, Invalid or Pending) and validationSteps, the steps the document has passed so far

Each validation step has a name, a status (Valid, Invalid, Pending or null for a step not reached) and an error with a code and message, or null. The steps are Validation Passed (or Validation Failed), Queue Admitted, Delivery Processing Started, then Delivery Success, Delivery Failed, Final Valid or Final Invalid.

States

stateWhat it meansisTerminalIn the Invoice PortalWhat to do
submittedThe document passed validation and is waiting for delivery to start.falseDraft, Ready to Process or ReadyCheck again later.
processingDelivery has started, or the authority’s answer is awaited.falseProcessingCheck again later.
delivery_successThe document was delivered. The final result is still to come, except in Belgium and Germany, where this is the last state.falseProcessing, or Submitted in Belgium and GermanyCheck again later. In Belgium and Germany, stop checking.
delivery_failedA delivery attempt did not succeed. This is not the final result, except in Belgium and Germany.falseProcessingRead errors, and keep checking. Do not send the invoice again under a new number: that creates a second invoice. If the state does not change, email support@complyance.io with the documentId.
final_validThe document was accepted as compliant.trueCompliantRecord the outcome.
final_invalidThe tax authority or the network rejected the document.trueNon-CompliantRead errors for the reason. Fix the data and send it as a new document with a new documentNumber. The same number is refused with GETS-HEAD-010.
rejectedThe document failed validation and was stored as Needs Correction.trueNeeds CorrectionFix the fields in errors, then send the document again with the same documentNumber. See Retries and duplicates.

In Saudi Arabia, a delivery_success the authority reports as cleared or reported becomes final_valid, and a delivery_failed it rejected becomes final_invalid.

A document that reached final_valid stays final_valid. In Malaysia, a later cancellation in the MyInvois portal or a rejection by the buyer does not change state; the Invoice Portal shows it under Business status.

In Belgium and Germany, a sales document never becomes terminal. Its last step is delivery to the buyer’s Peppol access point, shown as Submitted in the Invoice Portal. Stop checking when state is delivery_success or delivery_failed. With delivery_failed, read errors and email support@complyance.io with the documentId.

How often to check

While isTerminal is false, wait before checking again, and make each wait longer than the last, for example by doubling it. Stop when isTerminal is true, or, in Belgium and Germany, when state is delivery_success or delivery_failed.

No webhook reports the authority’s or the network’s answer. The invoice.passed and invoice.failed webhooks say only whether the document passed validation when you sent it; see Webhook events. This request is how you learn the outcome.

A successful sandbox result shows that the document passed in sandbox. It does not confirm a production registration or acceptance of a live invoice.

The government object

government is the tax authority’s or the Peppol network’s own record of the document. Its fields differ by country and change as delivery moves on, so use it to show or log the authority’s answer, not to decide what to do next. Act on state and isTerminal.

CountryWhat government holds
Saudi ArabiaZATCA’s result, such as CLEARED for a cleared invoice or REPORTED for a reported one.
MalaysiaThe MyInvois result.
UAE, Belgium and GermanyThe Peppol delivery record. For the outcome in a fixed form, read compliance.ftaApprovedStatus.

The values in government, including any status, are the authority’s or the network’s own, so they differ by country. Saudi Arabia’s, such as CLEARED, REPORTED and REJECTED, are explained on the Saudi Arabia examples page.

Compliance

For the UAE, Belgium and Germany, compliance gives the outcome in a fixed form:

FieldDescription
ftaApprovedStatusAPPROVED when state is final_valid, REJECTED when it is final_invalid or rejected, PENDING otherwise
uuidThe identifier in the e-invoice: its UUID when it has one, otherwise its number
businessProcessIdentifierThe e-invoice’s profile, such as urn:peppol:bis:billing, or null
specificationIdentifierThe specification the e-invoice follows, such as urn:peppol:pint:billing-1@ae-1, or null

Errors

HTTP / codeMeaningWhat to do
401The key is missing or not validCheck the Authorization header. See authentication failures.
404 NOT_FOUNDNo document with this identifier in your workspaceCheck the documentId and use a key from the workspace that submitted it.
422type is missing or is not sales or purchasesAdd type=sales. The body lists the checks that failed in its own format.
500 INTERNAL_ERRORThe document could not be readCheck again after a short wait, then with longer waits.
Document not found — HTTP 404json
{
  "success": false,
  "code": "NOT_FOUND",
  "message": "Document not found"
}

/status returns Document status not found as the message for the same 404.

Last updated