Overview
This guide describes how Focus RT (Focus Softnet's real-time ERP for trading, retail and distribution) connects to TrustBill, a UAE FTA-accredited service provider (ASP), so Focus RT users can issue PINT-AE compliant e-invoices without replacing their ERP.
Focus RT stores your sales, purchases, VAT, inventory and receivables. TrustBill sits between Focus RT and the UAE Federal Tax Authority (FTA): invoice data is transferred from Focus RT through the TrustBill connector, converted to PINT-AE XML, validated in real time, delivered over Peppol via a certified ASP (Tron-Stride or Storecove), and the FTA acknowledgement is returned as a status update.
What this integration delivers
- Zero-code path from Focus RT invoices to FTA-compliant PINT-AE XML
- Live FTA status (delivered / acknowledged / rejected) surfaced back next to each Focus RT invoice
- Support for tax invoices, credit notes and debit notes issued from Focus RT
- Bulk migration path for historical Focus RT invoices via CSV
- Preserves the Focus RT invoice number as the FTA-visible document ID
- Free-zone, designated-zone, reverse-charge and margin-scheme flags mapped end to end
Focus RT Product Scope
TrustBill's Focus RT connector supports these editions and deployment models:
| Product | Deployment | Support |
|---|---|---|
| Focus RT | On-premise / Windows Server | Full (recommended) |
| Focus RT | Focus Cloud / private hosted | Full via TrustBill Cloud Bridge |
| Focus iERP | Cloud | Full — see the Focus integration overview |
| Focus 9 / Focus 8 | On-premise | Supported via CSV export + TrustBill connector |
| Custom Focus deployments | Varies | Contact TrustBill — custom mappers available |
Prerequisites
On the Focus RT side
- A Focus RT installation with sales, purchase and VAT modules enabled
- Database access (SQL Server / MySQL / PostgreSQL depending on your Focus edition) or export-file access for the CSV path
- Company master with valid 15-digit UAE TRN saved on the seller record
- Customer master records populated with buyer name, TRN (for B2B), country code and address
- Tax masters mapped to VAT rates that align with UAE FTA categories (Standard 5%, Zero-rated, Exempt, Out-of-scope)
- Windows account with Read permission on the Focus RT database (for the direct-connect path)
On the TrustBill side
- A TrustBill SME account (one account = one TRN)
- Completed KYB (business verification) — your company logo, trade licence and TRN certificate uploaded
- Active submission mode set to
testorsandboxduring onboarding,livewhen going into production - Per-tenant API credential (issued by TrustBill support) for headless server-to-server calls
Integration Architecture
The Focus RT ↔ TrustBill integration follows a request/response outbound, polling inbound pattern today (an outbound webhook is on the roadmap).
Outbound flow (Focus RT → TrustBill → FTA)
- An invoice is posted in Focus RT. The connector detects the new row (polling the Focus RT DB / watching an export folder).
- Connector maps the Focus RT invoice header + lines into TrustBill's
InvoiceCreateInputshape. - Connector calls
POST /v1/invoices— the invoice is stored in TrustBill asdraft. Nothing has reached the FTA yet. - Connector calls
POST /v1/invoices/submitwith the draft's UUID — status flips toqueued. - TrustBill's pipeline runs:
queued → transformed → validated → delivered(PINT-AE XML built, Schematron-validated, and handed to the ASP). - ASP (Tron-Stride / Storecove) forwards the XML to the FTA over Peppol.
Inbound flow (FTA → TrustBill → Focus RT)
- The ASP posts an inbound webhook to TrustBill when the FTA acknowledges or rejects the invoice.
- TrustBill verifies the ASP's HMAC signature + timestamp and updates the invoice status to
acknowledgedorrejected. - The Focus RT connector polls
GET /v1/invoices/{id}(or the batch list endpoint) at 2–5 minute intervals for invoices still in a non-terminal status. - On
acknowledged, the connector writes the FTA acknowledgement reference back into a custom field on the Focus RT invoice; onrejected, it writes the rejection reason and (optionally) unposts the invoice for the user to correct.
Connection Methods
Pick the option that matches your Focus RT deployment:
1. TrustBill Windows Connector (recommended)
A signed Windows service installed on the Focus RT database server. Talks to the Focus RT DB read-only, batches invoices, and calls the TrustBill API over TLS 1.3.
- Best for on-premise Focus RT installations
- No changes to Focus RT source code required
- Automatic retry, offline queue, tamper-evident audit log
- Configuration file names the connection string, TrustBill API key and mode
2. CSV / XLSX drop folder
Focus RT is scheduled to export invoices (daily or hourly) to a shared folder using the built-in Report Writer. TrustBill's watcher picks up the file, validates it, and calls POST /v1/invoices/bulk.
- Best for low-volume trading / retail businesses
- Zero database access needed
- Uses the standard TrustBill CSV schema (see Bulk Migration)
3. Direct HTTP integration (custom)
If your Focus RT deployment is customised or you already have middleware, call the TrustBill REST API directly.
- Best when Focus RT posts documents via a message bus or a custom .NET plug-in
- Use the same endpoints documented in the ERP Partner API guide
- You are responsible for retries, idempotency keys and status polling
Which method should I use?
If your Focus RT runs on-premise on a Windows server you control, use the Windows Connector. If you use Focus Cloud or a hosted deployment, use the CSV drop or the direct HTTP path with your own middleware.
Authentication
TrustBill's API uses Bearer JWT authentication. The Focus RT connector authenticates once per tenant with a per-tenant API credential and refreshes the token on expiry.
Required request headers
Authorization: Bearer {jwt_token}
Content-Type: application/json
Idempotency-Key: {unique_key_per_request}
X-TrustBill-Source: focus-rt-connector/1.0Idempotency-Key is mandatory
Every write endpoint (POST /v1/invoices, POST /v1/invoices/bulk, POST /v1/invoices/{id}/retry) requires an Idempotency-Key header (1–128 characters). We recommend deriving it from the Focus RT invoice's primary key, e.g. focus-rt::<company_id>::<voucher_id>. Re-sending the same key + body returns the cached response — a Focus RT retry cannot create a duplicate FTA submission.
Focus RT → PINT-AE Field Mapping
The connector translates Focus RT columns into TrustBill's InvoiceCreateInput shape, which is then rendered into PINT-AE XML by TrustBill.
Header-level mapping
| Focus RT field | TrustBill field | Notes |
|---|---|---|
VoucherNo / InvoiceNo | number | 1–64 chars, unique per tenant + mode |
VoucherDate | issueDate | Converted to ISO YYYY-MM-DD |
DueDate | dueDate | Optional, ISO YYYY-MM-DD |
Currency | currency | Must be AED; multi-currency Focus RT invoices are converted at the Focus RT posting rate |
VoucherType | invoiceType | Sales Invoice → sale, Purchase Invoice → purchase, Credit Note → credit_note, Debit Note → debit_note |
CompanyMaster.TRN | seller.trn | 15-digit UAE TRN |
CustomerMaster.TRN | buyer.trn | 15-digit UAE TRN; leave empty for B2C invoices |
CustomerMaster.Country | buyer.country | ISO 3166-1 alpha-2 (Focus RT stores the country name; the connector normalises) |
CustomerMaster.Address1..3 | buyer.address.{line1,line2,city} | Line 1 required; city usually held in Address3 in Focus RT |
RefVoucherNo | referencedInvoiceNumber | Required for credit / debit notes — original invoice ID |
Remarks / Narration | notes | Preserved verbatim; visible in FTA-facing XML |
Line-level mapping
| Focus RT column | TrustBill field | Notes |
|---|---|---|
ItemMaster.Description | lines[].description | Non-empty; supports Arabic characters |
Qty | lines[].quantity | Must be > 0; negative Qty in Focus RT signals a credit note |
Rate | lines[].unitPrice | VAT-exclusive; the connector removes VAT if Focus RT is configured as VAT-inclusive |
TaxCode / VATCode | lines[].vatRate + lines[].taxCategory | vatRate is a decimal fraction (0.05 for 5%); see mapping below |
DiscountAmt | lines[].discountAmount | Absolute discount per line — applied before VAT |
ItemMaster.ItemCode | lines[].sellerItemId | Preserved for traceability |
ItemMaster.UOM | lines[].unit | Focus RT UOM code is mapped to UN/ECE Rec 20 (e.g. NOS → C62, KGS → KGM) |
Totals are computed server-side
Do not send subtotal, vat_amount or total. TrustBill re-computes totals from lines[] and returns them in the response so Focus RT can reconcile against them. If Focus RT's total does not match ±0.01 AED, the connector logs a variance and blocks submission until you correct the Focus RT posting.
Create Invoice (draft)
Endpoint: POST /v1/invoices
Below is a real Focus RT sales invoice mapped into the TrustBill payload. The Focus RT invoice is SI/2026/1042 — Sale of two laptops to a Dubai reseller at 5% VAT.
Request body
{
"number": "SI/2026/1042",
"issueDate": "2026-09-07",
"dueDate": "2026-10-07",
"currency": "AED",
"invoiceType": "sale",
"buyer": {
"name": "Al Reef Reseller LLC",
"trn": "100234567800003",
"country": "AE",
"email": "ap@alreef.example",
"address": {
"line1": "Warehouse 7, Al Quoz Industrial 3",
"city": "Dubai",
"country": "AE"
}
},
"seller": {
"name": "Focus RT Trading LLC",
"trn": "100100100100003",
"country": "AE"
},
"lines": [
{
"description": "ThinkPad X1 Carbon Gen 12",
"sellerItemId": "LP-X1C-G12",
"quantity": 2,
"unit": "C62",
"unitPrice": 5500.00,
"vatRate": 0.05,
"taxCategory": "standard_5"
}
],
"sellerInvoiceReference": "Focus RT voucher #F-88421",
"notes": "Payment: 30 days net"
}Response (201 Created) — abbreviated:
{
"id": "b1a2c3d4-....-uuid",
"number": "SI/2026/1042",
"status": "draft",
"invoiceType": "sale",
"totals": { "subtotal": 11000, "tax": 550, "total": 11550, "currency": "AED" },
"pipeline": [],
"errors": [],
"submissionMode": "sandbox",
"source": "focus-rt-connector"
}Credit & Debit Notes
Focus RT posts credit notes (sales return) and debit notes (purchase return / additional charge) as separate voucher types. The connector maps them accordingly.
| Focus RT voucher | invoiceType | Required extra fields |
|---|---|---|
| Sales Return / Credit Note | credit_note | referencedInvoiceNumber (original SI number), reasonCode (e.g. ReturnOfGoods) |
| Purchase Return / Debit Note | debit_note | referencedInvoiceNumber (original PI number), reasonCode |
Sign convention: send positive quantities and positive unit prices on credit / debit notes. The invoiceType tells TrustBill and the FTA that the document reverses the reference invoice; PINT-AE handles the sign in the XML.
Submit Invoice(s) for Delivery
Creating a draft does not deliver the invoice to the FTA. Submission is an explicit second call so you can review or auto-approve before sending.
Endpoint: POST /v1/invoices/submit
{ "ids": ["b1a2c3d4-....-uuid"] }Accepts 1–200 invoice UUIDs per call. Non-draft invoices in the list are silently skipped, so retry is safe.
Response (200):
{ "submitted": 1, "ids": ["b1a2c3d4-....-uuid"] }Focus RT tip: most Focus RT users configure the connector to auto-submit any draft older than N minutes (default: 10). This gives users a window to void an invoice from Focus RT before it reaches the FTA.
Status Tracking
Statuses are forward-only. A retry starts a new pipeline run.
| Status | Meaning | Terminal? |
|---|---|---|
| draft | Created in TrustBill, not submitted | No |
| queued | Submitted, waiting for pipeline worker | No |
| transformed | PINT-AE XML generated | No |
| validated | Passed schema + Schematron | No |
| blocked_no_credit | Insufficient TrustBill credit — top up to release | Yes |
| delivered | Sent to FTA via ASP; waiting for ack | Yes (pending ack) |
| acknowledged | FTA confirmed receipt / validity — safe to mark as filed in Focus RT | Yes |
| rejected | FTA or ASP rejected the invoice | Yes — retry after fix |
Polling recommendation: the Focus RT connector polls GET /v1/invoices/{id} every 2 minutes for non-terminal invoices, then stops once a terminal status is reached. A batch endpoint (GET /v1/invoices?status=queued&status=delivered) is available for consultancies that manage many tenants.
Bulk Migration from Focus RT
Historical Focus RT invoices (up to 12 months back) can be imported into TrustBill as either "archive only" or "submit to FTA" depending on your compliance requirement.
Endpoint: POST /v1/invoices/bulk — multipart/form-data, one CSV part, max 5 MB, Idempotency-Key header required.
CSV column headers (in order)
number,issueDate,dueDate,invoiceType,currency,sellerTrn,sellerName,buyerTrn,buyerName,buyerCountry,buyerAddressLine1,buyerCity,lineDescription,lineQty,lineUnit,lineUnitPrice,lineVatRate,lineTaxCategory,referencedInvoiceNumber,notes| Limit | Value |
|---|---|
| Max rows per file | 1,000 invoices |
| Multiple lines per invoice | Repeat the number column — the importer groups lines automatically |
| Partial success | Yes — bad rows are reported without rolling back the batch |
| Duplicate invoice number | Draft rows are upserted; already-submitted rows are rejected |
Recommended workflow: export Focus RT invoices to CSV via Report Writer → run the TrustBill "focus-rt-csv-normalizer" script to remap headers to the schema above → upload in test mode → review the summary → repeat in sandbox, then live.
Test / Sandbox / Live Modes
Every TrustBill tenant has one active submission mode. Invoices are hard-partitioned per mode — a live invoice cannot be viewed from sandbox, and vice-versa.
| Mode | Purpose | Reaches FTA? |
|---|---|---|
test | Local integration testing — no ASP call | No |
sandbox | End-to-end dry run against the ASP sandbox | FTA sandbox only |
live | Real, legally binding e-invoicing | Yes — the FTA production network |
Focus RT best practice: keep the Focus RT connector in sandbox mode for the full first invoicing week. Compare the FTA-acknowledged totals against Focus RT's VAT report before switching to live.
VAT & Tax Categories
Focus RT stores UAE VAT as a rate + code on the Item / Customer master. Map each Focus RT tax code to a TrustBill taxCategory once, at connector setup:
| Typical Focus RT code | vatRate | taxCategory | When to use |
|---|---|---|---|
VAT5 | 0.05 | standard_5 | Most B2B / B2C sales inside UAE mainland |
VAT0-EXP | 0 | zero_rated_export | Exports outside the GCC |
VAT0-HC | 0 | zero_rated_healthcare | Qualifying healthcare goods / services |
VAT0-EDU | 0 | zero_rated_education | Qualifying education goods / services |
EX-FIN | 0 | exempt_financial | Margin-based financial services |
EX-RES | 0 | exempt_residential_rent | Residential rent |
RC-DZ | 0 | reverse_charge_designated_zone | Sale to a UAE designated zone customer |
OOS | 0 | out_of_scope | Out-of-scope items (e.g. some inter-branch flows) |
UAE-Specific Scenarios
Free Zone / Designated Zone sellers
Set the Focus RT company profile flag DesignatedZone = Y. The connector propagates it as seller.designatedZone: true so PINT-AE emits the correct free-zone declaration.
Margin scheme (used cars, antiques, second-hand goods)
Focus RT items configured with the "profit margin" flag are mapped to lines[].marginScheme: true. The connector sends the margin, not the sale value, as the VAT base — matching FTA rules for second-hand-goods traders.
Reverse charge on imports
Purchase invoices from non-UAE suppliers with reverse-charge VAT are mapped to invoiceType: "purchase" + taxCategory: "reverse_charge_designated_zone". TrustBill emits the required ReverseCharge markers.
B2C invoices (no buyer TRN)
Leave buyer.trn empty. Focus RT retail POS invoices are simplified tax invoices under the FTA rules; TrustBill emits the correct PINT-AE profile automatically based on the missing TRN + total < 10,000 AED.
Error Handling
All TrustBill errors follow the shape { code, humanMessage, meta? }. The Focus RT connector logs the code against the source voucher and either retries (transient) or surfaces it in the Focus RT log window (permanent).
| HTTP | Typical code | Focus RT root cause | Action |
|---|---|---|---|
| 400 | invalid_body | Bad TRN, buyer=seller, missing VAT code on a line | Fix Focus RT master data and retry |
| 400 | totals_mismatch | Focus RT posted totals differ from line-based totals | Reconcile in Focus RT; connector will re-emit |
| 401 | missing_authorization_header | JWT expired between polls | Refresh token — automatic in the Windows connector |
| 403 | kyb_required | Tenant not yet approved by TrustBill compliance | Contact TrustBill support |
| 409 | invoice_mode_mismatch | Focus RT is posting live invoices but tenant is still in sandbox | Switch mode in TrustBill dashboard |
| 409 | invoice_number_duplicate | Same Focus RT voucher number posted twice | Delete the second Focus RT voucher or renumber it |
| 413 | bulk_payload_too_large | CSV export > 1,000 rows or 5 MB | Split by date range and re-upload |
| 422 | idempotency_required | Custom middleware missed the header | Always send a unique Idempotency-Key |
Setup Checklist
- Create your TrustBill SME account and complete KYB (upload trade licence + TRN certificate)
- Request a per-tenant API credential from TrustBill support
- Install the TrustBill Windows Connector on your Focus RT database server (or configure CSV drop / direct HTTP)
- Map Focus RT tax codes to TrustBill
taxCategoryvalues (one-time) - Enable
sandboxmode in the TrustBill dashboard - Post a test sales invoice in Focus RT — confirm it reaches
acknowledgedin TrustBill within 3 minutes - Reconcile Focus RT's VAT report against TrustBill's "Delivered invoices" report
- Switch to
livemode when the FTA registration is complete - Turn on the Focus RT write-back plug-in so acknowledged references appear next to invoices in Focus RT
Suggested test cases before go-live
- B2B sale, single line, 5% VAT — expect
acknowledged - B2C sale under 10,000 AED with no buyer TRN — expect PINT-AE "simplified" profile
- Sales return (credit note) referencing an earlier invoice — expect matching pair
- Export sale outside GCC, zero-rated — expect
taxCategory: zero_rated_export - Sale to a designated-zone customer — expect reverse-charge markers
- Duplicate voucher number — expect
invoice_number_duplicate - Bulk upload of 500 historical invoices — expect partial success reported per row
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Focus RT invoice never appears in TrustBill | Connector service stopped, or DB user has no read grant | Check Windows Services → restart TrustBillFocusRT; verify SQL login |
Invoice stuck in queued | Insufficient credit or KYB rejected | Check the TrustBill dashboard for a red banner; top up credit |
Invoice reaches rejected with "buyer_trn_invalid" | Focus RT customer TRN is 14 digits or has spaces | Correct the TRN in Focus RT Customer Master → connector will re-emit |
| Totals variance error | Focus RT posted VAT-inclusive but connector expected exclusive | Toggle pricesIncludeVat in connector.yaml |
Arabic descriptions appear as ??? in PINT-AE XML | Focus RT DB is not UTF-8 / connector is on ANSI code page | Set connectionString.CharSet = utf8 and restart connector |
| Duplicate FTA submissions after a network blip | Missing / non-unique Idempotency-Key | Confirm the key formula is focus-rt::<company_id>::<voucher_id> |
Support & Contact
Technical Support
- WhatsApp: +971 52 260 9313
- Email: info@trustbill.ae
- Documentation hub: trustbill.ae/en/documentation
- Focus integration overview: trustbill.ae/en/integrations/focus
- ERP Partner API guide: /documentation/erp-partner-api
Escalation
For go-live escalations, include your TrustBill tenant ID, the Focus RT voucher number and the timestamp of the failed pipeline run. TrustBill support responds to Focus RT-tagged tickets within one business hour during UAE working days.