The Product Object

Products represent the goods or services you sell. They define the base price, HSN codes for GST, and current inventory stock levels.

POST/v1/products

Create a product

Creates a new product in your catalog.

Parameters

namestringRequired
The product's name.
pricenumberRequired
The base unit price.
hsn_sacstring
The HSN or SAC code for GST.
gst_ratenumber
The applicable total GST percentage (e.g. 18).
track_inventoryboolean
Whether to track stock quantities.
stock_qtyinteger
The initial stock quantity.
curl -X POST https://api.vylot.workers.dev/v1/products -H "Authorization: Bearer vk_live_abc123..." -H "Content-Type: application/json" -d '{"name": "Premium Widget", "price": 600, "gst_rate": 18}'
Response
{ "success": true, "data": { "id": "prod_1a2b3", "name": "Premium Widget", "price": 600, "gst_rate": 18 } }
GET/v1/products

List products

Retrieves a catalog of your available products along with their stock levels.

curl -X GET https://api.vylot.workers.dev/v1/products -H "Authorization: Bearer vk_live_abc123..."
Response
{ "success": true, "data": [ { "id": "prod_1a2b3", "name": "Premium Widget", "stock_qty": 42 } ] }
GET/v1/products/:id

Retrieve a product

Retrieves the details of an existing product.

curl -X GET https://api.vylot.workers.dev/v1/products/prod_1a2b3 -H "Authorization: Bearer vk_live_abc123..."
Response
{ "success": true, "data": { "id": "prod_1a2b3", "name": "Premium Widget" } }
PATCH/v1/products/:id

Update a product

Updates the specified product by setting the values of the parameters passed.

Parameters

namestring
The product's name.
pricenumber
The base unit price.
gst_ratenumber
Total aggregate GST percentage (e.g. 5, 12, 18, 28).
curl -X PATCH https://api.vylot.workers.dev/v1/products/prod_1a2b3 -H "Authorization: Bearer vk_live_abc123..." -H "Content-Type: application/json" -d '{"price": 650}'
Response
{ "success": true }
DELETE/v1/products/:id

Delete a product

Permanently deletes a product from your catalog.

curl -X DELETE https://api.vylot.workers.dev/v1/products/prod_1a2b3 -H "Authorization: Bearer vk_live_abc123..."
Response
{ "success": true }