API Reference

Update Invoice

Request

[PUT] /api/v1/invoice/update-invoice/:id
Content-Type: application/json
x-client-id: <client_id>
x-signature: <signature>
x-timestamp: <timestamp>

Body

NameparentTypeDescription
value_attime.Timeexample: 2024-09-05T16:59:59.999Z
due_attime.Time
reference_codestring
tax_typestringprice_excluding_tax
price_including_tax
tax_not_applicable
items[]struct
nameitemsstring
priceitemsfloat64
quantityitemsint64
taxesitems[]struct
nametaxesstring
tax_idtaxesuuid.UUID
ratetaxesint64
customerstruct
namecustomerstring
phonecustomerstring+84
emailcustomerstringwith @ prefix
addresscustomerstring
payment_config[]string
discounts[]struct
is_ratediscountsboolean
valuediscountsint

Response

Content-Type: application/json

Body

NameTypeDescription
iduuid.UUIDID
order_codestringOrder code
system_codestringSystem code
value_attime.TimeInvoice create date
due_attime.TimeInvoice end date
total_amountfloat64Total amount
tax_amountfloat64Tax amount
contact_infostruct-parent
contact_namecontact_info: string
contact_numbercontact_info: string
payment_config[]string
payment_due_amountfloat64

Errors

StatusMesssage
200Success
401Unauthorized

Example

Request

[PUT] /api/v1/invoice/update-invoice/:id
{
    "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"
    }
}

QR Check

https://me-qr.com/qr-code-generator/qr -> copy qr -> choose Text then paste it in there