Get specific variant

Retrieve a specific variant by product ID and variant ID.

GET /api/v1/products/{productId}/variants/{variantId}

Headers:
  Authorization: Bearer <api-key>
  Content-Type: application/json

Path parameters

ParameterTypeDescription
productIdstringRequired - The Shopify product REST ID
variantIdstringRequired - The Shopify variant REST ID

Response example (200 success)

{
  "success": true,
  "data": {
    "variant": {
      "id": "456",
      "unitMeasurement": {
        "unit": "kg",
        "value": 1
      },
      "settings": {
        "onlineStore": {
          "displayStyle": "number",
          "rules": {
            "min": 0.5,
            "increment": 0.5,
            "defaultValue": 1,
            "max": null
          }
        }
      },
      "product": {
        "id": "123",
        "measurementType": "weight"
      }
    }
  }
}

Response fields

FieldTypeDescription
successbooleanIndicates whether the request was successful
dataobjectResponse data object
data.variantVariantThe variant object

Error responses

Status codeDescription
400Bad Request - Missing product ID or variant ID
401Unauthorized - Missing or invalid API key
404Not Found - Variant not found, or variant doesn't belong to the specified product
500Internal Server Error - Server error while processing the request

Note

The variant must belong to the specified product, otherwise a 404 error will be returned. The response includes the parent product's ID and measurement type.

Related:

See the Variant object and Product object documentation for response structure details.