Electronic Invoicing API

Fact Flexi Connect is an HTTP service that allows third-party systems, ERPs, billing software, SaaS platforms, to communicate with the AGT Angola Electronic Invoicing API (SIFP).

Why use Connect?

Integrating directly with the AGT API is complex. It requires:

  • Implementing JWS RS256 digital signature with certificates
  • Managing multiple environments (sandbox and production)
  • Maintaining TLS 1.2 connections with keep-alive
  • Handling AGT-specific errors and validations

Connect abstracts all this complexity. Your system sends a simple JSON and receives the AGT response.

What Connect does not do

Fact Flexi Connect is a bridge, not a database. The service:

  • Does not store products, customers, stock or any business information from your system
  • Does not keep issued documents, only records usage metadata for billing and logs
  • Does not retain data after communication with AGT is complete

Your data stays in your system. Connect only authenticates, signs and forwards documents to AGT, ensuring they are registered in the official Electronic Invoicing database. The private key you send in each request is never stored, it is used exclusively for that request’s JWS signing and then discarded.

How it works

A renderizar...

Features

FeatureDescription
AuthenticationAPI Key via x-api-key header or Authorization: Bearer
v2 modelCompany data sent in each request (NIF + private key)
Digital signatureAutomatic JWS RS256
EnvironmentsSandbox (HML) and Production (PROD)
Rate limiting60 req/min per API Key
LogsComplete record of all calls
ValidationZod, input errors caught before reaching AGT
Normalized responsesConnect translates AGT responses into a consistent format

Environments (Sandbox HML / Production PROD)

The gateway communicates with AGT in two environments: sandbox/homologation (HML) and production (PROD). There is no separate URL for each environment: the API URL is always https://connect.factflexi.com.

The environment used for each request is determined automatically based on the type of your API Key:

  • If your key was created in sandbox/homologation mode, the request is forwarded to AGT in the HML environment.
  • If your key was created in production mode, the request is forwarded to AGT in the PROD environment.

You do not need to select the environment manually or change the endpoint. Just use the API Key corresponding to the environment where you want to operate.

Important: Do not mix keys from different environments in the same integration flow. Test first with a sandbox key, and only after validation switch to a production key.


Available Endpoints

Series

MethodRouteDescriptionScope
POST/v2/seriesList numbering seriesseries:listar
POST/v2/series/solicitarRequest series creationfacturas:emitir

Documents

MethodRouteDescriptionScope
POST/v2/documentos/emitirIssue fiscal documentsfacturas:emitir
POST/v2/documentos/statusCheck validation statusfacturas:consultar

System

MethodRouteDescription
GET/healthCheck service status

Response Model

All responses follow the same format:

{
  "success": true,
  // ... endpoint-specific data
}

On error:

{
  "success": false,
  "error": "Error description",
  "code": "ERROR_CODE",
  "details": {}  // optional, validation details
}

Common Error Codes

HTTPcodeMeaning
401UNAUTHORIZEDAPI Key missing, invalid or revoked
402LICENSE_EXPIREDLicense expired or missing (unlimited model)
402NIF_REQUIREDnif field required (per-NIF model)
402NIF_NOT_LICENSEDNIF not authorized or license expired (per-NIF model)
403FORBIDDENInsufficient scope for this endpoint
400INVALID_JSONRequest body is not valid JSON
400VALIDATION_ERRORRequired fields missing or invalid
502AGT_ERRORCommunication error with AGT

Quick Start Guide

  1. Authentication, Get your API Key
  2. List Series, See available series
  3. Request Series, Create new series if needed
  4. Issue Document, Submit documents to AGT
  5. Check Status, Verify they were validated

Help and Contacts

If you need assistance during integration or have commercial questions: