Product
Endpoints for managing products and their stock quantities in the system.# Endpoints
GET/products# Retrieve a list of all products with stock quantities.GET/product/{barcode}/product-groups# Retrieve the product groups associated with a specific product by barcode.POST/product# Create a new product.PUT/product-group/{product_group_id}/product/{barcode}/qty# Update the quantity of a product in a product group.PUT/product/{barcode}/data# Update the product data such as weight and dimensions.DELETE/product-group/{product_group_id}/product/{barcode}# Delete a product from a product group.POST/products# Upload products in bulk (incremental or override mode).POST/products/export# Export the list of products to CSV format.
Product
barcodeThe unique barcode of the product.
skuThe stock keeping unit (SKU) of the product.
group_idThe ID of the product group the product belongs to.
qtyThe current stock quantity of the product.
dataOptional product data such as weight and dimensions.
1{
2 "barcode": "11111111100",
3 "sku": "1",
4 "group_id": "clzb5u7xy0005qif6i7sj20dt",
5 "qty": 7,
6 "data": {
7 "weight": 10,
8 "dimensions": "1000x2000x2000"
9 }
10}
get
Get List of Products
Retrieve a list of all products with stock quantities.
curl -X GET "https://api.omnilabs.sh/products" -H "Authorization: Bearer {{BEARER_TOKEN}}"
{
"data": [
{
"barcode": "11111111100",
"sku": "1",
"group_id": "clzb5u7xy0005qif6i7sj20dt",
"qty": 7,
"data": null
},
{
"barcode": "1231231231231",
"sku": "123",
"group_id": "clymtb8gi0002maj3rj9o1ewh",
"qty": 100,
"data": {
"weight": 10,
"dimensions": "1000x2000x2000"
}
}
],
"total": 8,
"take": 10,
"current_page": 1,
"last_page": 1
}
get
Get Product Groups for a Product
Retrieve the product groups associated with a specific product by barcode.
curl -X GET "https://api.omnilabs.sh/product/11111111100/product-groups" -H "Authorization: Bearer {{BEARER_TOKEN}}"
Parameters
barcodestringrequired
The barcode of the product.
[
{
"id": "clzb5u7xy0005qif6i7sj20dt",
"name": "Group Berlin"
}
]
post
Create a Product
Create a new product with its SKU, barcode, quantity, and associated product group.
curl -X POST "https://api.omnilabs.sh/product" -H "Authorization: Bearer {{BEARER_TOKEN}}" -H "Content-Type: application/json" -d '{"sku": "1", "barcode": "11111111100", "qty": 100, "group_id": "clymtb8gi0002maj3rj9o1ewh"}'
Parameters
skustringrequired
The SKU of the product.
barcodestringrequired
The barcode of the product.
qtynumberrequired
The quantity of the product in stock.
group_idstringrequired
The ID of the product group the product belongs to.
put
Update Product Quantity
Update the quantity of a product within a specific product group.
curl -X PUT "https://api.omnilabs.sh/product-group/clyil2xza0002mcuf8wfzfzt1/product/11111111111/qty" -H "Authorization: Bearer {{BEARER_TOKEN}}" -H "Content-Type: application/json" -d '{"qty": 110}'
Parameters
qtynumberrequired
The new quantity of the product.
put
Update Product Data
Update the product data such as weight and dimensions.
curl -X PUT "https://api.omnilabs.sh/product/11111111100/data" -H "Authorization: Bearer {{BEARER_TOKEN}}" -H "Content-Type: application/json" -d '{"weight": 10, "dimensions": "1000x2000x2000"}'
Parameters
weightnumberrequired
The weight of the product.
dimensionsstringrequired
The dimensions of the product (LxWxH).
delete
Delete a Product from a Product Group
Delete a product from a specific product group.
curl -X DELETE "https://api.omnilabs.sh/product-group/clyil2xza0002mcuf8wfzfzt1/product/11111111111" -H "Authorization: Bearer {{BEARER_TOKEN}}"
Parameters
product_group_idstringrequired
The ID of the product group.
barcodestringrequired
The barcode of the product to delete.
post
Upload Products in Bulk
Upload multiple products in bulk using either incremental or override mode.
curl -X POST "https://api.omnilabs.sh/products" -H "Authorization: Bearer {{BEARER_TOKEN}}" -H "Content-Type: application/json" -d '{"mode": "incremental", "file": "Base64 encoded string"}'
Parameters
modestringrequired
The mode of the upload (incremental or override).
filestringrequired
The Base64 encoded string of the CSV file.
post
Export Products to CSV
Export the list of products to CSV format.
curl -X POST "https://api.omnilabs.sh/products/export" -H "Authorization: Bearer {{BEARER_TOKEN}}"
"SKU,Barcode,Quantity,Stock Group\n1,11111111100,7,Test 1\n124,1231231231232,100,Default\n7,456456456456,10,Default\n5,5345345345345,10,Default"