API reference

Entities

Read and manage companies (entities) provisioned through FTA onboarding. Your application reaches every entity its owner can reach in the Tax Star E-Invoice application — the ones they own or are a member of — automatically. There is nothing to connect. What it may do on each follows the owner's role there: an Editor's app has full access except deleting the entity; an Approver's or Viewer's app is read-only. Every entity in GET /oauth/entities carries an access block saying which. See Roles and permissions for the full rules. Requires an access token.

Every invoice an entity sends names the company that issues it, and the UAE e-invoicing rules (PINT AE Billing 1.0.4) require that company’s legal registration on the document: a number that says who the company is in a register, how that number was issued and, for some kinds, by whom. You state it once, on the entity, with PATCH or PUT /oauth/entities/{entity_id}. Every invoice for the entity then carries it, exactly as stated.

Why it is mandatory

  • The rules require it. The seller’s legal registration identifier is a mandatory element of a UAE e-invoice (business term IBT-030), with its type and the issuing authority or country. An invoice without it is not a valid PINT AE document, however complete the rest is.
  • It identifies the issuer. The TRN identifies the company for VAT; the registration identifies it as a legal person. The buyer’s system and the authority read both.
  • A guess would be wrong data on a tax document. An earlier version of the API sent a stand-in value when none was stated. A stand-in is a valid-looking document that says something untrue about the seller, so it was removed: you are told what is missing instead.
  • State it once. It describes the company, not one invoice. Keeping it on the entity means an integration does not have to repeat it on every send.

The rules behind it: IBR-150-AE (the identifier is present), IBR-173-AE and IBR-181-AE (its type is stated), IBR-172-AE (a trade licence names its issuing authority), IBR-012-AE and IBR-013-AE (a passport names its country, as an ISO 3166-1 code). Search these IDs in the Peppol PINT AE documentation for the full text. The Invoice validation page lists them with the exact messages.

What to send, by type

Send the number and its type together, plus what that type needs. Choose the document that proves how the company is registered.

TypeUse it forlegal_registration_idAlso requiredSent on the invoice
TLA company with a commercial or trade licence. The usual choice.The licence number as printed, for example CN-7654321.issuing_authority: who issued the licence, for example Dubai Department of Economy and Tourism.The number, with the type and the authority.
EIDAn individual or sole proprietor identified by an Emirates ID.The Emirates ID number with its dashes, for example 784-1990-1234567-1.Nothing.The number with the type. No authority is sent, even if you stored one.
PASAn individual identified by a passport.The passport number as printed, for example P1234567.passport_country: a two-letter ISO 3166-1 code in capitals, for example IN.The number, with the type and the country.
CDA body established by a cabinet decision.The decision number as it is written in the decision.Nothing.The number with the type. No authority is sent.
PATCH /oauth/entities/{entity_id}: a trade licence
curl -X PATCH "$BASE/oauth/entities/$ENTITY_ID" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "legal_registration_type": "TL",
    "legal_registration_id": "CN-7654321",
    "issuing_authority": "Dubai Department of Economy and Tourism"
  }'

How it appears in the document, per type:

TL
<cac:PartyLegalEntity>
  <cbc:RegistrationName>ABC Corp LLC</cbc:RegistrationName>
  <cbc:CompanyID schemeAgencyID="TL" schemeAgencyName="Dubai Department of Economy and Tourism">CN-7654321</cbc:CompanyID>
</cac:PartyLegalEntity>
EID
<cbc:CompanyID schemeAgencyID="EID">784-1990-1234567-1</cbc:CompanyID>
PAS
<cbc:CompanyID schemeAgencyID="PAS" schemeAgencyName="IN">P1234567</cbc:CompanyID>

No schemeID is ever set on the number: a licence number has no electronic-address scheme.

What is checked, and where

WhenWhat happens
You update the entityThe four fields are checked together against what the entity will hold afterwards. An id needs its type, a type needs its id, a trade licence needs issuing_authority and a passport needs passport_country as an ISO 3166-1 code. Otherwise the update is a 400 and nothing is stored.
You update something elseAn update that does not touch the four fields is not checked, so an entity with an older, incomplete registration can still be renamed or have its address changed.
You send or validate an invoiceThe registration is read from the invoice’s own seller block if it has one, otherwise from the entity as it is at that moment. A missing or incomplete one refuses the invoice with a 422 (and /validate reports it as is_valid: false). Each missing piece is its own error in section seller_party, with the rule and where to state it.
An invoice arrives from your accounting systemThe same rule applies. An entity that has not provided its registration fails validation with an error in section seller_party that lists what is missing and says to add it to the entity’s details, in the application or through this API, then send the invoice again.
You set nothing at allAllowed on the entity: you can create it and add the registration later. It is the invoice that refuses to send without one.

