# Unify examples

Compare a Unify request with the responses for a valid document and a validation failure. Use the full UAE invoice in the quickstart when you want to send a request.

## Request

```http title="Submit a document"
POST https://prod.gets.complyance.io/api/v3/unify
```

Send a bearer API key, `Content-Type: application/json` and `new-api: true`. This envelope shows where the country, source and document type go; the `payload` is your invoice data.

```json title="Request envelope"
{
  "country": "AE",
  "environment": "sandbox",
  "purpose": "invoicing",
  "source": "acme-erp:1.0.0",
  "documentType": {
    "base": "tax_invoice",
    "modifiers": []
  },
  "payload": {
    "header": {
      "documentType": { "base": "tax_invoice" },
      "documentNumber": "INV-2026-000184",
      "issueDate": "2026-09-18",
      "currency": "AED"
    }
  }
}
```

The shortened `payload` illustrates the envelope and is not a complete invoice. Copy the [complete request in the quickstart](https://docs.complyance.io/get-started/quickstart/) when testing, then replace its sample source and invoice number with your own values. The [GETS field reference](https://docs.complyance.io/api-reference/gets/fields/) shows the fields for each country and document type.

## Successful validation

```json title="Selected fields from HTTP 200"
{
  "documentId": "01K5EXAMPLE00000000000142",
  "documentNumber": "INV-2026-000184",
  "message": "Your invoice was validated and is ready for submission."
}
```

This excerpt leaves out `Base64XML`, which contains the generated invoice XML when available. Keep `documentId` to [check the document](https://docs.complyance.io/api-reference/unify/submit-and-retrieve/). The success response confirms validation; delivery may continue afterwards.

## Validation failure

```json title="HTTP 422"
{
  "documentId": "01K5EXAMPLE00000000000142",
  "documentNumber": "INV-2026-000184",
  "message": "Your invoice could not be validated. Review the errors and try again.",
  "validationStage": "gets",
  "errors": [
    {
      "code": "IBR-015",
      "getsPath": "totals.amountDue",
      "payloadPath": "totals.amountDue",
      "message": "An Invoice MUST have the Amount due for payment (ibt-115).",
      "severity": "error",
      "ruleSet": "ae:tax_invoice"
    }
  ]
}
```

Use `payloadPath` to locate the value you sent. Correct the findings in `errors` and send the document again. See [Unify errors](https://docs.complyance.io/api-reference/unify/errors/) for other response statuses.

Source: https://docs.complyance.io/api-reference/unify/examples/
