For the complete documentation index, see llms.txt. This page is also available as Markdown.

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 product variants

get

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_idstringRequired

The ID of the store that owns the product.

Example: store_01J8Z5F8W9K8M4A7B3C2D1E0FG
product_idstringRequired

The ID of the product to list variants for.

Example: prod_01J8Z5F8W9K8M4A7B3C2D1E0FG
Query parameters
pageintegerOptional

Page number

Example: 1
Responses
200

Success 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?