# Prepare an invoice

*Chapter 03 of 06 · UAE*

Build the sandbox request for your customer’s first UAE invoice. You need the ready source from the previous chapter and invoice data that matches its mapping.

> **Before you start**
>
> Have `COMPLYANCE_SOURCE` set from [Onboard your customer](https://docs.complyance.io/partner-platform/isv/first-uae-invoice/onboard/), and `jq` installed.

## Step 1: Download the sample payload

[Download the UAE GETS sample](https://docs.complyance.io/_app/immutable/assets/uae-invoice-payload.DZIYT4IQ.json) and save it as `uae-invoice-payload.json`.

This is the UAE GETS sample from the published documentation. It is a starting point, not a registered test identity or an invoice ready to send unchanged. Confirm its structure matches your source’s mapping; otherwise use a matching sample from your system.

## Step 2: Replace the example data

| Part | What to check |
| - | - |
| `header` | Unique document number, issue date, due date and currency |
| `parties.seller` | Onboarded company’s legal name, tax details and address |
| `parties.buyer` | Intended buyer’s legal name, tax details, address and Peppol identity |
| `lineItems` | Descriptions, quantities, prices and tax details |
| `totals` | Amounts agree with the lines, allowances, charges and taxes |
| `extensions` | UAE and Peppol fields required by the invoice and mapping |

Use a document number such as `INV-2026-0142` that you have not already submitted for this test. Replace all sample identity values with your agreed sandbox details.

Keep the Peppol identifier value in `parties.buyer.peppolId` separate from its scheme in `extensions.peppol_buyer_peppolIdScheme`. For a UAE identifier using scheme `0235`, do not put the `0235:` prefix into the identifier value itself.

## Step 3: Wrap the payload for Unify

```bash title="Create uae-invoice-request.json"
jq --arg source "${COMPLYANCE_SOURCE}" '{
  country: "AE",
  environment: "sandbox",
  purpose: "invoicing",
  source: $source,
  documentType: {
    base: "tax_invoice",
    modifiers: []
  },
  payload: .
}' uae-invoice-payload.json > uae-invoice-request.json
```

`COMPLYANCE_SOURCE` must match the returned `sourceName:sourceVersion`. Leave the country and environment as `AE` and `sandbox` for this walkthrough.

## Step 4: Review the request

```bash title="Check the request before sending"
jq -e '.country == "AE" and .environment == "sandbox" and (.source | length > 0) and (.payload | type == "object")' uae-invoice-request.json
```

This checks the request envelope and JSON structure. It does not replace invoice validation or verify the buyer’s identity.

## If something goes wrong

**The JSON cannot be read:** check missing commas, quotation marks and brackets before submitting.

**The source is empty or wrong:** return to the saved onboarding response and use its exact source name/version.

> **Ready to submit**
>
> You have `uae-invoice-request.json` containing your sandbox invoice and the correct source. Next: [Submit the invoice](https://docs.complyance.io/partner-platform/isv/first-uae-invoice/submit/).

---

**Next chapter (04):** [Submit the invoice](https://docs.complyance.io/partner-platform/isv/first-uae-invoice/submit/). Send the invoice through Unify.

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