curl --request POST \
--url https://services.leadconnectorhq.com/products \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Version: <version>' \
--data '
{
"name": "Awesome Product",
"locationId": "3SwdhCsvxI8Au3KsPJt6",
"productType": "DIGITAL",
"description": "Product description goes here.",
"image": "https://storage.googleapis.com/ghl-test/3SwdhCsvxI8Au3KsPJt6/media/65af8d5df88bdb4b1022ee90.png",
"statementDescriptor": "abcde",
"availableInStore": true,
"medias": [
{
"id": "fzrgusiuu0m",
"url": "https://storage.googleapis.com/ghl-test/3SwdhCsvxI8Au3KsPJt6/media/sample.png",
"type": "image",
"title": "1dd7dcd0-e71d-4cf7-a06b-6d47723d6a29.png",
"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
}
'{
"_id": "655b33a82209e60b6adb87a5",
"locationId": "3SwdhCsvxI8Au3KsPJt6",
"name": "Awesome Product",
"productType": "PHYSICAL",
"createdAt": "2023-11-20T10:23:36.515Z",
"updatedAt": "2024-01-23T09:57:04.846Z",
"description": "This is a really awesome product",
"variants": [
{
"id": "38s63qmxfr4",
"name": "Size",
"options": [
{
"id": "h4z7u0im2q8",
"name": "XL"
}
]
}
],
"availableInStore": true,
"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"
}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.
curl --request POST \
--url https://services.leadconnectorhq.com/products \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Version: <version>' \
--data '
{
"name": "Awesome Product",
"locationId": "3SwdhCsvxI8Au3KsPJt6",
"productType": "DIGITAL",
"description": "Product description goes here.",
"image": "https://storage.googleapis.com/ghl-test/3SwdhCsvxI8Au3KsPJt6/media/65af8d5df88bdb4b1022ee90.png",
"statementDescriptor": "abcde",
"availableInStore": true,
"medias": [
{
"id": "fzrgusiuu0m",
"url": "https://storage.googleapis.com/ghl-test/3SwdhCsvxI8Au3KsPJt6/media/sample.png",
"type": "image",
"title": "1dd7dcd0-e71d-4cf7-a06b-6d47723d6a29.png",
"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
}
'{
"_id": "655b33a82209e60b6adb87a5",
"locationId": "3SwdhCsvxI8Au3KsPJt6",
"name": "Awesome Product",
"productType": "PHYSICAL",
"createdAt": "2023-11-20T10:23:36.515Z",
"updatedAt": "2024-01-23T09:57:04.846Z",
"description": "This is a really awesome product",
"variants": [
{
"id": "38s63qmxfr4",
"name": "Size",
"options": [
{
"id": "h4z7u0im2q8",
"name": "XL"
}
]
}
],
"availableInStore": true,
"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"
}Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.
API Version
2021-07-28 The name of the product.
"Awesome Product"
The unique identifier for the location.
"3SwdhCsvxI8Au3KsPJt6"
DIGITAL, PHYSICAL, SERVICE, PHYSICAL/DIGITAL A brief description of the product.
"Product description goes here."
The URL for the product image.
"https://storage.googleapis.com/ghl-test/3SwdhCsvxI8Au3KsPJt6/media/65af8d5df88bdb4b1022ee90.png"
The statement descriptor for the product.
"abcde"
Indicates whether the product is available in-store.
true
An array of medias for the product.
Show child attributes
An array of variants for the product.
Show child attributes
An array of category Ids for the product
[
"65d71377c326ea78e1c47df5",
"65d71377c326ea78e1c47d34"
]Are there any taxes attached to the product. If this is true, taxes array cannot be empty.
true
List of ids of Taxes attached to the Product. If taxes are passed, isTaxesEnabled should be true.
["654492a4e6bef380114de15a"]Tax category ID for Automatic taxes calculation.
"65d71377c326ea78e1c47df5"
Is the product label enabled. If this is true, label object cannot be empty.
true
Show child attributes
The slug using which the product navigation will be handled
"awesome-product"
Show child attributes
Whether the taxes should be included in the purchase price
true
Successful response
The unique identifier for the product.
"655b33a82209e60b6adb87a5"
The unique identifier for the location.
"3SwdhCsvxI8Au3KsPJt6"
The name of the product.
"Awesome Product"
The type of the product (e.g., PHYSICAL).
"PHYSICAL"
The creation timestamp of the product.
"2023-11-20T10:23:36.515Z"
The last update timestamp of the product.
"2024-01-23T09:57:04.846Z"
product description
"This is a really awesome product"
An array of variants for the product.
Show child attributes
Indicates whether the product is available in-store.
true
The statement descriptor for the product.
"abcde"
The URL for the product image.
"https://storage.googleapis.com/ghl-test/3SwdhCsvxI8Au3KsPJt6/media/65af8d5df88bdb4b1022ee90.png"
An array of category Ids for the product
[
"65d71377c326ea78e1c47df5",
"65d71377c326ea78e1c47d34"
]The field indicates whether taxes are enabled for the product or not.
true
An 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.
["654492a4e6bef380114de15a"]Tax category ID for Automatic taxes calculation.
"65d71377c326ea78e1c47df5"
Show child attributes
The slug of the product by which the product will be navigated
"washing-machine"
Was this page helpful?