AGT Mock API — Endpoint Documentation
Professional reference for AGT integration endpoints, authentication model, payload structure, expected responses, and implementation notes.
1. Overview
This API simulates AGT electronic invoicing workflows. It supports invoice submission, submission status lookup, series requests, series listing, and callback testing.
The API is divided into two main groups:
- Admin API — used by the administration console with JWT authentication.
- AGT API — used by POS/invoicing integrations with Basic Authentication per company credential.
2. Base URL
3. Authentication
3.1 Admin endpoints
All /api/admin/* routes require JWT Bearer
authentication.
3.2 AGT endpoints
All /sigt/fe/v1/* routes require company Basic
Authentication, except where your backend explicitly allows
otherwise.
The frontend generates these credentials in the Credentials section and stores them by company.
4. Common AGT Request Envelope
Most AGT requests in this project use a shared top-level
structure. Even endpoints like
obterEstado and solicitarSerie may
require this envelope depending on backend validation.
| Field | Type | Description |
|---|---|---|
| schemaVersion | string |
Version of the AGT request schema. Example:
1.2.
|
| submissionUUID | string (UUID) | Unique request identifier generated client-side for traceability. |
| taxRegistrationNumber | string | Company NIF associated with the authenticated credential. |
| submissionTimeStamp | ISO datetime | Timestamp of request creation. |
| softwareInfo | object | Software identification and JWS signature metadata. |
| softwareInfoDetail.productId | string | Software product identifier. |
| softwareInfoDetail.productVersion | string | Software version used to generate the request. |
| softwareInfoDetail.softwareValidationNumber | string | Validation number assigned to the invoicing software. |
| softwareInfoDetail.signatureVersion | integer | Signature format version. |
| jwsSoftwareSignature | string |
JWS string in
header.payload.signature format.
|
5. Endpoint: registarFactura
/sigt/fe/v1/registarFactura
Submits one or more fiscal documents for processing and validation.
Request payload
Success response example
Validation error example
Notes
-
numberOfEntriesshould match the number of documents sent. - The NIF in the payload should match the company credential used in Basic Auth.
-
jwsSoftwareSignatureandjwsDocumentSignaturemust have valid JWS structure. - Totals should be coherent with lines and tax values.
6. Endpoint: obterEstado
/sigt/fe/v1/obterEstado
Retrieves the processing status of a previously submitted request.
Request payload
Success response example
Error example
Notes
-
Do not send only
requestIDif your backend validates the full AGT envelope. -
Use the returned
requestIDfromregistarFactura.
7. Endpoint: solicitarSerie
/sigt/fe/v1/solicitarSerie
Requests a document series for a given document type and fiscal year.
Request payload
Success response example
Error example
8. Endpoint: listarSeries
/sigt/fe/v1/listarSeries
Returns available document series for the authenticated company.
Request
This endpoint is defined as GET in your backend route list and usually relies on authentication context.
Success response example
Notes
- Because this is a GET route, avoid relying on JSON body payloads.
- If the backend later requires a body here, the route design should be reconsidered.
9. Endpoint: callback
/sigt/fe/v1/callback
Simulates callback delivery so the client system can test status updates.
Request payload
Success response example
Important note
If the frontend is opened from a different origin, this endpoint
may fail due to CORS until the backend allows that origin in
config/cors.php.
10. Recommended Integration Flow
- Authenticate admin in the frontend.
- Create or load a company.
- Generate company Basic Auth credentials.
- Submit an invoice using
registarFactura. - Read the returned
requestID. - Check status with
obterEstado. - Request or list series when needed.
- Test callback delivery separately.
11. Common Problems
- Missing credential — no saved Basic Auth for the selected company.
- Token not provided — JWT missing on admin routes.
- E08 invalid JWS — JWS fields are not in valid three-part structure.
- E96 malformed request — backend expects the common AGT envelope.
- CORS blocked — callback origin not allowed by backend CORS config.