Phát hành hóa đơn máy tính tiền
không cần ký số
(SignType=5)
Mô tả
Đầu API có chúc năng phát hành hóa đơn điện tử phát hành từ máy tính tiền không cần ký số
1. Request
1.1 Url API
Method | URL API (BaseUrl lấy ở mô tả chung) |
---|---|
POST | <BaseUrl>(https://testapi.meinvoice.vn/api/integration/invoice) |
1.2 Header
Content-Type: application-json
Authorization: Bearer <token lấy ở api Lấy token Authorization>
1.3 Body
đôi tượng InvoiceParameter
{
"SignType": 5, (loại ký số HSM)
"InvoiceData": <list đối tượng InvoiceData>
}
Mô tả đối tượng: InvoiceData
2 Response
{
"success": true/false <Trạng thái khi call API trả về>,
"errorCode": "<Mã lỗi nếu có>",
"descriptionErrorCode": "<mô tả mã lỗi nếu có>",
"createInvoiceResult": null,
"publishInvoiceResult": <List thông tin publishInvoiceResult>
}
Mô tả đối tượng: publishInvoiceResult
3 Ví dụ
3.1 Request
URL: https://testapi.meinvoice.vn/api/integration/invoice
HEADERS:
Content-Type: application-json
Authorization: Bearer <token lấy ở api Lấy token Authorization>
BODY:
{
"SignType": 5,
"InvoiceData": [
{
"RefID": "a91f0781-3177-46af-b9bb-f1b9ef767228",
"InvSeries": "1C24MMA",
"InvDate": "2024-09-18",
"CurrencyCode": "VND",
"ExchangeRate": 1.0,
"PaymentMethodName": "TM/CK",
"BuyerLegalName": "Công ty cổ phần MISA",
"BuyerTaxCode": "0101243150",
"BuyerAddress": "Tầng 9 tòa nhà Technosoft, Duy Tân, Dịch Vọng Hậu, Cầu Giấy, Hà Nội",
"BuyerCode": "MS001",
"BuyerPhoneNumber": "0241 522 526",
"BuyerEmail": "contact@misa.com.vn",
"BuyerFullName": "Nguyễn Xuân Hoàng",
"BuyerBankAccount": "010124315087210",
"BuyerBankName": "Ngân hàng Việt Nam Thịnh Vượng",
"TotalSaleAmountOC":500000,
"TotalSaleAmount":500000,
"TotalDiscountAmountOC": 0,
"TotalDiscountAmount": 0,
"TotalAmountWithoutVATOC": 500000.0,
"TotalAmountWithoutVAT": 500000.0,
"TotalVATAmountOC": 50000.0,
"TotalVATAmount": 50000.0,
"TotalAmountOC": 550000.0,
"TotalAmountOC": 550000.0,
"TotalAmountInWords": "Năm trăm năm mươi nghìn đồng.",
"OriginalInvoiceDetail": [
{
"ItemType": 1,
"LineNumber": 1,
"SortOrder":1,
"ItemCode": "AOSM01",
"ItemName": "Áo sơ mi Nam 40",
"UnitName": "Chiếc",
"Quantity": 10.0,
"UnitPrice": 50000.0,
"DiscountRate": 0,
"DiscountAmountOC": 0,
"DiscountAmount": 0,
"AmountOC": 500000.0,
"Amount": 500000.0,
"AmountWithoutVATOC": 500000.0,
"AmountWithoutVAT": 500000.0,
"VATRateName": "10%",
"VATAmountOC":50000,
"VATAmount":50000
}
],
"TaxRateInfo": [
{
"VATRateName": "10%",
"AmountWithoutVATOC": 500000.0,
"VATAmountOC": 50000.0
}
],
"OptionUserDefined": {
"MainCurrency": "VND",
"AmountDecimalDigits": "0",
"AmountOCDecimalDigits": "0",
"UnitPriceOCDecimalDigits": "0",
"UnitPriceDecimalDigits": "0"
}
}
]
}
3.2 Response
{
"success": true,
"errorCode": null,
"descriptionErrorCode": null,
"createInvoiceResult": null,
"publishInvoiceResult": "[{\"RefID\":\"a91f0781-3177-46af-b9bb-f1b9ef767228\",\"TransactionID\":\"11CRTPWJG5\",\"InvTemplateNo\":null,\"InvSeries\":null,\"InvNo\":\"00000033\",\"InvCode\":null,\"InvDate\":\"2024-09-25T00:00:00+07:00\",\"ErrorCode\":\"\",\"CustomData\":null}]"
}
4. Tài liệu tham khảo (Curl Postman)
curl --location 'https://testapi.meinvoice.vn/api/integration/invoice' \
--header 'Authorization: Bearer <token lấy ở api Lấy token Authorization>' \
--header 'Content-Type: application/json' \
--header 'Cookie: TS01df89db=010fb9740483c6e090a0168ad18f153b6543df0dc2ef8db082c5fdd03356731f4ab3170cb5f315fa0afca8615e2ead2e9f8602d6e8' \
--data-raw '{
"SignType": 5,
"InvoiceData": [
{
"RefID": "1f269f4c-08af-4665-b7b6-eb62581f583c",
"InvSeries": "1C24MMA",
"InvDate": "2024-09-25",
"CurrencyCode": "VND",
"ExchangeRate": 1.0,
"PaymentMethodName": "TM/CK",
"BuyerLegalName": "Công ty cổ phần MISA",
"BuyerTaxCode": "0101243150",
"BuyerAddress": "Tầng 9 tòa nhà Technosoft, Duy Tân, Dịch Vọng Hậu, Cầu Giấy, Hà Nội",
"BuyerCode": "MS001",
"BuyerPhoneNumber": "0241 522 526",
"BuyerEmail": "contact@misa.com.vn",
"BuyerFullName": "Nguyễn Xuân Hoàng",
"BuyerBankAccount": "010124315087210",
"BuyerBankName": "Ngân hàng Việt Nam Thịnh Vượng",
"TotalAmountWithoutVATOC": 5000000.0,
"TotalVATAmountOC": 500000.0,
"TotalDiscountAmountOC": 0,
"TotalAmountOC": 5500000.0,
"TotalAmountInWords": "Năm triệu năm trăm nghìn đồng.",
"OriginalInvoiceDetail": [
{
"ItemType": 1,
"LineNumber": 1,
"ItemCode": "AOSM01",
"ItemName": "Áo sơ mi Nam 40",
"UnitName": "Chiếc",
"Quantity": 10.0,
"UnitPrice": 500000.0,
"DiscountRate": 0,
"DiscountAmountOC": 0,
"AmountOC": 5000000.0,
"AmountWithoutVATOC": 5000000.0,
"VATRateName": "10%",
"VATAmountOC":500000.0,
"VATAmount":500000.0
}
],
"TaxRateInfo": [
{
"VATRateName": "10%",
"AmountWithoutVATOC": 5000000.0,
"VATAmountOC": 500000.0
}
],
"OptionUserDefined": {
"MainCurrency": "VND",
"AmountDecimalDigits": "0",
"AmountOCDecimalDigits": "0",
"UnitPriceOCDecimalDigits": "0",
"UnitPriceDecimalDigits": "0"
}
}
],
"PublishInvoiceData": null
}'