Update product variants in batch
Update up to 100 existing variants in place by id — title, inventory, stock tracking and prices.
Update up to 100 existing variants in place by id — title, inventory, stock tracking and prices. Variants omitted from the request are left untouched. Prices replace the variant's existing prices in full. Returns the updated variants.
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 whose variants are being updated.
prod_01J8Z5F8W9K8M4A7B3C2D1E0FGBody
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}/variants/batch
PATCH /api/ecommerce/v1/stores/{store_id}/products/{product_id}/variants/batch HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 195
{
"variants": [
{
"variant_id": "variant_01J8Z5F8W9K8M4A7B3C2D1E0FG",
"title": "Red / L",
"inventory_quantity": 42,
"manage_inventory": true,
"prices": [
{
"amount": 1999,
"sale_amount": 1499,
"currency": "usd"
}
]
}
]
}{
"data": [
{
"id": "variant_01J8Z5F8W9K8M4A7B3C2D1E0FG",
"title": "Red / M",
"sku": "TSHIRT-RED-M",
"options": [
{
"name": "Size",
"value": "M"
}
],
"prices": [
{
"amount": 1999,
"sale_amount": null,
"currency_code": "usd"
}
],
"inventory_quantity": 42,
"manage_inventory": true
}
]
}Last updated
Was this helpful?