Skip to main content

Product

Manage your product catalog with sale and purchase pricing information.

Quick Reference

EndpointMethodDescription
/api/v1/productsPOSTCreate a new product
/api/v1/productsGETList all products
/api/v1/products/:idGETGet specific product
/api/v1/products/:idPUTUpdate product
/api/v1/products/:idDELETEDelete product

API Endpoints

Create Product

Create a new product with sale and purchase information.

POST /api/v1/products
curl -X POST 'https://api.finan.one/open/api/v1/products' \
-H 'Content-Type: application/json' \
-H 'x-client-id: YOUR_CLIENT_ID' \
-H 'x-signature: YOUR_SIGNATURE' \
-H 'x-timestamp: 1699999999' \
-d '{
"general_info": {
"item_name": "Example Product",
"sku_code": "SKU12345",
"unit": "pcs",
"description": "This is a sample product."
},
"sale_info": {
"sale_price": 100000,
"sale_category_code": "C1001",
"sale_tax_code": "TAX_CODE_10"
},
"purchase_info": {
"purchase_price": 80000,
"purchase_category_code": "D1001",
"purchase_tax_code": "TAX_CODE_8"
}
}'

Request Body

general_info (required)

FieldTypeRequiredDescription
item_namestringProduct name
sku_codestringUnique SKU code
unitstringUnit of measurement (e.g., pcs, kg)
descriptionstringProduct description

sale_info (required)

FieldTypeRequiredDescription
sale_priceintegerSale price before tax (smallest currency unit)
sale_category_codestringIncome category code. See Code Reference
sale_tax_codestringTax code (e.g., TAX_CODE_10). See Code Reference

purchase_info (required)

FieldTypeRequiredDescription
purchase_priceintegerPurchase price before tax
purchase_category_codestringExpense category code. See Code Reference
purchase_tax_codestringTax code. See Code Reference

Response

{
"message": { "content": "Thực thi API thành công" },
"code": 102001,
"request_id": "abc123...",
"data": {
"product_id": "PROD-550e8400-e29b-41d4-a716-446655440000",
"general_info": {
"item_name": "Example Product",
"sku_code": "SKU12345",
"unit": "pcs",
"description": "This is a sample product."
},
"sale_info": {
"sale_price": 100000,
"sale_category_code": "C1001",
"sale_tax_code": "TAX_CODE_10"
},
"purchase_info": {
"purchase_price": 80000,
"purchase_category_code": "D1001",
"purchase_tax_code": "TAX_CODE_8"
},
"created_at": "2024-01-20T14:00:00Z"
}
}

Get Products

Retrieve all products.

GET /api/v1/products
curl -X GET 'https://api.finan.one/open/api/v1/products' \
-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": [
{
"product_id": "PROD-550e8400-e29b-41d4-a716-446655440000",
"general_info": {
"item_name": "Example Product",
"sku_code": "SKU12345",
"unit": "pcs"
},
"sale_info": {
"sale_price": 100000
},
"purchase_info": {
"purchase_price": 80000
},
"created_at": "2024-01-20T14:00:00Z"
}
]
}
Get Single Product
GET /api/v1/products/:product_id

Update Product

Replace an existing product's data. This is a full replace — all sections (general_info, sale_info, purchase_info) and their required fields must be included.

PUT /api/v1/products/:product_id
Full Replace

All fields including sale_tax_code and purchase_tax_code are required for update. Omitted fields will be cleared.

curl -X PUT 'https://api.finan.one/open/api/v1/products/PRODUCT_ID' \
-H 'Content-Type: application/json' \
-H 'x-client-id: YOUR_CLIENT_ID' \
-H 'x-signature: YOUR_SIGNATURE' \
-H 'x-timestamp: 1699999999' \
-d '{
"general_info": {
"item_name": "Updated Product Name",
"sku_code": "SKU67890",
"unit": "kg",
"description": "Updated description for the product."
},
"sale_info": {
"sale_price": 120000,
"sale_category_code": "C1001",
"sale_tax_code": "TAX_CODE_10"
},
"purchase_info": {
"purchase_price": 100000,
"purchase_category_code": "D1001",
"purchase_tax_code": "TAX_CODE_10"
}
}'

Response

{
"message": { "content": "Thực thi API thành công" },
"code": 102001,
"request_id": "abc123...",
"data": {
"product_id": "e5f85e53-d5db-4e4a-8383-61b4cc67398a",
"general_info": {
"item_name": "Updated Product Name",
"sku_code": "SKU67890",
"unit": "kg",
"description": "Updated description for the product."
},
"sale_info": {
"sale_price": 120000,
"sale_category_code": "C1001",
"sale_tax_code": "TAX_CODE_10"
},
"purchase_info": {
"purchase_price": 100000,
"purchase_category_code": "D1001",
"purchase_tax_code": "TAX_CODE_10"
}
}
}

Delete Product

Delete a product from the catalog.

DELETE /api/v1/products/:product_id
curl -X DELETE 'https://api.finan.one/open/api/v1/products/PROD-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"
}

Next Steps