Invora REST LogoInvora v1.4

INVORA REST V1.4 · DEVELOPER DOCUMENTATION

Quickstart & API Reference

Base URL: https://api.invora.dev · openapi.yaml · llms-full.txt

1. Authentication & Idempotency

Every authenticated endpoint requires your API key in the Authorization header:

Authorization: Bearer tb_live_...

Mutating endpoints (POST /v1/einvoice/issue, POST /v1/onboard/zatca-csid, POST /v1/onboard/zatca-pcsid) require a unique Idempotency-Key header (e.g. your internal invoice ID). Retrying with the same key replays the cached response with header x-idempotency-replayed: true so retries never double-issue or corrupt ZATCA PIH chains.

Free zero-login validation: POST /v1/einvoice/preflight requires no API key.

2. Germany EN 16931 (XRechnung 3.0 & ZUGFeRD 2.2)

Supported formats: DE_XRECHNUNG_UBL, DE_XRECHNUNG_CII, and DE_ZUGFERD (pass existingPdfBase64 to embed Factur-X XML into your existing branded PDF as PDF/A-3b). Every issued German invoice is validated live against KoSIT 1.6.3 / XRechnung 3.0.2.

Request — POST /v1/einvoice/issue (XRechnung 3.0 UBL)
curl -sS -X POST https://api.invora.dev/v1/einvoice/issue \
  -H "Authorization: Bearer tb_live_YOUR_API_KEY" \
  -H "Idempotency-Key: inv-de-2027-001" \
  -H "Content-Type: application/json" \
  -d '{
    "format": "DE_XRECHNUNG_UBL",
    "invoiceNumber": "INV-2027-001",
    "issueDate": "2027-01-15",
    "currencyCode": "EUR",
    "buyerReference": "991-12345-67",
    "seller": {
      "name": "Acme Cloud GmbH",
      "vatId": "DE123456789",
      "email": "billing@acme.de",
      "contactName": "Finance Desk",
      "phone": "+49 30 5550199",
      "address": { "street": "Friedrichstr 1", "city": "Berlin", "postalCode": "10117", "countryCode": "DE" }
    },
    "buyer": {
      "name": "Stadt Berlin",
      "address": { "street": "Rathausstr 1", "city": "Berlin", "postalCode": "10178", "countryCode": "DE" }
    },
    "paymentMeans": { "code": "58", "iban": "DE89370400440532013000" },
    "lines": [
      { "id": "1", "description": "Pro Plan", "quantity": 1, "unitPrice": "199.00", "taxCategoryCode": "S", "taxRatePercent": 19 }
    ]
  }'
Response — 201 Created (XRechnung 3.0 UBL)
// HTTP 201 Created
{
  "status": "ISSUED",
  "jurisdiction": "DE",
  "format": "DE_XRECHNUNG_UBL",
  "xmlBase64": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPEludm9pY2U...",
  "xmlSha256": "8f4e2a91c0b74d56e12a34f9c8d01b23456789abcdef0123456789abcdef0123",
  "kosit": {
    "executed": true,
    "valid": true,
    "engine": "KoSIT 1.6.3 / XRechnung 3.0.2",
    "errors": [],
    "warnings": []
  },
  "totals": {
    "currencyCode": "EUR",
    "netTotal": "199.00",
    "vatTotal": "37.81",
    "grossTotal": "236.81"
  }
}
Request — POST /v1/einvoice/issue (Stripe Invoice -> ZUGFeRD 2.2 BYOP)
curl -sS -X POST https://api.invora.dev/v1/einvoice/issue \
  -H "Authorization: Bearer tb_live_YOUR_API_KEY" \
  -H "Idempotency-Key: stripe-in_1Q9x2027" \
  -H "Content-Type: application/json" \
  -d '{
    "sourceFormat": "stripe_invoice",
    "format": "DE_ZUGFERD",
    "buyerReference": "991-12345-67",
    "existingPdfBase64": "<OPTIONAL_BASE64_PDF_FOR_BYOP>",
    "seller": {
      "name": "Acme Cloud GmbH",
      "vatId": "DE123456789",
      "email": "billing@acme.de",
      "contactName": "Finance Desk",
      "phone": "+49 30 5550199",
      "address": { "street": "Friedrichstr 1", "city": "Berlin", "postalCode": "10117", "countryCode": "DE" }
    },
    "stripeInvoice": {
      "id": "in_1Q9x2027",
      "number": "INV-2027-042",
      "currency": "eur",
      "created": 1799971200,
      "customer_name": "Kunde GmbH",
      "customer_address": { "line1": "Hauptstr 10", "city": "Munich", "postal_code": "80331", "country": "DE" },
      "lines": {
        "data": [
          { "id": "il_1", "description": "Growth Subscription", "quantity": 1, "amount": 15000, "tax_rates": [{ "percentage": 19 }] }
        ]
      }
    }
  }'
