curl --location --request DELETE 'https://api.stateset.com/v1/products/prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30' \
--header 'Authorization: Bearer YOUR_API_KEY'
mutation DeleteProduct($id: ID!) {
deleteProduct(id: $id) {
id
deleted
}
}
const result = await stateset.products.delete(
'prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
);
result = stateset.products.delete(
'prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
)
{
"id": "prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"object": "product",
"deleted": true
}
Delete Product
Delete a product from the catalog
DELETE
/
v1
/
products
/
:id
curl --location --request DELETE 'https://api.stateset.com/v1/products/prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30' \
--header 'Authorization: Bearer YOUR_API_KEY'
mutation DeleteProduct($id: ID!) {
deleteProduct(id: $id) {
id
deleted
}
}
const result = await stateset.products.delete(
'prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
);
result = stateset.products.delete(
'prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
)
{
"id": "prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"object": "product",
"deleted": true
}
Deleting a product is irreversible. Products with existing orders cannot be deleted and must be archived instead.
Path Parameters
string
required
The unique identifier of the product to delete
Response
string
The ID of the deleted product
string
Always “product”
boolean
Always true for successful deletion
curl --location --request DELETE 'https://api.stateset.com/v1/products/prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30' \
--header 'Authorization: Bearer YOUR_API_KEY'
mutation DeleteProduct($id: ID!) {
deleteProduct(id: $id) {
id
deleted
}
}
const result = await stateset.products.delete(
'prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
);
result = stateset.products.delete(
'prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30'
)
{
"id": "prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"object": "product",
"deleted": true
}
Error Responses
object
{
"error": {
"type": "product_has_orders",
"message": "Cannot delete product with existing orders. Archive the product instead.",
"code": "PRODUCT_HAS_ORDERS"
}
}
⌘I