List product variants
List a product's variants, ordered by rank, with their options, prices and inventory. Prices are integers in the smallest currency unit and live on variants.
List a product's variants, ordered by rank, with their options, prices and inventory. Prices are integers in the smallest currency unit and live on 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 to list variants for.
prod_01J8Z5F8W9K8M4A7B3C2D1E0FGQuery parameters
pageintegerOptionalExample:
Page number
1Responses
200
Success response
application/json
401
Unauthenticated response
application/json
500
Error response
application/json
get/api/ecommerce/v1/stores/{store_id}/products/{product_id}/variants
GET /api/ecommerce/v1/stores/{store_id}/products/{product_id}/variants HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"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
}
],
"meta": {
"current_page": 1,
"per_page": 15,
"total": 100
}
}Last updated
Was this helpful?