Response — 201 Created (ZUGFeRD 2.2 PDF/A-3b)
// HTTP 201 Created
{
  "status": "ISSUED",
  "jurisdiction": "DE",
  "format": "DE_ZUGFERD",
  "xmlBase64": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHJzbTpDcm9zc0luZHVzdHJ5SW52b2ljZQ...",
  "xmlSha256": "4b9c12e0d45a78f90123456789abcdef0123456789abcdef0123456789abcdef",
  "pdfBase64": "JVBERi0xLjcKJeLjz9MKMSAwIG9iago8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFI...",
  "pdfSha256": "9a1f87d2e3c4b5a60123456789abcdef0123456789abcdef0123456789abcdef",
  "usedExistingPdf": true,
  "kosit": {
    "executed": true,
    "valid": true,
    "engine": "KoSIT 1.6.3 / XRechnung 3.0.2",
    "errors": [],
    "warnings": []
  },
  "totals": {
    "currencyCode": "EUR",
    "netTotal": "150.00",
    "vatTotal": "28.50",
    "grossTotal": "178.50"
  }
}

Decode files in Node.js with Buffer.from(res.xmlBase64, 'base64') or Buffer.from(res.pdfBase64, 'base64').

3. Saudi ZATCA Phase 2 (3-Step Flow)

Choose the right ZATCA environment per CSID:

  • "environment": "sandbox" — ZATCA Developer Sandbox (no portal login needed; use test VAT 399999999900003 & OTP 123345).
  • "environment": "simulation" — Fatoora Simulation Portal (use your Saudi VAT & 6-digit Simulation OTP).
  • "environment": "production" — Live ZATCA Core (use your Saudi VAT & Production Fatoora OTP for legally binding invoices).

Use zatcaInvoiceSubtype: "0100000" for B2B real-time clearance, or "0200000" for <100ms B2C local signing + async 24h reporting queue. Pass egsSerialNumber from Step 1 to target a specific branch/POS terminal.

Step 1 Request — POST /v1/onboard/zatca-csid
curl -sS -X POST https://api.invora.dev/v1/onboard/zatca-csid \
  -H "Authorization: Bearer tb_live_YOUR_API_KEY" \
  -H "Idempotency-Key: zatca-onboard-001" \
  -H "Content-Type: application/json" \
  -d '{
    "environment": "sandbox",
    "commonName": "TST-886431145-399999999900003",
    "organizationUnit": "Riyadh Branch",
    "organizationName": "Your Company LLC",
    "vatNumber": "399999999900003",
    "invoiceType": "1100",
    "registeredAddress": "RRRD2929",
    "businessCategory": "Supply activities",
    "otp": "123345"
  }'
Step 1 Response — 201 Created
// HTTP 201 Created (save csidId for Step 2 and egsSerialNumber for Step 3)
{
  "status": "ONBOARDED",
  "csidId": "d026ca9e-ee2b-42a0-8233-f25fef508e8f",
  "csidStage": "compliance",
  "environment": "sandbox",
  "egsSerialNumber": "1-Invora|2-V1|3-61af077a-f56c-4fc6-956b-d624d180b0f1",
  "vatNumber": "399999999900003",
  "zatcaRequestId": "1234567890123",
  "dispositionMessage": "ISSUED",
  "keyFingerprintSha256": "77246bbda5d6cde8ad9ea3c4c4f049ca87969131a235497b1620868c58de2dad",
  "genesisPih": "NWZlY2ViNjZmZmM4NmYzOGQ5NTI3ODZjNmQ2OTZjNzljMmRiYzIzOWRkNGU5MWI0NjcyOWQ3M2EyN2ZiNTdlOQ==",
  "lastIcv": 0,
  "csrPem": "-----BEGIN CERTIFICATE REQUEST-----\n...\n-----END CERTIFICATE REQUEST-----\n",
  "createdAt": "2026-11-21T22:17:06.763Z"
}
Step 2 Request — POST /v1/onboard/zatca-pcsid
curl -sS -X POST https://api.invora.dev/v1/onboard/zatca-pcsid \
  -H "Authorization: Bearer tb_live_YOUR_API_KEY" \
  -H "Idempotency-Key: zatca-pcsid-001" \
  -H "Content-Type: application/json" \
  -d '{"csidId": "<CSID_ID_FROM_STEP_1>"}'
