Create Product
POST/products/
The "Create Product" API allows adding a new product to the system. Use this endpoint to create a product with the specified details. Ensure that the required information is provided in the request payload.
Request
API Version
v3- application/json
- Body
- Example (auto)
Bodyrequired
The name of the product.
The unique identifier for the location.
A brief description of the product.
DIGITALPHYSICALSERVICEPHYSICAL/DIGITALThe URL for the product image.
The statement descriptor for the product.
Indicates whether the product is available in-store.
An array of medias for the product.
An array of variants for the product.
An array of category Ids for the product
Are there any taxes attached to the product. If this is true, taxes array cannot be empty.
falseList of ids of Taxes attached to the Product. If taxes are passed, isTaxesEnabled should be true.
Tax category ID for Automatic taxes calculation.
Is the product label enabled. If this is true, label object cannot be empty.
falseDetails for Product Label
The slug using which the product navigation will be handled
SEO data for the product that will be displayed in the preview
Whether the taxes should be included in the purchase price
false{
"name": "Awesome Product",
"locationId": "3SwdhCsvxI8Au3KsPJt6",
"description": "Product description goes here.",
"productType": "DIGITAL",
"image": "https://storage.googleapis.com/ghl-test/3SwdhCsvxI8Au3KsPJt6/media/65af8d5df88bdb4b1022ee90.png",
"statementDescriptor": "abcde",
"availableInStore": true,
"medias": [
{
"id": "fzrgusiuu0m",
"title": "1dd7dcd0-e71d-4cf7-a06b-6d47723d6a29.png",
"url": "https://storage.googleapis.com/ghl-test/3SwdhCsvxI8Au3KsPJt6/media/sample.png",
"type": "image",
"isFeatured": true,
"priceIds": "6578278e879ad2646715ba9c"
}
],
"variants": [
{
"id": "38s63qmxfr4",
"name": "Size",
"options": [
{
"id": "h4z7u0im2q8",
"name": "XL"
}
]
}
],
"collectionIds": [
"65d71377c326ea78e1c47df5",
"65d71377c326ea78e1c47d34"
],
"isTaxesEnabled": true,
"taxes": [
"654492a4e6bef380114de15a"
],
"automaticTaxCategoryId": "65d71377c326ea78e1c47df5",
"isLabelEnabled": true,
"label": {
"title": "Featured",
"startDate": "2024-06-26T05:43:35.000Z",
"endDate": "2024-06-30T05:43:39.000Z"
},
"slug": "awesome-product",
"seo": {
"title": "Best Product - Buy Now",
"description": "This is the best product you can buy online with amazing features and great value"
},
"taxInclusive": true
}
Successful response
- application/json
- Schema
- Example (auto)
Schema
The unique identifier for the product.
product description
An array of variants for the product.
The unique identifier for the location.
The name of the product.
The type of the product (e.g., PHYSICAL).
Indicates whether the product is available in-store.
The creation timestamp of the product.
The last update timestamp of the product.
The statement descriptor for the product.
The URL for the product image.
An array of category Ids for the product
The field indicates whether taxes are enabled for the product or not.
falseAn array of ids of Taxes attached to the Product. If the expand query includes tax, the taxes will be of type ProductTaxDto. Please refer to the ProductTaxDto for additional details.
Tax category ID for Automatic taxes calculation.
The Product label details
The slug of the product by which the product will be navigated
{
"_id": "655b33a82209e60b6adb87a5",
"description": "This is a really awesome product",
"variants": [
{
"id": "38s63qmxfr4",
"name": "Size",
"options": [
{
"id": "h4z7u0im2q8",
"name": "XL"
}
]
}
],
"locationId": "3SwdhCsvxI8Au3KsPJt6",
"name": "Awesome Product",
"productType": "PHYSICAL",
"availableInStore": true,
"createdAt": "2023-11-20T10:23:36.515Z",
"updatedAt": "2024-01-23T09:57:04.846Z",
"statementDescriptor": "abcde",
"image": "https://storage.googleapis.com/ghl-test/3SwdhCsvxI8Au3KsPJt6/media/65af8d5df88bdb4b1022ee90.png",
"collectionIds": [
"65d71377c326ea78e1c47df5",
"65d71377c326ea78e1c47d34"
],
"isTaxesEnabled": true,
"taxes": [
"654492a4e6bef380114de15a"
],
"automaticTaxCategoryId": "65d71377c326ea78e1c47df5",
"label": {
"title": "Featured",
"startDate": "2024-06-26T05:43:35.000Z",
"endDate": "2024-06-30T05:43:39.000Z"
},
"slug": "washing-machine"
}