Skip to main content
A
Docs

Yusr API reference

The Yusr invoicing API: authentication with API keys, invoice creation with idempotency keys, CSV and UBL import, and the review queue.

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

MethodPathPurposePermission
POST/api/v1/invoicesCreate an invoiceoperate
POST/api/v1/ingest/csvImport invoices from CSV into a review batchoperate
POST/api/v1/ingest/ublImport UBL XML files into a review batchoperate
GET/api/v1/ingest/batches/{id}Get a review batch and its rowsread
POST/api/v1/ingest/batches/{id}/acceptAccept rows of a batchoperate

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}
    ]
  }'
FieldTypeRequiredMeaning
numberstringNoThe invoice number. Yusr makes one when you leave it out.
customer.namestringYesThe customer name
customer.trnstringYesThe customer TRN: 15 digits that start with 1 and end with 03
datestringYesYYYY-MM-DD
currencystringNoISO currency code. Leave it out for AED.
fxMicrointegerNoThe rate to AED, multiplied by 1,000,000. Required for a foreign currency.
linesarrayYesOne or more lines
lines[].descrstringYesThe description
lines[].qtyintegerYesThe quantity. It must be more than 0.
lines[].unitFilsintegerYesThe unit price in minor units of the invoice currency. 50000 fils is AED 500.
lines[].vatRateintegerYesThe 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

StatusCauseWhat to do
400A field is not valid. For example, the TRN is not 15 digits.Correct the field.
401The key is missing, revoked or not validSend a valid key.
403The role of the key does not allow the actionUse an accountant key.
409The invoice number already existsUse another number, or leave it out.