Create Product
1. Create New Product
Endpoint
POST /api/v6.1/product
Headers
{
"Content-Type": "application/json",
"X-API-KEY": "{your_api_key}"
}
Request Body
| Field | Required | Data Type | Description |
|--------|---------|-------------|-------|
| product_name
| Yes | String | Product name |
| product_code
| Yes | String | Product code (SKU) |
| unit_name
| Yes | String | Unit of measurement |
| category_name
| Yes | String | Product category |
| origin_name
| Yes | String | Product origin |
| manufacturer_name
| Yes | String | Manufacturer |
| short_description
| No | String | Short description |
| description
| No | String | Detailed description |
| cover_price
| Yes | Float | Listed price |
| discount
| No | Float | Discount rate (%) |
| price_wholesale
| No | Float | Wholesale price |
| discount_wholesale
| No | Float | Wholesale discount rate (%) |
| price_online
| No | Float | Online selling price |
| discount_online
| No | Float | Online discount rate (%) |
| price_average_in
| No | Float | Average import price |
| discount_in
| No | Float | Import discount rate (%) |
| saleoff_price
| No | Float | Promotional price |
| product_vat
| No | Float | VAT (%) |
| barcode
| No | String | Product barcode |
| weight
| No | Float | Weight |
| custom_fields
| No | Object | Custom fields |
| variant_attribute_values
| No | Array | List of variant attributes |\
Example Request Body
{
"product_name": "API Test Product",
"product_code": "SP.TEST.001",
"unit_name": "Box",
"category_name": "Equipment",
"origin_name": "Vietnam",
"manufacturer_name": "ABC Company",
"short_description": "Trial product",
"description": "<p>Detailed product description</p>",
"cover_price": 20000,
"price_wholesale": 18000,
"discount": 10,
"discount_wholesale": 15,
"price_online": 19000,
"discount_online": 5,
"price_average_in": 15000,
"discount_in": 8,
"saleoff_price": 12,
"product_vat": 5,
"barcode": "BAR123456",
"weight": 500,
"custom_fields": {
"import_date": 1742317200,
"quantity": 100,
"selling_price": "20000"
},
"variant_attribute_values": [
{
"attribute_name": "Color",
"value_name": "Red",
"additional_price": 2000
},
{
"attribute_name": "Size",
"value_name": "Large",
"additional_price": 5000
}
]
}
2. Response Example & Description
Response Fields
| Field | Data Type | Description |
|--------|-------------|-------|
| message
| String | Result message |
| data
| Object | Newly created product information |
| product_id
| Integer | New product ID |
| product_code
| String | Newly created product code |\
Response Example (Success)
{
"message": "Successfully added",
"data": {
"product_id": 1001,
"product_code": "SP.TEST.001"
}
}