API Endpoint
https://einvoice-api.sepay.vn/v1/invoices/issueAPI Request
Reference code of the previously created draft invoice
API Response
{
"success": true,
"data": {
"tracking_code": "084e179d-d95a-11f0-aef4-52c7e9b4f41b",
"tracking_url": "https://einvoice-api.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ử"
}
}Error Handling
When the API returns any of the errors below, the invoice is not issued and is not sent to the tax authority.
400REFERENCE_CODE_REQUIREDreference_code is missing from the body.
401UNAUTHORIZEDMissing or invalid Bearer token.
500EINVOICE_DRAFT_NOT_FOUNDDraft invoice not found for the given reference_code.
422REGISTRATION_NOT_TAX_APPROVEDNot registered or the declaration is not yet approved.
422INVOICE_DATE_BEFORE_TAX_APPROVALInvoice date is before the approval date. See tax_authority_approved_date in GET /v1/provider-accounts.
500REGISTRATION_NOT_COMPLETEThe company has not completed eInvoice package registration.
500BILLING_IS_UNPAIDThe company has not paid for the eInvoice package.
500QUOTA_HAS_BEEN_USERD_UPThe eInvoice package quota has been used up - renew to keep issuing.
405METHOD_NOT_ALLOWEDWrong HTTP method for the endpoint.
500CREATE_INVOICE_DATA_FAILSystem error while processing the issuance request.
Notes
- 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.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)