Platform Agréée Integration
Platform Agréée Integration
NomaUBL submits UBL 2.1 invoices to a Platform Agréée (PA) — a French certified e-invoicing platform — via a REST API using Java 11's built-in HttpClient.
Authentication
NomaUBL uses JWT bearer token authentication managed by TokenManager:
- On first API call,
TokenManagerposts credentials topaApiLoginEndpoint - The token is cached for 55 minutes
- All subsequent calls include
Authorization: Bearer <token> - On HTTP 401, the token is refreshed once automatically
The token is stored in memory only. There is no persistent token storage.
Submitting an invoice
After successful validation, NomaUBL posts the UBL XML to the PA:
Success response:
The uuid is the PA transaction identifier and is stored in F564230.FEUKIDSZ. It is used in all subsequent status polls.
Error response: any non-2xx HTTP status code triggers status 9904 (Error Sent). The HTTP status code and response body are stored in F564235.
Polling import status
After submission, the invoice is in status 9906 (Pending). The -import command polls the PA for the final import result:
Possible responses:
| PA status | NomaUBL action |
|---|---|
success |
Update FEUKIDSZ with invoiceUuid, set status 10 (Deposited) |
pending |
No change, re-check on next -import run |
failed |
Set status 9907, store errors in F564235 |
| other | Set status 9904, log in F564235 |
HTTP 401 retry pattern
All API clients follow the same retry pattern:
JSON parsing
NomaUBL does not use an external JSON library. All JSON parsing uses simple string search via parseJsonString():
Controlling PA submission
PA submission can be disabled at several levels:
| Level | How to disable |
|---|---|
Global (e-invoicing) |
Set paMode to anything other than API |
| Per template | Set sendToPA=N in the document template |
| Processing type | Use UBL_VALIDATE instead of UBL or BOTH |
| Database writes | Set updateDB=N in global to skip all DB writes too |
Mock mode
For testing without a real PA, enable the built-in mock:
MockPlatformApiClient intercepts all API calls and returns configurable responses:
paMockBehavior |
POST response | GET poll response |
|---|---|---|
SUCCESS |
{"uuid": "mock-uuid", "status": "pending"} |
{"status": "success", "invoiceUuid": "mock-inv-uuid"} |
PENDING |
{"uuid": "mock-uuid", "status": "pending"} |
Always {"status": "pending"} |
FAILED |
{"uuid": "mock-uuid", "status": "pending"} |
{"status": "failed", "errors": ["Mock failure"]} |
ERROR |
Throws IOException (simulates network error) |
— |
Mock mode also uses MockTokenManager which returns a fixed fake token without making any HTTP calls.
Attachment support
If the document template defines an attachment property, a PDF is attached to the UBL submission. The PDF is generated first (via Oracle XDO), then sent as a multipart request to the PA.
PPF directory pre-check
Before submitting, NomaUBL optionally checks the PPF directory to verify the recipient is reachable. This check is non-blocking: if it fails for any reason, submission proceeds regardless. See E-Directory Template for configuration details.