What is SePay eInvoice API?
SePay eInvoice API lets household businesses and enterprises issue eInvoices compliant with Decree 123/2020/ND-CP and Circular 78/2021/TT-BTC. Through a single RESTful API, your system can create invoices, issue them to the tax authority (CQT), and manage the full invoice lifecycle automatically.
The API covers the complete invoice lifecycle: from draft creation, issuance to CQT, real-time status tracking, file download (PDF/XML), and usage quota management, all via a standard RESTful HTTP interface.
View demo invoiceWho is this for?
eInvoice API is designed for organizations and developers who need to automate the eInvoice issuance process:
Issue an eInvoice for each sale transaction to meet invoicing requirements under Decree 123/2020/ND-CP.
Embed eInvoice issuance directly into your sales, accounting, or order management workflows.
Fully automate batch invoice creation and issuance, reducing manual work and errors at scale.
Connect directly to CQT to issue and sync invoice status, supporting reconciliation and compliant storage.
Automatically issue an invoice for each completed order to meet per-transaction invoice requirements.
Add eInvoice issuance to your product to serve enterprise clients.
Key Features
Create draft or live invoices via POST v1/invoices/create, supporting multiple invoice templates and series.
Submit invoices to CQT through your configured eInvoice provider using POST v1/invoices/issue.
Poll create/issue results in real time via /check/{tracking_code} before proceeding to the next step.
Fetch issued invoice details including CQT-compliant PDF and XML file URLs.
Track remaining issuance quota via GET v1/usage to plan your service usage.
List and inspect configured eInvoice provider accounts including templates, series, and status.
eInvoice issuance flow
The eInvoice flow covers every step from authentication and account checks to invoice creation, issuance, and retrieval:
-
Obtain access token: Call
POST v1/tokento receive anaccess_tokenused for all subsequent API calls. -
List provider accounts: Call
GET v1/provider-accountsto view available eInvoice provider accounts and their statuses. -
Get provider account detail: Call
GET v1/provider-accounts/{id}for the specific configuration: allowed templates, series, and activity status. -
Create invoice: Submit invoice data via
POST v1/invoices/create. The API returns atracking_codeto track the creation job. -
Check creation status: Poll
GET v1/invoices/create/check/{tracking_code}to confirm whether creation succeeded or failed. -
Issue invoice: Trigger issuance via
POST v1/invoices/issue. A newtracking_codeis returned for this stage. -
Check issuance status: Poll
GET v1/invoices/issue/check/{tracking_code}to confirm the result of submission to CQT. -
Retrieve invoice details: Once issuance completes, call
GET v1/invoices/{reference_code}to fetch full invoice data plus PDF and XML file URLs. -
Check usage quota: Call
GET v1/usageto monitor remaining issuance quota. -
List invoices: Call
GET v1/invoicesto retrieve a paginated invoice list for monitoring and reconciliation. -
Email logs: Call
GET v1/email-logsto query which email address an invoice was sent to, the delivery status, and the timestamp (available on both Production and Sandbox; on Sandbox the data is simulated from issued invoices).
The Create and Issue steps are processed asynchronously. After calling each step, you must poll the corresponding /check API to confirm the status before proceeding to the next step.
Environments
| Environment | Base URL |
|---|---|
| Production | https://einvoice-api.sepay.vn |
| Sandbox | https://einvoice-api-sandbox.sepay.vn |
Authenticate using a Bearer token in the request header: Authorization: Bearer <ACCESS_TOKEN>
If you are just getting started, test on Sandbox before switching to Production. How to get a Sandbox token, call the API, and what's isolated are covered in SePay eInvoice API Sandbox.
Next Steps
To start using the eInvoice API, follow these steps in order:
- Authenticate with Bearer Token: Get a Bearer token to authenticate subsequent API calls
- List eInvoice Providers: View available eInvoice provider accounts
- Issue an eInvoice: Start creating your first invoice