Base address and specification
Anar gives you the Yusr address. All paths below start with /api/v1.
The API publishes its own OpenAPI 3.1 specification at /api/v1/openapi.json and an interactive reference at /api/v1/docs. Neither needs a key.
Authentication
Send an API key in one of these headers:
X-API-Key: yusr_...
Authorization: Bearer yusr_...
Read Sign-in and roles to create a key.
Endpoints
| Method | Path | Purpose | Permission |
|---|---|---|---|
| POST | /api/v1/invoices | Create an invoice | operate |
| POST | /api/v1/ingest/csv | Import invoices from CSV into a review batch | operate |
| POST | /api/v1/ingest/ubl | Import UBL XML files into a review batch | operate |
| GET | /api/v1/ingest/batches/{id} | Get a review batch and its rows | read |
| POST | /api/v1/ingest/batches/{id}/accept | Accept rows of a batch | operate |
An accountant key has read and operate. A viewer key has read only.
Create an invoice
curl https://yusr.example.ae/api/v1/invoices \
-H "X-API-Key: $API_KEY" \
-H "Idempotency-Key: pos-7781-2026-11-18" \
-H "Content-Type: application/json" \
-d '{
"customer": {"name": "Al Noor Trading LLC", "trn": "100000000000003"},
"date": "2026-11-18",
"lines": [
{"descr": "Consulting services", "qty": 10, "unitFils": 50000, "vatRate": 5}
]
}'
| Field | Type | Required | Meaning |
|---|---|---|---|
number | string | No | The invoice number. Yusr makes one when you leave it out. |
customer.name | string | Yes | The customer name |
customer.trn | string | Yes | The customer TRN: 15 digits that start with 1 and end with 03 |
date | string | Yes | YYYY-MM-DD |
currency | string | No | ISO currency code. Leave it out for AED. |
fxMicro | integer | No | The rate to AED, multiplied by 1,000,000. Required for a foreign currency. |
lines | array | Yes | One or more lines |
lines[].descr | string | Yes | The description |
lines[].qty | integer | Yes | The quantity. It must be more than 0. |
lines[].unitFils | integer | Yes | The unit price in minor units of the invoice currency. 50000 fils is AED 500. |
lines[].vatRate | integer | Yes | The VAT rate in percent, for example 5 |
Response
{"id": "inv_...", "number": "INV-2026-0042", "customer": "Al Noor Trading LLC", "amount": 5000, "vat": 250, "status": "Draft"}
Idempotency
Send an Idempotency-Key header with each new invoice. If you send the same key again, Yusr returns the first invoice and does not create a second one. Use this when you retry after a network error.
Import CSV
{"filename": "november.csv", "content": "<the CSV text>"}
Import UBL
{"files": [{"filename": "INV-0042.xml", "content": "<the XML text>"}]}
Up to 50 files in one request and 2 MB for each file.
Errors
| Status | Cause | What to do |
|---|---|---|
| 400 | A field is not valid. For example, the TRN is not 15 digits. | Correct the field. |
| 401 | The key is missing, revoked or not valid | Send a valid key. |
| 403 | The role of the key does not allow the action | Use an accountant key. |
| 409 | The invoice number already exists | Use another number, or leave it out. |