Step 2 Response — 200 OK
// HTTP 200 OK
{
  "status": "PROMOTED_TO_PRODUCTION",
  "csidId": "d026ca9e-ee2b-42a0-8233-f25fef508e8f",
  "csidStage": "production",
  "egsSerialNumber": "1-Invora|2-V1|3-61af077a-f56c-4fc6-956b-d624d180b0f1",
  "vatNumber": "399999999900003",
  "zatcaProductionRequestId": "30368",
  "dispositionMessage": "ISSUED",
  "lastIcv": 0,
  "lastPih": "NWZlY2ViNjZmZmM4NmYzOGQ5NTI3ODZjNmQ2OTZjNzljMmRiYzIzOWRkNGU5MWI0NjcyOWQ3M2EyN2ZiNTdlOQ==",
  "updatedAt": "2026-11-21T22:17:07.377Z"
}
Step 3 Request — POST /v1/einvoice/issue (SA_ZATCA B2B 0100000)
curl -sS -X POST https://api.invora.dev/v1/einvoice/issue \
  -H "Authorization: Bearer tb_live_YOUR_API_KEY" \
  -H "Idempotency-Key: inv-sa-001" \
  -H "Content-Type: application/json" \
  -d '{
    "format": "SA_ZATCA",
    "invoiceNumber": "INV-SA-001",
    "issueDate": "2026-11-22",
    "issueTime": "10:30:00Z",
    "deliveryDate": "2026-11-22",
    "currencyCode": "SAR",
    "invoiceTypeCode": "380",
    "zatcaInvoiceSubtype": "0100000",
    "egsSerialNumber": "<EGS_SERIAL_NUMBER_FROM_STEP_1>",
    "seller": {
      "name": "Your Company LLC",
      "vatId": "399999999900003",
      "crn": "1010012345",
      "address": {
        "street": "Prince Sultan Road",
        "buildingNumber": "2322",
        "district": "Al Murabba",
        "city": "Riyadh",
        "postalCode": "12643",
        "countryCode": "SA"
      }
    },
    "buyer": {
      "name": "Saudi Buyer Co",
      "vatId": "300000000000003",
      "address": {
        "street": "King Fahd Road",
        "buildingNumber": "1111",
        "district": "Olaya",
        "city": "Riyadh",
        "postalCode": "12211",
        "countryCode": "SA"
      }
    },
    "lines": [
      { "id": "1", "description": "Annual SaaS Plan", "quantity": 1, "unitCode": "PCE", "unitPrice": "100.00", "taxCategoryCode": "S", "taxRatePercent": 15 }
    ]
  }'
Step 3 Response — 201 Created (Cleared by ZATCA)
// HTTP 201 Created — Standard B2B (0100000) returns "CLEARED" with ZATCA's stamped XML.
// Simplified B2C (0200000) returns "QUEUED_FOR_REPORTING" + "reportingQueueId" in <100ms.
{
  "status": "ISSUED",
  "jurisdiction": "SA",
  "format": "SA_ZATCA",
  "csidId": "d026ca9e-ee2b-42a0-8233-f25fef508e8f",
  "egsSerialNumber": "1-Invora|2-V1|3-61af077a-f56c-4fc6-956b-d624d180b0f1",
  "uuid": "1815f331-96ae-49f2-b847-cb055cd44f88",
  "icv": 1,
  "previousInvoiceHash": "NWZlY2ViNjZmZmM4NmYzOGQ5NTI3ODZjNmQ2OTZjNzljMmRiYzIzOWRkNGU5MWI0NjcyOWQ3M2EyN2ZiNTdlOQ==",
  "invoiceHash": "lUmW0a+sFHzYKnDUqOOTBTIk2mtnj4rLFZ2cq6q+bWQ=",
  "clearanceStatus": "CLEARED",
  "zatcaRequestId": "c27a7683-961c-436f-8f2c-d1938cace555",
  "qrBase64": "ARdJbnZvcmEgVGVzdCBUcmFkaW5nIExMQwIPMzk5OTk5OTk5OTAwMDAz...",
  "xmlBase64": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPEludm9pY2U...",
  "xmlSha256": "5aaf47827bff67b94ee264c50fa08a63cbaac835afb0f7ef94eb99e1becffc67",
  "totals": {
    "currencyCode": "SAR",
    "netTotal": "100.00",
    "vatTotal": "15.00",
    "grossTotal": "115.00"
  }
}

4. HTTP Status Codes & Error Format

StatusCodeMeaning
200 / 201OK / ISSUEDRequest succeeded (check x-idempotency-replayed on retries).
400VALIDATION_ERRORMissing or invalid JSON field (see issues[]).
401UNAUTHORIZEDMissing, invalid, or revoked Bearer API key.
402SUBSCRIPTION_INACTIVE / QUOTA_EXCEEDEDPlan inactive or monthly invoice limit reached.
422COMPLIANCE_VALIDATION_FAILEDInvoice failed EN 16931 / KoSIT or ZATCA business rules.
502ZATCA_*_FAILEDUpstream ZATCA Fatoora gateway rejected the request or timed out.
Error Response Format
// Example: HTTP 400 VALIDATION_ERROR or HTTP 422 COMPLIANCE_VALIDATION_FAILED
{
  "error": "VALIDATION_ERROR",
  "issues": [
    {
      "field": "seller.vatId",
      "message": "Required for Germany EN 16931 / XRechnung 3.0 (BR-CO-9)"
    }
  ]
}

5. Peppol BIS 3.0, Usage & Key Rotation

Peppol BIS 3.0: Generates compliant UBL 2.1 XML wrapped in an SBDH envelope (format: "PEPPOL_BIS3", returns xmlBase64 + sbdhBase64). Managed AS4 Access Point network delivery is available on request—contact help@invora.dev.

Management Endpoints: GET /v1/usage (monthly quota), GET /v1/audit-ledger (Zero-PII SHA-256 proofs), GET/POST/DELETE /v1/api-keys (key rotation), GET /v1/export (portability), and GET /v1/zatca/reporting-queue.

Ready to get your instant API key or test payloads without signing up?