Alya Books

    Developer docs

    REST API, webhooks, MCP server and CLI for UAE e-invoicing

    CargoWise field mapping

    Every UniversalTransaction element Alya Books reads, the API field and PINT AE term it fills, whether it is required, and the rule that checks it.

    Alya Books reads the Universal XML that eAdaptor sends for an AR transaction. WiseTech publishes the schema to licensees only, so the reader is deliberately tolerant: namespaces and envelopes are ignored, several spellings are read for each element (in brackets), and anything not listed here is ignored. Download the table as CSV.

    The seller (name, TRN, address, Peppol ID, bank details) always comes from the organisation's profile in Alya Books, never from the message. Lines get their VAT treatment from the connector's charge map; see the charge-code template.

    Check a message without creating anything: POST {BASE}/invoices/validate?connector=cargowise with the message as the body returns the mapped invoice, the notes and every failed rule.

    Document

    CargoWise elementRequiredAlya Books fieldPINT AERule or behaviour
    TransactionInfo/Number (TransactionNumber; InvoiceNumber)YesinvoiceNumberBT-1 Invoice numberUnique per seller. With the branch and type it forms the message key cargowise:::, so a resend is answered as a duplicate.
    TransactionInfo/TransactionType (TransactionType/Code; Type)No (default INV)invoiceTypeCodeBT-3 Invoice type codeINV, ARI, AR → 380 tax invoice; CRD, CRN, ARC → 381 credit note; DBN, DEB → 383 debit note; or a 3-digit code. Anything else is refused.
    TransactionInfo/TransactionDate (PostDate; InvoiceDate)YesissueDateBT-2 Issue dateYYYY-MM-DD or DD/MM/YYYY.
    TransactionInfo/DueDate (PaymentDueDate)Yes for invoices with a payment duedueDateBT-9 Payment due dateMissing due date fails IBR-127-AE unless payment terms are given.
    TransactionInfo/Currency/Code (Currency; LocalCurrency/Code)No (default AED)currencyBT-5 Invoice currency codeISO 4217.
    TransactionInfo/ExchangeRate (LocalExchangeRate)For non-AED invoicesexchangeRateBT-111 / AED tax totalsWhen absent, Alya Books uses the UAE Central Bank rate for the date of supply (the issue date when no supply date is given).
    TransactionInfo/Branch/Code (Branch; BranchCode)Nometadata.branch—Part of the message key; printed in the logistics Shipment panel.
    TransactionInfo/JobNumber (Job/Key; Job/JobNumber; JobKey)Nometadata.job—Kept as a custom field and in the invoice note; printed in the logistics Shipment panel.
    TransactionInfo/HouseBill (HouseBillNumber; Shipment/HouseBill)Nometadata.house_bill—Kept as a custom field and in the invoice note; printed in the logistics Shipment panel.
    TransactionInfo/ShipmentIncoTerm/Code (IncoTerm/Code; Incoterms; or Shipment/ShipmentIncoTerm/Code)NoincotermsDelivery terms (cac:DeliveryTerms)EXW, FCA, CPT, CIP, DAP, DPU, DDP, FAS, FOB, CFR, CIF. An unknown code is left out with a note.
    TransactionInfo/OriginalTransactionNumber (ReferenceTransactionNumber; AppliedInvoiceNumber)Yes for credit and debit notesprecedingInvoice.numberBT-25 Preceding invoice reference
    TransactionInfo/OriginalTransactionDate (ReferenceTransactionDate)Yes for credit and debit notesprecedingInvoice.issueDateBT-26 Preceding invoice issue date
    TransactionInfo/CreditNoteReason (CreditNoteReason/Code; ReasonCode; CreditReason)Yes for credit notescreditNoteReasonCodeBTAE-03 Credit note reasonAlya Books never guesses a tax reason; a credit note without one fails validation.
    TransactionInfo/PK (Key; TransactionKey)No——Kept as a note on the message for tracing.

    Buyer

    CargoWise elementRequiredAlya Books fieldPINT AERule or behaviour
    Organization/FullName (Name; CompanyName; OrganizationName)Yesbuyer.nameBT-44 Buyer nameThe Organization block is the customer of the AR transaction.
    Organization/RegistrationNumber with Type TRN|VAT|TAXREG (or TRN; TaxRegistrationNumber; VATNumber)Yes for VAT-registered UAE buyersbuyer.trnBT-48 Buyer VAT identifier15 digits. A UAE buyer needs a TRN or a legal registration (IBR-135-AE).
    Organization/Code (OrganizationCode)Nobuyer.externalId—Matches the Alya Books customer created for this CargoWise organisation.
    Organization/Email (Contact/Email)Nobuyer.email—Used to send the invoice when sending is on.
    Address/Address1 (AddressLine1; Street)Yes for UAE buyersbuyer.address.streetBT-50 Buyer address line 1IBR-144-AE needs street; city and emirate.
    Address/Address2 (AddressLine2)Nobuyer.address.additionalBT-51 Buyer address line 2
    Address/City (CityOrSuburb)Yes for UAE buyersbuyer.address.cityBT-52 Buyer city
    Address/State/Code (State; Emirate)Yes for UAE buyersbuyer.address.emirateBT-54 Buyer country subdivisionEmirate code or name, e.g. DXB or Dubai.
    Address/Postcode (PostCode; PostalCode)Nobuyer.address.postalCodeBT-53 Buyer post code
    Address/Country/Code (CountryCode; Country)Yesbuyer.address.countryBT-55 Buyer country codeAE is assumed when a TRN is present.

    Lines

    CargoWise elementRequiredAlya Books fieldPINT AERule or behaviour
    PostingJournalCollection/PostingJournal (TransactionLineCollection/TransactionLine; InvoiceLineCollection/InvoiceLine; ChargeLineCollection/ChargeLine)At least oneitems[]BG-25 Invoice line
    ChargeCode (ChargeCode/Code; ChargeLine/ChargeCode; Code)Yescharge map keyBT-151 VAT category; item type (G, S, B); service or HS codeLooked up in the connector's charge map (VAT category, item type, service accounting code, HS code, exemption reason, transaction type).
    VATCode (VATCode/Code; TaxCode; Tax/Code; VAT/Code)Fallbackitems[].taxCategoryBT-151 Invoiced item VAT categoryUsed only when the charge code is not mapped: the connector's VAT-code map, then S/STD/5/VAT5 standard, Z/ZR/ZERO zero rated, E/EX/EXEMPT exempt, O/OS/OOS/NA/DISB out of scope, RC/RCM/AE reverse charge, then the connector's default category. Otherwise the message fails and names the code.
    Quantity (ChargeLine/Quantity)No (default 1)items[].quantityBT-129 Invoiced quantity
    Amount (NetAmount; OSAmount; LocalAmount; ChargeLine/SellOSAmount; ChargeLine/SellLocalAmount)Yesline net amountBT-131 Invoice line net amountNet of VAT, in the invoice currency.
    UnitPrice (SellRate; ChargeLine/SellRate)No (amount ÷ quantity)items[].unitPriceBT-146 Item net priceRounded to 2 decimals.
    Description (ChargeLine/Description; ChargeCode/Description)No (charge code)items[].descriptionBT-153 Item name
    PK (Key; LineNumber)Noitems[].externalId—Kept for tracing.

    Seller

    CargoWise elementRequiredAlya Books fieldPINT AERule or behaviour
    — (not read from the message)—Organisation profile in Alya BooksBG-4 SellerSeller name, TRN, address, Peppol ID and bank details come from Settings → Company, never from the message.

    Message key and duplicates

    Each message gets the key cargowise:<branch>:<type>:<number> (for example cargowise:DXB:INV:INV-2027-00412). It is the invoice's externalId, it appears in webhook payloads, and a second message with the same key answers duplicate without creating anything. To correct an invoice after it was reported, post a credit note; to fix a mapping before it was processed, replay the stored message from the log.