Xem hóa đơn/vé điển tử
trước khi phát hành
Mô tả chi tiết
1. Request
1.1 Url API
Method | URL API (BaseUrl lấy ở mô tả chung) |
---|---|
POST | <BaseUrl>/unpublishview |
1.2 Header
Content-Type: application-json
Authorization: Bearer <token lấy ở api Lấy token Authorization>
1.3 Body
{
Đối tượng hóa đơn/vé điện tử InvoiceData
}
2 Response
{
"success": true,
"errorCode": null,
"descriptionErrorCode": null,
"errors": [],
"data": "Link view hóa đơn/vé dạng PDF(mở bằng trình duyệt để xem bản pdf trước phát hành của hóa đơn/vé)",
"customData": ""
}
Lưu ý: Link view hóa đơn/vé điện tử tồn tại trong trong 30s
3 Mô tả đối tượng InvoiceData
Xem chi tiết tại đây: InvoiceData
4. Ví dụ:
4.1 Request
URL: https://testapi.meinvoice.vn/api/integration/invoice/unpublishview
HEADERS:
Content-Type: application-json
Authorization: Bearer <token lấy ở api Lấy token Authorization>
BODY:
{
"RefID": "317f3c17-0ab3-4012-b8fe-13bbc4fbb12e",
"InvSeries": "1C24TCM",
"InvoiceName": "Hóa đơn giá trị gia tăng",
"InvDate": "2024-09-09",
"CurrencyCode": "VND",
"ExchangeRate": 1.0,
"PaymentMethodName": "TM/CK",
"IsTicket": true,
"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%"
}
],
"TaxRateInfo": [
{
"VATRateName": "10%",
"AmountWithoutVATOC": 5000000.0,
"VATAmountOC": 500000.0
}
]
}
4.2 Response
{
"success": true,
"errorCode": null,
"descriptionErrorCode": null,
"errors": [],
"data": "https://test.download.meinvoice.vn/tra-cuu/downloadhandler.ashx?type=pdf&code=dc795706-849e-4214-8f11-b20d235eaf5f&Viewer=1&ext=0K0MN04B",
"customData": ""
}
5 Tài liệu tham khảo (Curl Postman)
curl --location --request POST 'https://testapi.meinvoice.vn/api/integration/invoice/unpublishview' \
--header 'Authorization: Bearer <token lấy ở api Lấy token Authorization>' \
--header 'Content-Type: application/json' \
--data-raw '{
"RefID": "07210bf2-9fd4-4b24-81c6-594d95d5e533",
"InvSeries": "1C24TCM",
"InvoiceName": "Hóa đơn giá trị gia tăng",
"InvDate": "2024-09-09",
"CurrencyCode": "VND",
"ExchangeRate": 1.0,
"PaymentMethodName": "TM/CK",
"IsTicket": true,
"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%"
}
],
"TaxRateInfo": [
{
"VATRateName": "10%",
"AmountWithoutVATOC": 5000000.0,
"VATAmountOC": 500000.0
}
]
}'