Update a product
Update a product's name, description or status.
Update a product's name, description or status. Set status to published to make it buyable, draft to hide it, or archived to retire it. Variants, prices and inventory are managed through the variant endpoints, not here. Returns the updated product summary.
Authorizations
AuthorizationstringRequired
API Token authentication
Path parameters
store_idstringRequiredExample:
The ID of the store that owns the product.
store_01J8Z5F8W9K8M4A7B3C2D1E0FGproduct_idstringRequiredExample:
The ID of the product to update.
prod_01J8Z5F8W9K8M4A7B3C2D1E0FGBody
namestring · max: 255OptionalExample:
The product name.
Blue T-Shirtdescriptionstring · max: 5000OptionalExample:
The product description.
Soft combed cotton, unisex fit.statusstring · enumOptionalExample:
Set "published" to make the product buyable, "draft" to hide it, or "archived" to retire it.
publishedPossible values: Responses
200
Success response
application/json
401
Unauthenticated response
application/json
422
Validation error response
application/json
500
Error response
application/json
patch/api/ecommerce/v1/stores/{store_id}/products/{product_id}
PATCH /api/ecommerce/v1/stores/{store_id}/products/{product_id} HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 92
{
"name": "Blue T-Shirt",
"description": "Soft combed cotton, unisex fit.",
"status": "published"
}{
"data": {
"id": "prod_01J8Z5F8W9K8M4A7B3C2D1E0FG",
"title": "Blue T-Shirt",
"status": "published",
"thumbnail": "https://cdn.example.com/prod/thumb.jpg",
"type": "physical",
"variant_count": 3,
"price_range": {
"min": 1999,
"max": 2499,
"currency_code": "usd"
},
"variants": [
{
"id": "variant_01J8Z5F8W9K8M4A7B3C2D1E0FG",
"title": "Medium",
"sku": "TSHIRT-BLU-M",
"options": [
{
"name": "Size",
"value": "M"
}
],
"prices": [
{
"amount": 1999,
"sale_amount": null,
"currency_code": "usd"
}
],
"inventory_quantity": 42,
"manage_inventory": true
}
],
"media": [
{
"url": "https://cdn.example.com/prod/1.jpg",
"type": "image",
"is_thumbnail": true
}
]
}
}Last updated
Was this helpful?