Documentation
Guides, API reference and events for e‑Factura Gateway.
On this page
Rules shared by every R&D Copilot API are in the Developer guide.
Get started
- Overview: What the e‑Factura Gateway API does, how a call is built and where to go next.
- Quickstart: Send your first invoice from the test company: find the company, create the invoice, read its checks, send it and follow it.
- Authentication: Get client credentials, request a token and call the e‑Factura Gateway API with it.
- Sandbox and live: Build and test against a test company, then move the same calls to your live company.
- Go-live checklist: What to have in place before your software sends invoices for a live company.
Companies and authorisation
- Add a company: Add a company to your account by its CIF, read it, and see what it needs before it can send or receive.
- Authorise access at the authority: The step that gives the gateway the right to act for a company: what the representative does and what you see in the API.
- Expiry and renewal: An authorisation has an end date. See the three states it can be in and how to renew it before it ends.
- Accounting-firm access: One account for many companies: how a firm that sends for its clients holds, selects and separates them.
Send
- The invoice object: The fields of an invoice, how its amounts add up and which of them you send and which the gateway fills.
- Invoices and credit notes: Create an invoice or a credit note as a draft, list them, and create a credit note from an accepted invoice.
- Validate before sending: Read the checks the gateway runs on a draft, fix what blocks it and send only when nothing blocks.
- Send and follow: Send a draft to the authority, then follow it from the upload index to ok or nok by polling, by events or by its history.
- Corrections: A rejected invoice never changes. Read why it was rejected and send a new invoice that corrects it.
Receive
- Sync received invoices: Download the invoices your suppliers sent to a company, read them, and pause or resume synchronisation.
- Store and archive: The record the gateway stores for an accepted or a received invoice, how to read its name and hash, and what to keep yourself.
- Buyer messages: Read the messages buyers send about the invoices you sent, and what to do with them.
- Match to purchase orders: Match a received invoice to your own purchase order by its reference, with a fallback on the supplier and the total.
Statuses and errors
- Lifecycle and statuses: The path of an invoice from draft to ok or nok, what moves it from one status to the next and which statuses are final.
- The authority’s answers: The three words the authority answers with, which status each becomes, and how its message reaches you unchanged.
- Validation rules catalogue: Every rule the gateway checks before it sends an invoice: its id, its place in the document, its severity and what it requires.
- Error codes: What to do for each code that e‑Factura Gateway adds to the shared ones, and the codes behind the refusals of the product window.
- When the authority is unavailable: What happens when the authority does not answer an upload, why the invoice goes to manual review and how to send it again safely.
Reference
- Errors: The error object of the e‑Factura Gateway API and the codes that say what went wrong.
- Idempotency and concurrency: Repeat a request without applying it twice, and refuse a change made on an out-of-date record.
- Pagination: Lists come in pages. Follow the cursor until it is empty.
- Limits: The limits of the e‑Factura Gateway API, with their values and what happens over them.
- Versioning: The version is in the path. Additions keep it; a change that could break a caller gets a new one.
- Changelog: Every version of the e‑Factura Gateway contract, with its day and what it contains.
API reference
- Companies: The companies of your account: add one, read it, and control its synchronisation with the authority.
- Authorisations: The authorisation a company gave the gateway at the authority: read it and renew it.
- Invoices: Create, change, send and follow invoices and credit notes, and read their history.
- Validations: The checks that run on an invoice before it is sent, and the catalogue of their rules.
- Received invoices: The invoices your suppliers sent to your companies, as the gateway downloaded them.
- Messages: The messages buyers sent about the invoices you sent.
- Files: The record the gateway stores for an accepted or a received invoice.
- Operations: A request that changes data is accepted once and answered with an operation result you can read again.
- Subscriptions: Register the HTTPS endpoint that receives events, and read, retry and replay the deliveries.
Events
- Event envelope: Every e‑Factura Gateway event has the same envelope; only
datachanges with the type of the event. - Event catalogue: The events the gateway sends about an invoice, when each one is sent and what its data holds.
- Subscriptions: Register an HTTPS endpoint and e‑Factura Gateway sends your events to it, each one signed.
- Verify signatures: Every delivery is signed. Check the signature on the raw body before you trust the event.
- Delivery and retries: An event is sent again when your endpoint does not confirm it, and is kept for replay after the last attempt.
- Replay: Send a parked event again once your endpoint is ready to take it.
- Reconcile with the authority’s list: Check at the end of a period that your records, the gateway and the authority agree, and settle what does not.