The two refusals you will meet on the update:

400: an id with no type
{
  "error": "legal_registration_type is required when legal_registration_id is given: one of TL (trade licence), EID (Emirates ID), PAS (passport) or CD (cabinet decision)."
}
400: a trade licence with no authority
{
  "error": "issuing_authority is required when legal_registration_type is TL."
}

And on a send or a validate, when the entity has none:

422: nothing stated (shortened)
{
  "is_valid": false,
  "errors": [
    {
      "section": "seller_party",
      "message": "Seller legal registration identifier (IBT-030) is required (ibr-150-ae): the seller's trade licence, Emirates ID, passport or cabinet decision number (legal_registration_id); ..."
    },
    {
      "section": "seller_party",
      "message": "Seller legal registration type (BTUAE-15) is required (ibr-173-ae), one of TL, EID, PAS, CD ..."
    }
  ]
}

Per invoice, or once on the entity

You can also state the registration in a seller block on a single invoice. That block wins for that invoice only. Stating it once on the entity and leaving the block out is the normal way: it keeps every invoice of the company consistent.

Because the entity is read when the invoice is processed, a registration added after an invoice was accepted is picked up when the invoice is next processed or re-sent.

Questions

QuestionAnswer
Which roles can state it?An app with admin or editor access to the entity. An approver’s or viewer’s app gets 403.
Can I use my TRN or TIN?No. They are tax numbers, not legal registration numbers, and are never taken for one.
How do I see what is stored?GET /oauth/entities/{entity_id} returns legal_registration_id, legal_registration_type, issuing_authority and passport_country.
PATCH or PUT?The same partial update: send only what you change. If you change one of the four, send the others they depend on.
I send the old trade_license_number field.Still accepted as the number. Sending legal_registration_id replaces it, and the type is then required with it.
My invoices were accepted before. Why are they refused now?The entity had no registration stated. State it once with the update above, then send again; a refused invoice can be corrected and re-sent with the same invoice number.
GET/oauth/entitiesAccess token

List entities

Return every entity your application can reach: owned by the app's owner or shared with the owner by invitation. Each entity carries access: { role, via, can_write, can_delete }. role is admin, editor, approver or viewer; via is owner (the owner's own entity) or member (shared with the owner). users_access, the list of who has access, is filled in only where role is admin or editor; for an approver's or viewer's entity it is an empty list. Pass user_id to return only the entities owned by a specific user. Paged: page (default 1) and limit (default 20, at most 100); the response carries pagination: { total_data, total_page, page, limit } — keep requesting pages until page reaches total_page. search narrows to entities whose company name or TRN contains the text.

Query parameters

user_idOnly entities owned by this user of your app.
pagePage number. Defaults to 1.
limitEntities per page, 1-100. Defaults to 20.
searchOnly entities whose company name or TRN contains this text.
GET/oauth/entities/{entity_id}Access token

Get an entity

Fetch a single entity your application can reach, with the same access block as GET /oauth/entities. users_access (who has access) is filled in only for an admin's or editor's app, and empty for an approver's or viewer's. An entity the app cannot reach answers 404, the same as one that does not exist.

PATCH/oauth/entities/{entity_id}Access token

Update an entity

Update one or more fields of an entity. PATCH and PUT are the same partial update: send only the fields you want to change. Needs admin or editor access to the entity; an approver's or viewer's app gets 403. This is where you state the SELLER's legal registration (IBT-030): legal_registration_id, legal_registration_type, issuing_authority and passport_country. Every invoice sent for the entity carries it as given, and an invoice is refused (422) while the entity, or the invoice's own seller block, has none. Nothing is filled in for you. The four fields are checked together against what the entity will then hold: an id needs its type, a type needs its id, a trade licence (TL) needs issuing_authority and a passport (PAS) needs passport_country; otherwise the update is a 400 and nothing is stored. You can also switch the entity's invoice approval on or off with is_active_send_approver, the same setting as Require Approval for Sending in the web app.

