REST API for developers

eFacture Connect

Bring Tunisian e-invoicing into your existing ERP. Send JSON, get back a signed XML (TEIF v1.8.9 + XAdES) and a PDF with a QR code.

Already have an API account?

Log in to the developer portal
Response in under 5 seconds
TEIF v1.8.9 compliant
10-year archiving
Service status
Sign an invoice
$ curl -X POST \
  https://efacturetn.com/api/v1/einvoices/process \
  -H "X-Api-Key: ck_test_xxx" \
  -H "Content-Type: application/json" \
  -d '{ "invoice_number": "F-001",
     "date": "2026-06-13",
     "seller": { "name":"...", "tax_id":"1234567RAM000", "address":"Avenue Habib Bourguiba", "city":"Tunis", "postal_code":"1000" },
     "buyer":  { "name":"...", "tax_id":"7654321CAM000" },
     "items":  [ { "description":"Service", "quantity":1,
                   "unit_price":500, "vat_rate":19 } ] }'

// Response (~5 seconds)
{
  "success": true,
  "data": {
    "status":        "signed",
    "ttn_reference": "TTN-TEST-XXXXX",
    "xml_base64":    "PD94bWwgdmVyc2lvbj0i...",
    "pdf_base64":    "JVBERi0xLjQKJaqr..."
  }
}

How it works

You send, we handle everything

1
You send
Your invoice data as JSON
2
We process
Compliant XML, signing, TTN submission
You receive
Signed XML + PDF with QR code

Everything included

One price per invoice, no hidden fees

Electronic signature

Compliant XAdES-BES with a Tunisian certificate. Entreprise ID (automatic seal), DigiGo (PIN + OTP), USB token or E-Houwiya (Mobile ID).

Automatic TTN submission

Direct submission with smart retry and a circuit breaker when TTN is unavailable.

PDF + QR Code

Professional PDF with an automatically generated verification QR code.

10-year archiving

Every invoice archived in accordance with Tunisian law.

Free validation

Check your invoices before signing with /einvoices/validate. No credits consumed.

Real-time dashboard

Success rate, credits, errors and p50/p95 latency in your admin console.

2 environments

Each client has its sandbox key (ck_test_), with no credits consumed, and its live key (ck_live_) when it is ready.

Four signing modes

Choose according to your use case. You can switch from one to another on each request.

RECOMMENDED

Entreprise ID

Electronic server seal (SEAL)

Synchronous, ~5 seconds, no user interaction. The signature is applied automatically by our server with the company's seal.

  • No signing page, 0 user clicks
  • Ideal for back-office ERP and high volumes
  • Signed XML + PDF returned in the direct response

DigiGo

Remote signing with PIN + OTP

Asynchronous. The signer signs on a secure page with their PIN and an OTP, from any device.

  • Signer's personal certificate
  • Retrieved with GET /einvoices/{id}
  • Ideal for personal signatures / low volumes

USB token

Physical token, local signing

Asynchronous. The invoice is signed on the signer's workstation with their USB certification token, and the API handles the TTN submission.

  • Certificate on a physical medium (USB token)
  • The token never leaves the signer's workstation
  • Ideal if you already hold your signing token

E-Houwiya

Mobile ID, mobile digital identity

Asynchronous. The signer approves the signature from their smartphone with their mobile digital identity (Mobile ID).

  • No dedicated hardware: the smartphone is enough
  • Certificate tied to the signer's mobile identity
  • Enabled on request: contact us
Start testing for free now

Free sign-up, test keys as soon as your email address is confirmed, no credits required for testing.

More details in the integration guide.

Enterprise-grade security

SHA256-hashed keys
API keys are never stored in plain text. Timing-safe comparison (hash_equals) prevents timing attacks.
On-demand rotation
Revoke and regenerate your live key in 1 click from the back office. The old key becomes invalid immediately.
TLS 1.2+ required
All communications are encrypted over HTTPS. No HTTP call is accepted.
Atomic rate limiting
Sliding window via Symfony RateLimiter. 60 req/min by default, configurable per client.
Traceable logs
Every request logged (endpoint, status, latency, IP) with 90-day retention.
Required headers
// Incoming request (your ERP → our API)
X-Api-Key: ck_live_xxxxx...
Content-Type: application/json

Try it now

Sign up, verify your email, create your first client and use its sandbox key ck_test_xxx to start integrating. No credits consumed in test mode.

Terminal
$ curl https://efacturetn.com/api/v1/status

{
  "success": true,
  "data": {
    "status": "operational",
    "version": "1.0.0"
  }
}

Need help with the integration?

Our team handles the integration into your existing system, whatever the technology (SAP, Odoo, Sage, in-house software). Quote on request.

Request a quote

Frequently asked questions

What is eFacture Connect?
eFacture Connect is a REST API that lets you integrate Tunisian e-invoicing (TEIF v1.8.9 format + XAdES signature) into any existing ERP or software. You send your invoice data as JSON, and we return the signed XML and the PDF with a QR code, ready to be submitted to TunisieTradeNet.
Do I need to change software to use the API?
No. eFacture Connect plugs into your existing system. You keep your ERP, your CRM or your invoicing software. The API is added as an extra building block, in synchronous mode (Entreprise ID) or asynchronous mode (DigiGo, USB token).
Which signing modes are available?
Four modes. Entreprise ID (SEAL): electronic server seal, 100% automatic signing, synchronous (~5 seconds), ideal for high volumes. DigiGo: the signer approves with their PIN + OTP on a secure page, recommended for personal signatures. USB token: the invoice is signed locally on the signer's workstation with their physical token, then the API handles the TTN submission. E-Houwiya (Mobile ID): the signer approves from their smartphone with their mobile digital identity, enabled on request. You choose the mode on each request with the method field.
Are invoices archived?
Yes. Every signed invoice is archived automatically for 10 years, in accordance with Tunisian law. You can download your files at any time through the GET /einvoices/{id} endpoint.
How can I test the API before committing?
Sign up on the developer portal and verify your email, then create a client: it receives its sandbox key in the ck_test_xxx format. The test environment is free and consumes no credits, but signing and submission really run on the TEST environments (no simulation): the sandbox signing account must be configured. A client moves to live mode simply by replacing its key with its ck_live_xxx key.
What is the response time?
On average under 5 seconds to sign an invoice in SEAL mode and receive the XML + PDF. The rate limiter accepts 60 requests per minute by default (configurable). p50/p95 latencies are visible in your admin console.

Request a quote

Custom pricing based on your volume. Reply within 24h.

8 - 6 = ?
Discuter sur WhatsApp