Request
[POST] /api/v1/invoice/create
Content-Type: application/json
x-client-id: <client_id>
x-signature: <signature>
x-timestamp: <timestamp>
Body
Name | parent | Type | Description |
---|---|---|---|
value_at | time.Time | example: 2024-09-05T16:59:59.999Z | |
due_at | time.Time | ||
reference_code | string | ||
tax_type | string | price_excluding_tax price_including_tax tax_not_applicable | |
items | []struct | ||
name | items | string | |
price | items | float64 | |
quantity | items | int64 | |
taxes | items | []struct | |
name | taxes | string | |
tax_id | taxes | uuid.UUID | |
rate | taxes | int64 | |
customer | struct | ||
name | customer | string | |
phone | customer | string | +84 |
customer | string | with @ prefix | |
address | customer | string | |
payment_config | []string | ||
discounts | []struct | ||
is_rate | discounts | boolean | |
value | discounts | int |
Response
Content-Type: application/json
Body
Name | Type | Description |
---|---|---|
id | uuid.UUID | ID |
order_code | string | Order code |
system_code | string | System code |
value_at | time.Time | Invoice create date |
due_at | time.Time | Invoice end date |
total_amount | float64 | Total amount |
tax_amount | float64 | Tax amount |
contact_info | struct-parent | |
contact_name | contact_info: string | |
contact_number | contact_info: string | |
payment_config | []string | |
payment_due_amount | float64 |
Errors
Status | Messsage |
---|---|
200 | Success |
401 | Unauthorized |
Example
Request
[POST] /api/v1/invoice/create
{
"value_at": "2024-09-05T16:59:59.999Z",
"due_at": "2024-10-05T16:59:59.999Z",
"reference_code": "NhanTest",
"tax_type": "price_excluding_tax",
"items": [
{
"name": "GTX-4090",
"price": 100000,
"quantity": 1,
"taxes": [
{
"name": "VAT 10",
"tax_id": "9497360a-9e04-4967-9ed1-7e29cf36ef7a",
"rate": 10
}
]
},
{
"name": "GTX-4030",
"price": 500000,
"quantity": 1,
"taxes": [
{
"name": "VAT 10",
"tax_id": "9497360a-9e04-4967-9ed1-7e29cf36ef7a",
"rate": 10
}
]
}
],
"customer": {
"name": "NhanTr10abc"
},
"payment_config": [
"fcefa968-fe00-4d06-a431-53bd001e7f4b"
],
"discounts": [
{
"is_rate": true,
"value": 10
}
]
}
Response
{
"message": {
"content": "Bạn vừa thực hiện tạo thành công %s"
},
"code": 102001,
"request_id": "967f96b9-bf2a-4888-ae4e-c762d2dd2ef8",
"data": {
"id": "f6906b54-edfb-427f-9204-5f74948b33e8",
"order_code": "HD35",
"system_code": "SOSPMFBA",
"value_at": "2024-09-05T16:59:59.999Z",
"due_at": "2024-10-05T16:59:59.999Z",
"total_amount": 594000,
"tax_amount": 60000,
"contact_info": {
"contact_name": "NhanTr10abc",
"contact_number": ""
},
"payment_config": [
"fcefa968-fe00-4d06-a431-53bd001e7f4b"
],
"created_at": "2024-09-10T11:17:05.81035+07:00"
}
}