Request body example
{
  "city": "Abu Dhabi",
  "email": "billing@abccorp.com",
  "legal_registration_type": "TL",
  "legal_registration_id": "CN-7654321",
  "issuing_authority": "Dubai DET"
}

Body parameters

legal_registration_idstringconditionalThe seller's trade licence, Emirates ID, passport or cabinet-decision number. Mandatory before the entity can send (IBR-150-AE). Send it with legal_registration_type: one without the other is a 400.In the PINT XML → the seller's cac:PartyLegalEntity/cbc:CompanyID (IBT-030) on every invoice.
legal_registration_typestringconditionalOne of TL (Commercial/Trade license), EID (Emirates ID), PAS (Passport) or CD (Cabinet decision); any other value is a 400. Mandatory before the entity can send (IBR-173-AE).In the PINT XML → the @schemeAgencyID on that cbc:CompanyID (BTUAE-15).
issuing_authoritystringconditionalThe authority that issued the registration, for example Dubai DET. Required when legal_registration_type is TL (the update is a 400 without it). It is not sent for EID or CD.In the PINT XML → the @schemeAgencyName on that cbc:CompanyID (BTUAE-12).
passport_countrystringconditionalThe passport-issuing country as a two-letter ISO 3166-1 code, for example IN. Required when legal_registration_type is PAS (the update is a 400 without it, or with a code that is not an ISO 3166-1 country).In the PINT XML → the same @schemeAgencyName, in place of issuing_authority, when the type is PAS (BTUAE-18).
trade_license_numberstringoptionalThe old name of legal_registration_id, still accepted. Sending legal_registration_id replaces it.
is_active_send_approverbooleanoptionalRequire Approval for Sending, the same setting as the switch in the web app. true: invoices the entity sends are held as WAITING_FOR_APPROVAL until an approver decides them; false: they are sent without approval. Needs admin or editor access, like the switch. It does not change an invoice that is already waiting, and an API invoice can still skip approval with bypass_send_approval true. Leave it out to keep the current setting. A value that is not a boolean is a 400.In the PINT XML Not emitted. It decides whether the invoices this entity sends wait for an approver.

Responses

200Entity updated successfully
403Your role on this entity is read-only (approver or viewer)
404Entity not found, or not reachable by this application
POST/oauth/entities/{entity_id}/membersAccess token

Invite a member

Invite someone to the entity by email, with the role editor, approver or viewer — the same invitation an Admin or Editor sends from the User Access panel in the Tax Star E-Invoice application, with the same email and link. Admin is never offered, as in the application. The link is valid for 24 hours. An approver joins without a TaxStar account by accepting on the confirmation page, and from then on is emailed every invoice of this entity that waits for approval — this is how an integration appoints the approvers for Require Approval for Sending. An editor or viewer with no account gets one when they accept (creates_account: true); one who already has an account signs in and opens the link. Needs admin or editor access to the entity. The response carries invitation: { id, email, role, status, creates_account, created_at, expires_at }. The address is stored lower-cased.

Request body example
{
  "email": "approver@example.com",
  "role": "approver"
}

Body parameters

emailstringoptionalWho is invited. The invitation link is emailed to this address.
rolestringoptionalOne of "editor", "approver" or "viewer". See Roles and permissions for what each may do.

Responses

201Invitation sent; the body carries the invitation
400Invalid email or role (admin is not offered), or the address already has access
403Your role on this entity is approver or viewer
404Entity not found, or not reachable by this application
GET/oauth/entities/{entity_id}/membersAccess token

List members and invitations

Who has access to the entity and who is invited but has not accepted yet. members is a list of { email, role, added_at }; invitations is a list of { id, email, role, status, creates_account, created_at, expires_at }, where status is pending or expired. An accepted invitation moves to members; a revoked one disappears. Needs admin or editor access, as in the application — the list names other people, so an approver's or viewer's app gets 403.

Responses

200Members and outstanding invitations
403Your role on this entity is approver or viewer
404Entity not found, or not reachable by this application
DELETE/oauth/entities/{entity_id}/members/invitations/{invitation_id}Access token

Revoke an invitation

Withdraw an invitation that has not been accepted; its link stops working. Use the id from the invite response or from the list. An invitation that was already accepted is a membership and answers 404 here. Needs admin or editor access to the entity.

Responses

200Invitation revoked
403Your role on this entity is approver or viewer
404Entity not found, or no pending invitation with this id on it