Skip to main content

Invoice

Create and manage invoices with integrated payment processing.

Invoice Flow

Quick Reference​

EndpointMethodDescription
/api/v1/invoicesPOSTCreate a new invoice
/api/v1/invoicesGETList all invoices
/api/v1/invoices/:idGETGet specific invoice
/api/v1/invoices/:idPUTUpdate invoice
/api/v1/invoices/:idDELETEDelete invoice

API Endpoints​

Create Invoice​

Create a new invoice with products, customer, and payment methods.

POST /api/v1/invoices
curl -X POST 'https://api.finan.one/open/api/v1/invoices' \
-H 'Content-Type: application/json' \
-H 'x-client-id: YOUR_CLIENT_ID' \
-H 'x-signature: YOUR_SIGNATURE' \
-H 'x-timestamp: 1699999999' \
-d '{
"invoice_code": "INV12345",
"transaction_date": "2024-11-22T10:00:00Z",
"due_date": "2024-11-29T10:00:00Z",
"items": [
{
"code": "PRD0001",
"tax_code": "TAX_CODE_10",
"unit_price": 100000,
"quantity": 2,
"note": "note for product"
}
],
"tax_type": "price_excluding_tax",
"discount": {
"is_percentage": false,
"value": 10000
},
"customer": {
"code": "CUST123",
"email": "customer@example.com"
},
"note": "This is a note for the invoice",
"payment_methods": ["bank_transfer", "card", "ewallet_momo"],
"account_id": "54957437-0cb5-4992-ad0e-76d26ba4ddc3"
}'

Request Body​

FieldTypeRequiredDescription
invoice_codestringβœ…Unique invoice code
transaction_datedatetimeβœ…Transaction date (ISO 8601)
due_datedatetimeβœ…Payment due date (ISO 8601)
tax_typestringβœ…price_excluding_tax, price_including_tax, or tax_not_applicable
itemsarrayβœ…List of products/services
customerobjectβœ…Customer information
discountobjectDiscount configuration
notestringInvoice notes
payment_methodsarrayβœ…Accepted payment methods: bank_transfer, card, ewallet_momo
account_iduuidRequired for bank_transfer to Shinhan. Get from Account API

items[]

FieldTypeRequiredDescription
codestringβœ…Product SKU code
tax_codestringβœ…Tax code. See Code Reference
unit_priceintegerPrice per unit (uses product price if empty)
quantityintegerβœ…Quantity
notestringItem note

discount

FieldTypeDescription
is_percentagebooleanfalse for fixed amount, true for percentage
valuefloatDiscount value (max 2 decimal places)

customer

FieldTypeRequiredDescription
codestringβœ…Customer code (must exist in system)
emailstringOverride email for this invoice only

Response​

{
"message": { "content": "Thα»±c thi API thΓ nh cΓ΄ng" },
"code": 102001,
"request_id": "abc123...",
"data": {
"invoice_id": "INV-550e8400-e29b-41d4-a716-446655440000",
"invoice_code": "INV12345",
"transaction_date": "2024-11-22T10:00:00Z",
"due_date": "2024-11-29T10:00:00Z",
"tax_type": "price_excluding_tax",
"total_amount": 220000,
"total_tax_amount": 20000,
"total_discount_amount": 10000,
"paid_amount": 0,
"unpaid_amount": 220000,
"items": [
{
"code": "PRD0001",
"name": "Product Name",
"quantity": 2,
"unit_price": 100000,
"amount": 200000
}
],
"customer": {
"code": "CUST123",
"name": "Customer Name",
"email": "customer@example.com"
},
"payment_link": "https://book.finan.one/pay/520/invoice/INV12345",
"created_at": "2024-11-22T12:00:00Z"
}
}
Payment Link

Share the payment_link with your customer for easy payment. Supports all configured payment methods.


Get Invoices​

Retrieve all invoices.

GET /api/v1/invoices
curl -X GET 'https://api.finan.one/open/api/v1/invoices' \
-H 'Content-Type: application/json' \
-H 'x-client-id: YOUR_CLIENT_ID' \
-H 'x-signature: YOUR_SIGNATURE' \
-H 'x-timestamp: 1699999999'

Response​

{
"message": { "content": "Thα»±c thi API thΓ nh cΓ΄ng" },
"code": 102000,
"request_id": "abc123...",
"data": [
{
"invoice_id": "INV-550e8400-e29b-41d4-a716-446655440000",
"invoice_code": "INV12345",
"transaction_date": "2024-11-22T10:00:00Z",
"due_date": "2024-11-29T10:00:00Z",
"total_amount": 220000,
"paid_amount": 220000,
"unpaid_amount": 0,
"payment_link": "https://book.finan.one/pay/520/invoice/INV12345",
"created_at": "2024-11-22T12:00:00Z"
}
]
}
Get Single Invoice
GET /api/v1/invoices/:invoice_id

Get Payment Requests for Invoice​

To retrieve payment requests for an invoice, use the Payment API with filters:

curl -X GET 'https://api.finan.one/open/api/v1/payments?reference_type=invoice&reference_id=INV-550e8400' \
-H 'Content-Type: application/json' \
-H 'x-client-id: YOUR_CLIENT_ID' \
-H 'x-signature: YOUR_SIGNATURE' \
-H 'x-timestamp: 1699999999'

Update Invoice​

Update an existing invoice with new items, discount, due date, or customer email.

PUT /api/v1/invoices/:invoice_id
curl -X PUT 'https://api.finan.one/open/api/v1/invoices/INVOICE_ID' \
-H 'Content-Type: application/json' \
-H 'x-client-id: YOUR_CLIENT_ID' \
-H 'x-signature: YOUR_SIGNATURE' \
-H 'x-timestamp: 1699999999' \
-d '{
"due_date": "2024-11-29T10:00:00Z",
"items": [
{
"code": "PRD0001",
"tax_code": "TAX_CODE_10",
"unit_price": 100000,
"quantity": 2,
"note": "note for product"
}
],
"discount": {
"is_percentage": false,
"value": 120000
},
"customer": {
"email": "customer@example.com"
},
"note": "This is note of invoice"
}'

Updatable Fields​

FieldTypeDescription
due_datedatetimeUpdated due date
itemsarrayUpdated item list
discountobjectUpdated discount
customer.emailstringOverride customer email
notestringInvoice notes

Response​

{
"message": { "content": "Thα»±c thi API thΓ nh cΓ΄ng" },
"code": 102000,
"request_id": "abc123...",
"data": {
"invoice_id": "INV-550e8400-e29b-41d4-a716-446655440000",
"invoice_code": "INV12345",
"due_date": "2024-12-05T10:00:00Z",
"total_amount": 330000,
"updated_at": "2024-11-23T10:00:00Z"
}
}

Delete Invoice​

Delete an invoice.

DELETE /api/v1/invoices/:invoice_id
curl -X DELETE 'https://api.finan.one/open/api/v1/invoices/INV-550e8400-e29b-41d4-a716-446655440000' \
-H 'Content-Type: application/json' \
-H 'x-client-id: YOUR_CLIENT_ID' \
-H 'x-signature: YOUR_SIGNATURE' \
-H 'x-timestamp: 1699999999'

Response​

{
"message": { "content": "Thα»±c thi API thΓ nh cΓ΄ng" },
"code": 102001,
"request_id": "abc123...",
"data": "success"
}
Payment Requests

If the invoice has payment requests, they remain active after deletion. You can still query payments using reference_type=invoice and reference_id.


Next Steps​

  • Payment - Create payment requests for invoices
  • Customer - Manage customer records
  • Product - Manage product catalog