Issue eInvoice (draft)
API to issue an e-invoice from a draft reference_code, returning a tracking code to monitor issuance.
API Endpoint
POST
https://einvoice-api-sandbox.sepay.vn/v1/invoices/issueAPI Request
reference_codestringrequired
Reference code of the previously created draft invoice
API Response
Success Response (200)
{
"success": true,
"data": {
"tracking_code": "084e179d-d95a-11f0-aef4-52c7e9b4f41b",
"tracking_url": "https://einvoice-api-sandbox.sepay.vn/v1/invoices/issue/check/084e179d-d95a-11f0-aef4-52c7e9b4f41b",
"message": "Đã tạo yêu cầu xuất bán hóa đơn điện tử"
}
}successboolean
dataobject
Error Handling
400Bad RequestMissing or invalid reference_code.
401UnauthorizedMissing or invalid Bearer token.
404Not FoundDraft invoice not found for the given reference_code.
Notes
Note
- Issuance is only allowed for invoices that were previously created as drafts (
is_draft=true). reference_codecan be retrieved via the Invoice List API or obtained from thereference_codereturned after successfully checking the draft invoice creation status.- After successfully submitting an invoice issuance request, use the endpoint provided in
tracking_urlto call the Invoice Issuance Status Tracking API.
Code Examples
>
>
>
>
>
curl --request POST \--url https://einvoice-api-sandbox.sepay.vn/v1/invoices/issue \--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \--header 'content-type: application/json' \--data '{"reference_code":"084e179d-d95a-11f0-aef4-52c7e9b4f41b"}'
Next Steps
After successfully submitting the issuance request and receiving a tracking_code:
- Track Invoice Issuance Status - Use the
tracking_codeto check the issuance result (required)