# Submit the invoice

*Chapter 04 of 06 · UAE*

Send your prepared UAE invoice through Unify and save its tracking identifier. You need the sandbox API key and uae-invoice-request.json from the previous chapter.

> **Before you start**
>
> Have `uae-invoice-request.json` from [Prepare an invoice](https://docs.complyance.io/partner-platform/isv/first-uae-invoice/prepare/) and your sandbox key loaded as `COMPLYANCE_API_KEY`.

## Send the request

```bash title="Submit the prepared invoice"
curl --request POST 'https://prod.gets.complyance.io/api/v3/unify' \
  --header "Authorization: Bearer ${COMPLYANCE_API_KEY}" \
  --header 'Content-Type: application/json' \
  --header 'Accept: application/json' \
  --header 'new-api: true' \
  --data @uae-invoice-request.json \
  --output invoice-response.json
```

Use the request file you reviewed in the previous chapter. Unify uses the Bearer header, unlike Connect’s `X-API-Key` header.

## Keep the response

You should see HTTP `200`. `invoice-response.json` looks like this:

```json title="invoice-response.json"
{
  "documentId": "01K5EXAMPLE00000000000142",
  "documentNumber": "INV-2026-0142",
  "message": "Your invoice was validated and is ready for submission.",
  "Base64XML": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4…"
}
```

Save the returned `documentId` alongside your invoice number. `Base64XML` is the e-invoice that was produced, Base64-encoded. Every field is described in [Submit and retrieve](https://docs.complyance.io/api-reference/unify/submit-and-retrieve/#response).

If the invoice fails validation, you get HTTP `422` and a list of errors instead. Each one names the field and, when there is one, the rule. See [Errors](https://docs.complyance.io/api-reference/unify/errors/):

```json title="A validation error — HTTP 422 (shortened)"
{
  "validationStage": "gets",
  "errors": [
    {
      "code": null,
      "getsPath": "parties.buyer.name",
      "payloadPath": "parties.buyer.name",
      "message": "Buyer name is required.",
      "severity": "error",
      "ruleSet": "AE:tax_invoice"
    }
  ]
}
```

Correct the field in `uae-invoice-payload.json`, rebuild the request as in the previous chapter and send it again. Keep the request identifier and error details if a request fails for any other reason.

A successful HTTP response means the submission request succeeded. Check the document’s final state before recording the invoice as accepted.

## If something goes wrong

**Authentication fails:** check the Bearer header and sandbox key.

**The source or mapping is rejected:** compare the request’s `source` with the onboarding response and confirm `readyForInvoicing`.

**The response is lost:** check the portal for the original invoice before sending it again. Do not assume a timeout means nothing was submitted.

Next: [Check the result](https://docs.complyance.io/partner-platform/isv/first-uae-invoice/result/) with the saved `documentId`.

---

**Next chapter (05):** [Check the result](https://docs.complyance.io/partner-platform/isv/first-uae-invoice/result/). Read the status and handle any errors.

Source: https://docs.complyance.io/partner-platform/isv/first-uae-invoice/submit/
