IIAPI Reference
Complete API reference for IIAPI e-invoice integration.
Base URL
Production: https://api.your-domain.com/api/iiapi
Development: http://localhost:3000/api/iiapiInvoice Endpoints
Create VAT Invoice
http
POST /vat-invoices
Content-Type: application/json
{
"seller": {
"taxCode": "0123456789",
"name": "Your Company",
"address": "123 Street"
},
"buyer": {
"taxCode": "9876543210",
"name": "Customer Company",
"address": "456 Avenue"
},
"invoiceDate": "2024-01-15",
"currencyCode": "VND",
"items": [
{
"itemName": "Product",
"quantity": 10,
"unitPrice": 100000,
"amount": 1000000,
"vatRate": 10,
"vatAmount": 100000
}
],
"totalAmount": 1000000,
"totalVatAmount": 100000,
"totalPayment": 1100000
}Create POS Invoice
http
POST /pos-sale-invoices
Content-Type: application/json
{
"invoiceDate": "2024-01-15",
"items": [
{
"itemName": "Coffee",
"quantity": 2,
"unitPrice": 50000,
"amount": 100000
}
],
"totalAmount": 100000,
"totalPayment": 100000,
"paymentMethod": "CASH"
}Invoice Management
Submit Invoice
http
POST /invoices/:id/submit
Content-Type: application/json
{
"clientName": "default"
}Cancel Invoice
http
POST /invoices/:id/cancel
Content-Type: application/json
{
"reason": "Customer request"
}Get Invoice
http
GET /invoices/:idList Invoices
http
GET /invoices?status=ACCEPTED&dateFrom=2024-01-01&dateTo=2024-01-31Invoice Status
| Status | Description |
|---|---|
| DRAFT | Created, not submitted |
| PENDING | Submitted to T-VAN |
| SIGNED | Digitally signed |
| SENT | Sent to CQT |
| ACCEPTED | CQT accepted |
| REJECTED | CQT rejected |
| CANCELLED | Cancelled |
Error Codes
| Code | Description |
|---|---|
| IIAPI_001 | Invalid tax code |
| IIAPI_002 | Missing required field |
| IIAPI_003 | T-VAN connection failed |
| IIAPI_004 | Invoice already submitted |
| IIAPI_005 | CQT rejection |