# Check the result

*Chapter 05 of 06 · UAE*

Read the invoice’s final sandbox outcome and handle any validation errors. You need the documentId returned by the submission request.

> **Before you start**
>
> Have the `documentId` you saved in [Submit the invoice](https://docs.complyance.io/partner-platform/isv/first-uae-invoice/submit/).

## Request the status

Set `DOCUMENT_ID` to the returned tracking identifier, then run:

```bash title="Read the invoice status"
curl "https://prod.gets.complyance.io/api/v3/documents/${DOCUMENT_ID}?type=sales" \
  --header "Authorization: Bearer ${COMPLYANCE_API_KEY}" \
  --header 'Accept: application/json'
```

Read `data.state` together with `data.isTerminal`. If `isTerminal` is `false`, wait before checking again and increase the delay between repeated checks. Stop polling once the response is terminal.

You should see a response like this:

```json title="Invoice accepted — HTTP 200 (shortened)"
{
  "success": true,
  "data": {
    "documentId": "01K5EXAMPLE00000000000142",
    "documentNumber": "INV-2026-0142",
    "country": "AE",
    "environment": "sandbox",
    "state": "final_valid",
    "isTerminal": true,
    "lastUpdatedAt": "2026-10-01T09:05:12.000Z",
    "errors": [],
    "validationResults": {
      "status": "Valid"
    }
  }
}
```

## Interpret the result

| State | What to do |
| - | - |
| `final_valid` | Record the successful outcome for this environment |
| `final_invalid` or `rejected` | Inspect the returned errors and correct the invoice |
| `submitted` or `processing` | Wait for the final result |
| `delivery_success` | Continue checking if `isTerminal` remains `false` |
| `delivery_failed` | Inspect the response and retain the document and request identifiers |

A successful sandbox result confirms sandbox processing. It does not confirm production registration or live invoice acceptance.

## If something goes wrong

**A validation error names a field or rule:** correct that part of the invoice and review related totals before submitting the corrected data.

**The document is not found:** check the returned identifier, workspace key and environment.

**Processing does not finish:** keep the document identifier, request identifier and latest response for support. Avoid repeatedly resubmitting the same invoice.

In the Client Portal, the same document shows in **Documents** with the statuses explained in [Document statuses](https://docs.complyance.io/one-platform/invoice-portal/documents/statuses/).

Next, [go live](https://docs.complyance.io/partner-platform/isv/first-uae-invoice/go-live/) to send the same invoice in production.

---

**Next chapter (06):** [Go live](https://docs.complyance.io/partner-platform/isv/first-uae-invoice/go-live/). Move the customer to production and send a live invoice.

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