Tạo hóa đơn điện tử.
Sử dụng API để tạo & phát hành hóa đơn điện tử nhanh chóng và tiện lợi. (Tính năng đang phát triển)
POST
https://api.xinvoice.vn/invoice-api/invoice
Request
Request Description
Headers: - client-id: ID của khách hàng được cấp khi đăng ký sử dụng API - api-key: Khóa API tương ứng với client-id - auth-token: Token xác thực người dùng Payload: - invoiceCreationType: Trạng thái lập hóa đơn (đã phát hành hoặc nháp) [ISSUED, DRAFT, PREVIEW] - invoiceType: Loại hóa đơn theo Thông tư 32 hoặc 78 [01GTKT, 02GTTT, 07KPTQ, 03XKNB, 04HGDL, 01BLP, 1, 2, 3, 4, 5, 6] - templateCode: Ký hiệu mẫu hóa đơn Ví dụ: 1/247 - invoiceSeries: Là “Ký hiệu hóa đơn” Ví dụ K24TSA - currencyCode: Mã tiền tệ dùng cho hóa đơn Ví dụ: USD, VND, EUR - adjustmentType: Trạng thái điều chỉnh hóa đơn: 1: Hóa đơn gốc (hóa đơn đã phát hành, hóa đơn bị điều chỉnh, hóa đơn bị thay thế) 3: Hóa đơn thay thế 5: Hóa đơn điều chỉnh 7: Hóa đơn xóa bỏ Không truyền sẽ mặc định là 1 - paymentStatus: Trạng thái thanh toán của hoá đơn True: Đã thanh toán False: Chưa thanh toán - invoiceIssuedDate: Thời gian phát hành hóa đơn (timestamp milliseconds), mặc định là thời điểm hiện tại - buyerInfo: Thông tin người mua - taxBreakdowns: Thông tin thuế - items: Danh sách hàng hóa - payments: Thông tin thanh toán - summarizeInfo: Thông tin tổng hợp - validation: Kiểm tra thông tin tiền tệ hàng hóa của hóa đơn true: Kiểm tra false: Không kiểm tra
curl -L 'https://api.xinvoice.vn/invoice-api/invoice' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'client-id: <client-id>' \
-H 'api-key: <api-key>' \
-H 'Authorization: <auth-token>' \
--data-raw '{
"invoiceCreationType": "ISSUED",
"invoiceType": "01GTKT",
"templateCode": "1/247",
"invoiceSeries": "K24TSA",
"currencyCode": "VND",
"adjustmentType": "1",
"paymentStatus": true,
"invoiceIssuedDate": 0,
"buyerInfo": {
"buyerNotGetInvoice": false,
"buyerName": "string",
"buyerLegalName": "string",
"buyerTaxCode": "string",
"buyerAddressLine": "string",
"buyerEmail": "user@example.com"
},
"taxBreakdowns": {
"taxPercentage": 0,
"taxAmount": 0,
"taxableAmount": 0
},
"items": [
{
"itemTotalAmountWithoutTax": 0,
"itemTotalAmountWithTax": 0,
"taxAmount": 0,
"taxPercentage": 0,
"itemName": "string",
"unitName": "string",
"unitPrice": 0,
"quantity": 0
}
],
"payments": [
{
"paymentMethod": "string",
"paymentMethodName": "string"
}
],
"summarizeInfo": {
"totalTaxAmount": 0,
"totalAmountWithTax": 0,
"totalAmountWithoutTax": 0
},
"validation": false
}'
Response
{
"message": "Api coming soon",
"requestId": "string",
"invoice": {
"id": "string",
"invoiceIssuedDate": 0,
"invoiceNo": "AA/20E0000001",
"transactionID": 160611853871389540,
"reservationCode": 160611853871389540,
"codeOfTax": 160611853871389540,
"invoiceFile": "string"
}
}