curl --request POST \
--url https://api.hit-pay.com/v1/products \
--header 'Content-Type: multipart/form-data' \
--header 'X-BUSINESS-API-KEY: <x-business-api-key>' \
--form 'name=Product Beanie' \
--form price=15 \
--form 'description=<p>Stylish hat suitable for the winter.</p>' \
--form barcode=1234567890123 \
--form 'headline=Stylish hat suitable for the winter.' \
--form stock_keeping_unit=SKU123456 \
--form quantity=1 \
--form quantity_alert_level=1 \
--form currency=sgd \
--form category_ids=9a12fab0-d282-4437-9460-c3d26662d11a \
--form channels=online_store \
--form location_ids=9a12fab4-d112-48af-9d6b-050d650b0a25 \
--form 'locations={
"id": "9a12fab4-d112-48af-9d6b-050d650b0a25",
"manage_inventory": "1",
"quantity": 1,
"quantity_alert_level": 1
}' \
--form open_amount=0 \
--form is_manageable=1 \
--form is_pinned=0 \
--form product_weight=250 \
--form delivery_method_required=true \
--form 'variations={
"price": 123,
"quantity": 123,
"quantity_alert_level": 123,
"image": "<string>",
"product_variation_weight": 123,
"variation_value_1": "<string>",
"variation_value_2": "<string>",
"variation_value_3": "<string>"
}' \
--form 'image={
"image": "<string>"
}' \
--form publish=1 \
--form variations.items.image='@example-file' \
--form image.items.image='@example-file'{
"id": "9a12fab4-d112-48af-9d6b-050d650b0a25",
"business_id": "9130c422-bf97-4bd1-b370-07a3a6f40708",
"category_id": [
"9a12fab0-d282-4437-9460-c3d26662d11a"
],
"name": "Beanie",
"headline": null,
"description": "<p>Stylish hat suitable for the winter.</p>",
"currency": "SGD",
"price": 15,
"price_display": "SGD 15.00",
"price_stored": 1500,
"tax_id": null,
"is_manageable": 1,
"is_pinned": false,
"status": "published",
"product_weight": 250,
"delivery_method_required": true,
"has_variations": true,
"is_shopify": false,
"product_url": "<string>",
"variations_count": 2,
"variations": [
{
"id": "9a12fab4-d998-44ea-ad11-8753be88a1c9",
"stock_keeping_unit": null,
"description": "Medium",
"weight": null,
"length": null,
"width": null,
"depth": null,
"price": 18,
"price_display": "SGD 18.00",
"price_stored": 1800,
"quantity": 150,
"quantity_alert_level": 10,
"product_variation_weight": 250,
"variation_value_1": "Medium",
"variation_value_2": null,
"variation_value_3": null
},
{
"id": "9a12fab4-dd20-4f8f-9e74-de28629f863a",
"stock_keeping_unit": null,
"description": "Large",
"weight": null,
"length": null,
"width": null,
"depth": null,
"price": 20,
"price_display": "SGD 20.00",
"price_stored": 2000,
"quantity": 148,
"quantity_alert_level": 10,
"product_variation_weight": 255,
"variation_value_1": "Large",
"variation_value_2": null,
"variation_value_3": null
}
],
"variation_key_1": "Size",
"variation_key_2": null,
"variation_key_3": null,
"images": [
{
"id": "9a12fab6-1e76-448e-8c45-e84e2e38f294",
"caption": "Beanie",
"url": "<string>",
"other_dimensions": [
{
"size": "icon",
"path": "<string>"
},
{
"size": "large",
"path": "<string>"
},
{
"size": "small",
"path": "<string>"
},
{
"size": "medium",
"path": "<string>"
},
{
"size": "thumbnail",
"path": "<string>"
}
]
}
],
"is_published": true,
"created_at": "2023-09-07T13:04:22+08:00",
"updated_at": "2023-09-18T14:36:54+08:00",
"starts_at": null,
"ends_at": null
}Create a new product with name, price, and optional variants
curl --request POST \
--url https://api.hit-pay.com/v1/products \
--header 'Content-Type: multipart/form-data' \
--header 'X-BUSINESS-API-KEY: <x-business-api-key>' \
--form 'name=Product Beanie' \
--form price=15 \
--form 'description=<p>Stylish hat suitable for the winter.</p>' \
--form barcode=1234567890123 \
--form 'headline=Stylish hat suitable for the winter.' \
--form stock_keeping_unit=SKU123456 \
--form quantity=1 \
--form quantity_alert_level=1 \
--form currency=sgd \
--form category_ids=9a12fab0-d282-4437-9460-c3d26662d11a \
--form channels=online_store \
--form location_ids=9a12fab4-d112-48af-9d6b-050d650b0a25 \
--form 'locations={
"id": "9a12fab4-d112-48af-9d6b-050d650b0a25",
"manage_inventory": "1",
"quantity": 1,
"quantity_alert_level": 1
}' \
--form open_amount=0 \
--form is_manageable=1 \
--form is_pinned=0 \
--form product_weight=250 \
--form delivery_method_required=true \
--form 'variations={
"price": 123,
"quantity": 123,
"quantity_alert_level": 123,
"image": "<string>",
"product_variation_weight": 123,
"variation_value_1": "<string>",
"variation_value_2": "<string>",
"variation_value_3": "<string>"
}' \
--form 'image={
"image": "<string>"
}' \
--form publish=1 \
--form variations.items.image='@example-file' \
--form image.items.image='@example-file'{
"id": "9a12fab4-d112-48af-9d6b-050d650b0a25",
"business_id": "9130c422-bf97-4bd1-b370-07a3a6f40708",
"category_id": [
"9a12fab0-d282-4437-9460-c3d26662d11a"
],
"name": "Beanie",
"headline": null,
"description": "<p>Stylish hat suitable for the winter.</p>",
"currency": "SGD",
"price": 15,
"price_display": "SGD 15.00",
"price_stored": 1500,
"tax_id": null,
"is_manageable": 1,
"is_pinned": false,
"status": "published",
"product_weight": 250,
"delivery_method_required": true,
"has_variations": true,
"is_shopify": false,
"product_url": "<string>",
"variations_count": 2,
"variations": [
{
"id": "9a12fab4-d998-44ea-ad11-8753be88a1c9",
"stock_keeping_unit": null,
"description": "Medium",
"weight": null,
"length": null,
"width": null,
"depth": null,
"price": 18,
"price_display": "SGD 18.00",
"price_stored": 1800,
"quantity": 150,
"quantity_alert_level": 10,
"product_variation_weight": 250,
"variation_value_1": "Medium",
"variation_value_2": null,
"variation_value_3": null
},
{
"id": "9a12fab4-dd20-4f8f-9e74-de28629f863a",
"stock_keeping_unit": null,
"description": "Large",
"weight": null,
"length": null,
"width": null,
"depth": null,
"price": 20,
"price_display": "SGD 20.00",
"price_stored": 2000,
"quantity": 148,
"quantity_alert_level": 10,
"product_variation_weight": 255,
"variation_value_1": "Large",
"variation_value_2": null,
"variation_value_3": null
}
],
"variation_key_1": "Size",
"variation_key_2": null,
"variation_key_3": null,
"images": [
{
"id": "9a12fab6-1e76-448e-8c45-e84e2e38f294",
"caption": "Beanie",
"url": "<string>",
"other_dimensions": [
{
"size": "icon",
"path": "<string>"
},
{
"size": "large",
"path": "<string>"
},
{
"size": "small",
"path": "<string>"
},
{
"size": "medium",
"path": "<string>"
},
{
"size": "thumbnail",
"path": "<string>"
}
]
}
],
"is_published": true,
"created_at": "2023-09-07T13:04:22+08:00",
"updated_at": "2023-09-18T14:36:54+08:00",
"starts_at": null,
"ends_at": null
}"b286daabf9921b5a01a4621f026c111e046f8911feba212996c92159b98427d"
The name of the product
"Product Beanie"
The price of the product
15
The description of the product
"<p>Stylish hat suitable for the winter.</p>"
The barcode of the product
255"1234567890123"
The headline of the product
"Stylish hat suitable for the winter."
The stock keeping unit of the product
255"SKU123456"
The quantity of the product
x >= 01
The quantity alert level of the product. It is required when quantity alert level is present.
x >= 01
The currency of the product
"sgd"
The list of business product category ids of the product
The category ids of the product
["9a12fab0-d282-4437-9460-c3d26662d11a"]The channels of the product
online_store, pos, invoice The location ids of the product
Show child attributes
The open amount of the product
1, 0 The is manageable of the product
1, 0 The is pinned of the product
1, 0 Weight in gram
250
Show child attributes
Show child attributes
1, 0 201
Show child attributes
Weight in gram
Show child attributes
Was this page helpful?