Product Variant
Important
Apps can no longer set inventory using inventory_quantity
or inventory_quantity_adjustment
. For more information, see Updating inventory.
What you can do with Product Variant
The Shopify API lets you do the following with the Product Variant resource. More detailed versions of these general actions may be available:
- GET /admin/api/2019-10/products/{product_id}/variants.json Retrieves a list of product variants
- GET /admin/api/2019-10/products/{product_id}/variants/count.json Receive a count of all Product Variants
- GET /admin/api/2019-10/variants/{variant_id}.json Receive a single Product Variant
- POST /admin/api/2019-10/products/{product_id}/variants.json Create a new Product Variant
- PUT /admin/api/2019-10/variants/{variant_id}.json Modify an existing Product Variant
- DELETE /admin/api/2019-10/products/{product_id}/variants/{variant_id}.json Remove an existing Product Variant
Product Variant properties
barcode |
The barcode, UPC, or ISBN number for the product. |
compare_at_price |
The original price of the item before an adjustment or a sale. |
created_at |
The date and time (ISO 8601 format) when the product variant was created. |
fulfillment_service |
The fulfillment service associated with the product variant. Valid values: |
grams |
The weight of the product variant in grams. |
id |
The unique numeric identifier for the product variant. |
image_id |
The unique numeric identifier for a product's image. The image must be associated to the same product as the variant. |
inventory_item_id |
The unique identifier for the inventory item, which is used in the Inventory API to query for inventory information. |
inventory_management |
The fulfillment service that tracks the number of items in stock for the product variant. Valid values:
|
inventory_policy |
Whether customers are allowed to place an order for the product variant when it's out of stock. Valid values:
deny .
|
inventory_quantity
read-only |
An aggregate of inventory across all locations. To adjust inventory at a specific location, use the InventoryLevel resource. |
old_inventory_quantity
deprecated |
This property is deprecated. Use the InventoryLevel resource instead. |
inventory_quantity_adjustment
deprecated |
This property is deprecated. Use the InventoryLevel resource instead. |
option |
The custom properties that a shop owner uses to define product variants.
You can define three options for a product variant: |
presentment_prices
read-only |
A list of the variant's presentment prices and compare-at prices in each of the shop's enabled presentment currencies. Each price object has the following properties:
'X-Shopify-Api-Features': 'include-presentment-prices' .
|
position
read-only |
The order of the product variant in the list of product variants.
The first position in the list is |
price |
The price of the product variant. |
product_id |
The unique numeric identifier for the product. |
requires_shipping
deprecated |
Whether a customer needs to provide a shipping address when placing an order for the product variant. |
sku |
A unique identifier for the product variant in the shop. Required in order to connect to a FulfillmentService. |
taxable |
Whether a tax is charged when the product variant is sold. |
tax_code |
This parameter applies only to the stores that have the Avalara AvaTax app installed. Specifies the Avalara tax code for the product variant. |
title
read-only |
The title of the product variant. The |
updated_at |
The date and time when the product variant was last modified. Gets returned in ISO 8601 format. |
weight |
The weight of the product variant in the unit system specified with |
weight_unit |
The unit of measurement that applies to the product variant's weight.
If you don't specify a value for |
Endpoints
page
parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints.
limit
|
Return up to this many results per page (default:50 , maximum: 250 )
|
presentment_currencies
|
Return presentment prices in only certain currencies, specified by a comma-separated list of ISO 4217 currency codes. |
since_id
|
Restrict results to after the specified ID |
fields
|
A comma-separated list of fields to include in the response |
Retrieve all variants for a product
GET /admin/api/2019-10/products/632910392/variants.json
View Response
HTTP/1.1 200 OK
{
"variants": [
{
"id": 39072856,
"product_id": 632910392,
"title": "Green",
"price": "199.00",
"sku": "IPOD2008GREEN",
"position": 3,
"inventory_policy": "continue",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Green",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_green",
"grams": 567,
"image_id": null,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 39072856,
"inventory_quantity": 30,
"old_inventory_quantity": 30,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"
},
{
"id": 49148385,
"product_id": 632910392,
"title": "Red",
"price": "199.00",
"sku": "IPOD2008RED",
"position": 2,
"inventory_policy": "continue",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Red",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_red",
"grams": 567,
"image_id": null,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 49148385,
"inventory_quantity": 20,
"old_inventory_quantity": 20,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"
},
{
"id": 457924702,
"product_id": 632910392,
"title": "Black",
"price": "199.00",
"sku": "IPOD2008BLACK",
"position": 4,
"inventory_policy": "continue",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Black",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_black",
"grams": 567,
"image_id": null,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 457924702,
"inventory_quantity": 40,
"old_inventory_quantity": 40,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"
},
{
"id": 808950810,
"product_id": 632910392,
"title": "Pink",
"price": "199.00",
"sku": "IPOD2008PINK",
"position": 1,
"inventory_policy": "continue",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Pink",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_pink",
"grams": 567,
"image_id": 562641783,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 808950810,
"inventory_quantity": 10,
"old_inventory_quantity": 10,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"
}
]
}
Retrieve all variants for a product after a specified ID
GET /admin/api/2019-10/products/632910392/variants.json?since_id=49148385
View Response
HTTP/1.1 200 OK
{
"variants": [
{
"id": 457924702,
"product_id": 632910392,
"title": "Black",
"price": "199.00",
"sku": "IPOD2008BLACK",
"position": 4,
"inventory_policy": "continue",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Black",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_black",
"grams": 567,
"image_id": null,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 457924702,
"inventory_quantity": 40,
"old_inventory_quantity": 40,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"
},
{
"id": 808950810,
"product_id": 632910392,
"title": "Pink",
"price": "199.00",
"sku": "IPOD2008PINK",
"position": 1,
"inventory_policy": "continue",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Pink",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_pink",
"grams": 567,
"image_id": 562641783,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 808950810,
"inventory_quantity": 10,
"old_inventory_quantity": 10,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"
}
]
}
Retrieve all variants for a product with prices in specified presentment currencies
GET /admin/api/2019-10/products/632910392/variants.json?presentment_currencies=USD,CAD
View Response
HTTP/1.1 200 OK
{
"variants": [
{
"id": 39072856,
"product_id": 632910392,
"title": "Green",
"price": "199.00",
"sku": "IPOD2008GREEN",
"position": 3,
"inventory_policy": "continue",
"compare_at_price": "249.00",
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Green",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_green",
"grams": 567,
"image_id": null,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 39072856,
"inventory_quantity": 30,
"old_inventory_quantity": 30,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": {
"amount": "249.00",
"currency_code": "USD"
}
},
{
"price": {
"amount": "249.00",
"currency_code": "CAD"
},
"compare_at_price": {
"amount": "312.00",
"currency_code": "CAD"
}
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"
},
{
"id": 49148385,
"product_id": 632910392,
"title": "Red",
"price": "199.00",
"sku": "IPOD2008RED",
"position": 2,
"inventory_policy": "continue",
"compare_at_price": "249.00",
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Red",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_red",
"grams": 567,
"image_id": null,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 49148385,
"inventory_quantity": 20,
"old_inventory_quantity": 20,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": {
"amount": "249.00",
"currency_code": "USD"
}
},
{
"price": {
"amount": "249.00",
"currency_code": "CAD"
},
"compare_at_price": {
"amount": "312.00",
"currency_code": "CAD"
}
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"
},
{
"id": 457924702,
"product_id": 632910392,
"title": "Black",
"price": "199.00",
"sku": "IPOD2008BLACK",
"position": 4,
"inventory_policy": "continue",
"compare_at_price": "249.00",
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Black",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_black",
"grams": 567,
"image_id": null,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 457924702,
"inventory_quantity": 40,
"old_inventory_quantity": 40,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": {
"amount": "249.00",
"currency_code": "USD"
}
},
{
"price": {
"amount": "249.00",
"currency_code": "CAD"
},
"compare_at_price": {
"amount": "312.00",
"currency_code": "CAD"
}
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"
},
{
"id": 808950810,
"product_id": 632910392,
"title": "Pink",
"price": "199.00",
"sku": "IPOD2008PINK",
"position": 1,
"inventory_policy": "continue",
"compare_at_price": "249.00",
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Pink",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_pink",
"grams": 567,
"image_id": 562641783,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 808950810,
"inventory_quantity": 10,
"old_inventory_quantity": 10,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": {
"amount": "249.00",
"currency_code": "USD"
}
},
{
"price": {
"amount": "249.00",
"currency_code": "CAD"
},
"compare_at_price": {
"amount": "312.00",
"currency_code": "CAD"
}
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"
}
]
}
Retrieve a count all variants for a product
GET /admin/api/2019-10/products/632910392/variants/count.json
View Response
HTTP/1.1 200 OK
{
"count": 4
}
fields
|
A comma-separated list of fields to include in the response |
Retrieve a product variant by ID
GET /admin/api/2019-10/variants/808950810.json
View Response
HTTP/1.1 200 OK
{
"variant": {
"id": 808950810,
"product_id": 632910392,
"title": "Pink",
"price": "199.00",
"sku": "IPOD2008PINK",
"position": 1,
"inventory_policy": "continue",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Pink",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_pink",
"grams": 567,
"image_id": 562641783,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 808950810,
"inventory_quantity": 10,
"old_inventory_quantity": 10,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"tax_code": "DA040000",
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"
}
}
Create a new product variant
POST /admin/api/2019-10/products/632910392/variants.json
{
"variant": {
"option1": "Yellow",
"price": "1.00"
}
}
View Response
HTTP/1.1 201 Created
{
"variant": {
"id": 1070325019,
"product_id": 632910392,
"title": "Yellow",
"price": "1.00",
"sku": "",
"position": 5,
"inventory_policy": "deny",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Yellow",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:35:46-04:00",
"updated_at": "2021-04-01T14:35:46-04:00",
"taxable": true,
"barcode": null,
"grams": 0,
"image_id": null,
"weight": 0.0,
"weight_unit": "lb",
"inventory_item_id": 1070325019,
"inventory_quantity": 0,
"old_inventory_quantity": 0,
"presentment_prices": [
{
"price": {
"amount": "1.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/1070325019"
}
}
Create a new product variant with a metafield
POST /admin/api/2019-10/products/632910392/variants.json
{
"variant": {
"option1": "Blue",
"metafields": [
{
"key": "new",
"value": "newvalue",
"value_type": "string",
"namespace": "global"
}
]
}
}
View Response
HTTP/1.1 201 Created
{
"variant": {
"id": 1070325020,
"product_id": 632910392,
"title": "Blue",
"price": "0.00",
"sku": "",
"position": 5,
"inventory_policy": "deny",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Blue",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:35:48-04:00",
"updated_at": "2021-04-01T14:35:49-04:00",
"taxable": true,
"barcode": null,
"grams": 0,
"image_id": null,
"weight": 0.0,
"weight_unit": "lb",
"inventory_item_id": 1070325020,
"inventory_quantity": 0,
"old_inventory_quantity": 0,
"presentment_prices": [
{
"price": {
"amount": "0.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/1070325020"
}
}
Create a new product variant with an image
POST /admin/api/2019-10/products/632910392/variants.json
{
"variant": {
"image_id": 850703190,
"option1": "Purple"
}
}
View Response
HTTP/1.1 201 Created
{
"variant": {
"id": 1070325021,
"product_id": 632910392,
"title": "Purple",
"price": "0.00",
"sku": "",
"position": 5,
"inventory_policy": "deny",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Purple",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:35:51-04:00",
"updated_at": "2021-04-01T14:35:51-04:00",
"taxable": true,
"barcode": null,
"grams": 0,
"image_id": 850703190,
"weight": 0.0,
"weight_unit": "lb",
"inventory_item_id": 1070325021,
"inventory_quantity": 0,
"old_inventory_quantity": 0,
"presentment_prices": [
{
"price": {
"amount": "0.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/1070325021"
}
}
Update the title and price of an existing variant
PUT /admin/api/2019-10/variants/808950810.json
{
"variant": {
"id": 808950810,
"option1": "Not Pink",
"price": "99.00"
}
}
View Response
HTTP/1.1 200 OK
{
"variant": {
"id": 808950810,
"product_id": 632910392,
"title": "Not Pink",
"price": "99.00",
"sku": "IPOD2008PINK",
"position": 1,
"inventory_policy": "continue",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Not Pink",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:35:53-04:00",
"taxable": true,
"barcode": "1234_pink",
"grams": 567,
"image_id": 562641783,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 808950810,
"inventory_quantity": 10,
"old_inventory_quantity": 10,
"presentment_prices": [
{
"price": {
"amount": "99.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"
}
}
Add a metafield to an existing variant
PUT /admin/api/2019-10/variants/808950810.json
{
"variant": {
"id": 808950810,
"metafields": [
{
"key": "new",
"value": "newvalue",
"value_type": "string",
"namespace": "global"
}
]
}
}
View Response
HTTP/1.1 200 OK
{
"variant": {
"id": 808950810,
"product_id": 632910392,
"title": "Pink",
"price": "199.00",
"sku": "IPOD2008PINK",
"position": 1,
"inventory_policy": "continue",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Pink",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:35:55-04:00",
"taxable": true,
"barcode": "1234_pink",
"grams": 567,
"image_id": 562641783,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 808950810,
"inventory_quantity": 10,
"old_inventory_quantity": 10,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"
}
}
Add an existing image to an existing variant
PUT /admin/api/2019-10/variants/808950810.json
{
"variant": {
"id": 808950810,
"image_id": 562641783
}
}
View Response
HTTP/1.1 200 OK
{
"variant": {
"id": 808950810,
"product_id": 632910392,
"title": "Pink",
"price": "199.00",
"sku": "IPOD2008PINK",
"position": 1,
"inventory_policy": "continue",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Pink",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:35:57-04:00",
"taxable": true,
"barcode": "1234_pink",
"grams": 567,
"image_id": 562641783,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 808950810,
"inventory_quantity": 10,
"old_inventory_quantity": 10,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"
}
}
Delete a product variant
DELETE /admin/api/2019-10/products/632910392/variants/808950810.json
View Response
HTTP/1.1 200 OK
{
}
Important
Apps can no longer set inventory using inventory_quantity
or inventory_quantity_adjustment
. For more information, see Updating inventory.
What you can do with Product Variant
The Shopify API lets you do the following with the Product Variant resource. More detailed versions of these general actions may be available:
- GET /admin/api/2020-01/products/{product_id}/variants.json Retrieves a list of product variants
- GET /admin/api/2020-01/products/{product_id}/variants/count.json Receive a count of all Product Variants
- GET /admin/api/2020-01/variants/{variant_id}.json Receive a single Product Variant
- POST /admin/api/2020-01/products/{product_id}/variants.json Create a new Product Variant
- PUT /admin/api/2020-01/variants/{variant_id}.json Modify an existing Product Variant
- DELETE /admin/api/2020-01/products/{product_id}/variants/{variant_id}.json Remove an existing Product Variant
Product Variant properties
barcode |
The barcode, UPC, or ISBN number for the product. |
compare_at_price |
The original price of the item before an adjustment or a sale. |
created_at |
The date and time (ISO 8601 format) when the product variant was created. |
fulfillment_service |
The fulfillment service associated with the product variant. Valid values: |
grams |
The weight of the product variant in grams. |
id |
The unique numeric identifier for the product variant. |
image_id |
The unique numeric identifier for a product's image. The image must be associated to the same product as the variant. |
inventory_item_id |
The unique identifier for the inventory item, which is used in the Inventory API to query for inventory information. |
inventory_management |
The fulfillment service that tracks the number of items in stock for the product variant. Valid values:
|
inventory_policy |
Whether customers are allowed to place an order for the product variant when it's out of stock. Valid values:
deny .
|
inventory_quantity
read-only |
An aggregate of inventory across all locations. To adjust inventory at a specific location, use the InventoryLevel resource. |
old_inventory_quantity
deprecated |
This property is deprecated. Use the InventoryLevel resource instead. |
inventory_quantity_adjustment
deprecated |
This property is deprecated. Use the InventoryLevel resource instead. |
option |
The custom properties that a shop owner uses to define product variants.
You can define three options for a product variant: |
presentment_prices
read-only |
A list of the variant's presentment prices and compare-at prices in each of the shop's enabled presentment currencies. Each price object has the following properties:
'X-Shopify-Api-Features': 'include-presentment-prices' .
|
position
read-only |
The order of the product variant in the list of product variants.
The first position in the list is |
price |
The price of the product variant. |
product_id |
The unique numeric identifier for the product. |
requires_shipping
deprecated |
This property is deprecated. Use the `requires_shipping` property on the InventoryItem resource instead. |
sku |
A unique identifier for the product variant in the shop. Required in order to connect to a FulfillmentService. |
taxable |
Whether a tax is charged when the product variant is sold. |
tax_code |
This parameter applies only to the stores that have the Avalara AvaTax app installed. Specifies the Avalara tax code for the product variant. |
title
read-only |
The title of the product variant. The |
updated_at |
The date and time when the product variant was last modified. Gets returned in ISO 8601 format. |
weight |
The weight of the product variant in the unit system specified with |
weight_unit |
The unit of measurement that applies to the product variant's weight.
If you don't specify a value for |
Endpoints
page
parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints.
limit
|
Return up to this many results per page (default:50 , maximum: 250 )
|
presentment_currencies
|
Return presentment prices in only certain currencies, specified by a comma-separated list of ISO 4217 currency codes. |
since_id
|
Restrict results to after the specified ID |
fields
|
A comma-separated list of fields to include in the response |
Retrieve all variants for a product
GET /admin/api/2020-01/products/632910392/variants.json
View Response
HTTP/1.1 200 OK
{
"variants": [
{
"id": 39072856,
"product_id": 632910392,
"title": "Green",
"price": "199.00",
"sku": "IPOD2008GREEN",
"position": 3,
"inventory_policy": "continue",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Green",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_green",
"grams": 567,
"image_id": null,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 39072856,
"inventory_quantity": 30,
"old_inventory_quantity": 30,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"
},
{
"id": 49148385,
"product_id": 632910392,
"title": "Red",
"price": "199.00",
"sku": "IPOD2008RED",
"position": 2,
"inventory_policy": "continue",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Red",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_red",
"grams": 567,
"image_id": null,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 49148385,
"inventory_quantity": 20,
"old_inventory_quantity": 20,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"
},
{
"id": 457924702,
"product_id": 632910392,
"title": "Black",
"price": "199.00",
"sku": "IPOD2008BLACK",
"position": 4,
"inventory_policy": "continue",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Black",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_black",
"grams": 567,
"image_id": null,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 457924702,
"inventory_quantity": 40,
"old_inventory_quantity": 40,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"
},
{
"id": 808950810,
"product_id": 632910392,
"title": "Pink",
"price": "199.00",
"sku": "IPOD2008PINK",
"position": 1,
"inventory_policy": "continue",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Pink",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_pink",
"grams": 567,
"image_id": 562641783,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 808950810,
"inventory_quantity": 10,
"old_inventory_quantity": 10,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"
}
]
}
Retrieve all variants for a product after a specified ID
GET /admin/api/2020-01/products/632910392/variants.json?since_id=49148385
View Response
HTTP/1.1 200 OK
{
"variants": [
{
"id": 457924702,
"product_id": 632910392,
"title": "Black",
"price": "199.00",
"sku": "IPOD2008BLACK",
"position": 4,
"inventory_policy": "continue",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Black",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_black",
"grams": 567,
"image_id": null,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 457924702,
"inventory_quantity": 40,
"old_inventory_quantity": 40,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"
},
{
"id": 808950810,
"product_id": 632910392,
"title": "Pink",
"price": "199.00",
"sku": "IPOD2008PINK",
"position": 1,
"inventory_policy": "continue",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Pink",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_pink",
"grams": 567,
"image_id": 562641783,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 808950810,
"inventory_quantity": 10,
"old_inventory_quantity": 10,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"
}
]
}
Retrieve all variants for a product with prices in specified presentment currencies
GET /admin/api/2020-01/products/632910392/variants.json?presentment_currencies=USD,CAD
View Response
HTTP/1.1 200 OK
{
"variants": [
{
"id": 39072856,
"product_id": 632910392,
"title": "Green",
"price": "199.00",
"sku": "IPOD2008GREEN",
"position": 3,
"inventory_policy": "continue",
"compare_at_price": "249.00",
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Green",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_green",
"grams": 567,
"image_id": null,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 39072856,
"inventory_quantity": 30,
"old_inventory_quantity": 30,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": {
"amount": "249.00",
"currency_code": "USD"
}
},
{
"price": {
"amount": "249.00",
"currency_code": "CAD"
},
"compare_at_price": {
"amount": "312.00",
"currency_code": "CAD"
}
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"
},
{
"id": 49148385,
"product_id": 632910392,
"title": "Red",
"price": "199.00",
"sku": "IPOD2008RED",
"position": 2,
"inventory_policy": "continue",
"compare_at_price": "249.00",
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Red",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_red",
"grams": 567,
"image_id": null,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 49148385,
"inventory_quantity": 20,
"old_inventory_quantity": 20,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": {
"amount": "249.00",
"currency_code": "USD"
}
},
{
"price": {
"amount": "249.00",
"currency_code": "CAD"
},
"compare_at_price": {
"amount": "312.00",
"currency_code": "CAD"
}
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"
},
{
"id": 457924702,
"product_id": 632910392,
"title": "Black",
"price": "199.00",
"sku": "IPOD2008BLACK",
"position": 4,
"inventory_policy": "continue",
"compare_at_price": "249.00",
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Black",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_black",
"grams": 567,
"image_id": null,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 457924702,
"inventory_quantity": 40,
"old_inventory_quantity": 40,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": {
"amount": "249.00",
"currency_code": "USD"
}
},
{
"price": {
"amount": "249.00",
"currency_code": "CAD"
},
"compare_at_price": {
"amount": "312.00",
"currency_code": "CAD"
}
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"
},
{
"id": 808950810,
"product_id": 632910392,
"title": "Pink",
"price": "199.00",
"sku": "IPOD2008PINK",
"position": 1,
"inventory_policy": "continue",
"compare_at_price": "249.00",
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Pink",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_pink",
"grams": 567,
"image_id": 562641783,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 808950810,
"inventory_quantity": 10,
"old_inventory_quantity": 10,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": {
"amount": "249.00",
"currency_code": "USD"
}
},
{
"price": {
"amount": "249.00",
"currency_code": "CAD"
},
"compare_at_price": {
"amount": "312.00",
"currency_code": "CAD"
}
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"
}
]
}
Retrieve a count all variants for a product
GET /admin/api/2020-01/products/632910392/variants/count.json
View Response
HTTP/1.1 200 OK
{
"count": 4
}
fields
|
A comma-separated list of fields to include in the response |
Retrieve a product variant by ID
GET /admin/api/2020-01/variants/808950810.json
View Response
HTTP/1.1 200 OK
{
"variant": {
"id": 808950810,
"product_id": 632910392,
"title": "Pink",
"price": "199.00",
"sku": "IPOD2008PINK",
"position": 1,
"inventory_policy": "continue",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Pink",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_pink",
"grams": 567,
"image_id": 562641783,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 808950810,
"inventory_quantity": 10,
"old_inventory_quantity": 10,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"tax_code": "DA040000",
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"
}
}
Create a new product variant
POST /admin/api/2020-01/products/632910392/variants.json
{
"variant": {
"option1": "Yellow",
"price": "1.00"
}
}
View Response
HTTP/1.1 201 Created
{
"variant": {
"id": 1070325019,
"product_id": 632910392,
"title": "Yellow",
"price": "1.00",
"sku": "",
"position": 5,
"inventory_policy": "deny",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Yellow",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:35:46-04:00",
"updated_at": "2021-04-01T14:35:46-04:00",
"taxable": true,
"barcode": null,
"grams": 0,
"image_id": null,
"weight": 0.0,
"weight_unit": "lb",
"inventory_item_id": 1070325019,
"inventory_quantity": 0,
"old_inventory_quantity": 0,
"presentment_prices": [
{
"price": {
"amount": "1.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/1070325019"
}
}
Create a new product variant with a metafield
POST /admin/api/2020-01/products/632910392/variants.json
{
"variant": {
"option1": "Blue",
"metafields": [
{
"key": "new",
"value": "newvalue",
"value_type": "string",
"namespace": "global"
}
]
}
}
View Response
HTTP/1.1 201 Created
{
"variant": {
"id": 1070325020,
"product_id": 632910392,
"title": "Blue",
"price": "0.00",
"sku": "",
"position": 5,
"inventory_policy": "deny",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Blue",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:35:48-04:00",
"updated_at": "2021-04-01T14:35:49-04:00",
"taxable": true,
"barcode": null,
"grams": 0,
"image_id": null,
"weight": 0.0,
"weight_unit": "lb",
"inventory_item_id": 1070325020,
"inventory_quantity": 0,
"old_inventory_quantity": 0,
"presentment_prices": [
{
"price": {
"amount": "0.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/1070325020"
}
}
Create a new product variant with an image
POST /admin/api/2020-01/products/632910392/variants.json
{
"variant": {
"image_id": 850703190,
"option1": "Purple"
}
}
View Response
HTTP/1.1 201 Created
{
"variant": {
"id": 1070325021,
"product_id": 632910392,
"title": "Purple",
"price": "0.00",
"sku": "",
"position": 5,
"inventory_policy": "deny",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Purple",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:35:51-04:00",
"updated_at": "2021-04-01T14:35:51-04:00",
"taxable": true,
"barcode": null,
"grams": 0,
"image_id": 850703190,
"weight": 0.0,
"weight_unit": "lb",
"inventory_item_id": 1070325021,
"inventory_quantity": 0,
"old_inventory_quantity": 0,
"presentment_prices": [
{
"price": {
"amount": "0.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/1070325021"
}
}
Update the title and price of an existing variant
PUT /admin/api/2020-01/variants/808950810.json
{
"variant": {
"id": 808950810,
"option1": "Not Pink",
"price": "99.00"
}
}
View Response
HTTP/1.1 200 OK
{
"variant": {
"id": 808950810,
"product_id": 632910392,
"title": "Not Pink",
"price": "99.00",
"sku": "IPOD2008PINK",
"position": 1,
"inventory_policy": "continue",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Not Pink",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:35:53-04:00",
"taxable": true,
"barcode": "1234_pink",
"grams": 567,
"image_id": 562641783,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 808950810,
"inventory_quantity": 10,
"old_inventory_quantity": 10,
"presentment_prices": [
{
"price": {
"amount": "99.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"
}
}
Add a metafield to an existing variant
PUT /admin/api/2020-01/variants/808950810.json
{
"variant": {
"id": 808950810,
"metafields": [
{
"key": "new",
"value": "newvalue",
"value_type": "string",
"namespace": "global"
}
]
}
}
View Response
HTTP/1.1 200 OK
{
"variant": {
"id": 808950810,
"product_id": 632910392,
"title": "Pink",
"price": "199.00",
"sku": "IPOD2008PINK",
"position": 1,
"inventory_policy": "continue",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Pink",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:35:55-04:00",
"taxable": true,
"barcode": "1234_pink",
"grams": 567,
"image_id": 562641783,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 808950810,
"inventory_quantity": 10,
"old_inventory_quantity": 10,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"
}
}
Add an existing image to an existing variant
PUT /admin/api/2020-01/variants/808950810.json
{
"variant": {
"id": 808950810,
"image_id": 562641783
}
}
View Response
HTTP/1.1 200 OK
{
"variant": {
"id": 808950810,
"product_id": 632910392,
"title": "Pink",
"price": "199.00",
"sku": "IPOD2008PINK",
"position": 1,
"inventory_policy": "continue",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Pink",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:35:57-04:00",
"taxable": true,
"barcode": "1234_pink",
"grams": 567,
"image_id": 562641783,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 808950810,
"inventory_quantity": 10,
"old_inventory_quantity": 10,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"
}
}
Delete a product variant
DELETE /admin/api/2020-01/products/632910392/variants/808950810.json
View Response
HTTP/1.1 200 OK
{
}
Important
Apps can no longer set inventory using inventory_quantity
or inventory_quantity_adjustment
. For more information, see Updating inventory.
What you can do with Product Variant
The Shopify API lets you do the following with the Product Variant resource. More detailed versions of these general actions may be available:
- GET /admin/api/2020-04/products/{product_id}/variants.json Retrieves a list of product variants
- GET /admin/api/2020-04/products/{product_id}/variants/count.json Receive a count of all Product Variants
- GET /admin/api/2020-04/variants/{variant_id}.json Receive a single Product Variant
- POST /admin/api/2020-04/products/{product_id}/variants.json Create a new Product Variant
- PUT /admin/api/2020-04/variants/{variant_id}.json Modify an existing Product Variant
- DELETE /admin/api/2020-04/products/{product_id}/variants/{variant_id}.json Remove an existing Product Variant
Product Variant properties
barcode |
The barcode, UPC, or ISBN number for the product. |
compare_at_price |
The original price of the item before an adjustment or a sale. |
created_at |
The date and time (ISO 8601 format) when the product variant was created. |
fulfillment_service |
The fulfillment service associated with the product variant. Valid values: |
grams |
The weight of the product variant in grams. |
id |
The unique numeric identifier for the product variant. |
image_id |
The unique numeric identifier for a product's image. The image must be associated to the same product as the variant. |
inventory_item_id |
The unique identifier for the inventory item, which is used in the Inventory API to query for inventory information. |
inventory_management |
The fulfillment service that tracks the number of items in stock for the product variant. Valid values:
|
inventory_policy |
Whether customers are allowed to place an order for the product variant when it's out of stock. Valid values:
deny .
|
inventory_quantity
read-only |
An aggregate of inventory across all locations. To adjust inventory at a specific location, use the InventoryLevel resource. |
old_inventory_quantity
deprecated |
This property is deprecated. Use the InventoryLevel resource instead. |
inventory_quantity_adjustment
deprecated |
This property is deprecated. Use the InventoryLevel resource instead. |
option |
The custom properties that a shop owner uses to define product variants.
You can define three options for a product variant: |
presentment_prices
read-only |
A list of the variant's presentment prices and compare-at prices in each of the shop's enabled presentment currencies. Each price object has the following properties:
'X-Shopify-Api-Features': 'include-presentment-prices' .
|
position
read-only |
The order of the product variant in the list of product variants.
The first position in the list is |
price |
The price of the product variant. |
product_id |
The unique numeric identifier for the product. |
requires_shipping
deprecated |
This property is deprecated. Use the `requires_shipping` property on the InventoryItem resource instead. |
sku |
A unique identifier for the product variant in the shop. Required in order to connect to a FulfillmentService. |
taxable |
Whether a tax is charged when the product variant is sold. |
tax_code |
This parameter applies only to the stores that have the Avalara AvaTax app installed. Specifies the Avalara tax code for the product variant. |
title
read-only |
The title of the product variant. The |
updated_at |
The date and time when the product variant was last modified. Gets returned in ISO 8601 format. |
weight |
The weight of the product variant in the unit system specified with |
weight_unit |
The unit of measurement that applies to the product variant's weight.
If you don't specify a value for |
Endpoints
page
parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints.
limit
|
Return up to this many results per page (default:50 , maximum: 250 )
|
presentment_currencies
|
Return presentment prices in only certain currencies, specified by a comma-separated list of ISO 4217 currency codes. |
since_id
|
Restrict results to after the specified ID |
fields
|
A comma-separated list of fields to include in the response |
Retrieve all variants for a product
GET /admin/api/2020-04/products/632910392/variants.json
View Response
HTTP/1.1 200 OK
{
"variants": [
{
"id": 39072856,
"product_id": 632910392,
"title": "Green",
"price": "199.00",
"sku": "IPOD2008GREEN",
"position": 3,
"inventory_policy": "continue",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Green",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_green",
"grams": 567,
"image_id": null,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 39072856,
"inventory_quantity": 30,
"old_inventory_quantity": 30,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"
},
{
"id": 49148385,
"product_id": 632910392,
"title": "Red",
"price": "199.00",
"sku": "IPOD2008RED",
"position": 2,
"inventory_policy": "continue",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Red",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_red",
"grams": 567,
"image_id": null,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 49148385,
"inventory_quantity": 20,
"old_inventory_quantity": 20,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"
},
{
"id": 457924702,
"product_id": 632910392,
"title": "Black",
"price": "199.00",
"sku": "IPOD2008BLACK",
"position": 4,
"inventory_policy": "continue",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Black",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_black",
"grams": 567,
"image_id": null,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 457924702,
"inventory_quantity": 40,
"old_inventory_quantity": 40,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"
},
{
"id": 808950810,
"product_id": 632910392,
"title": "Pink",
"price": "199.00",
"sku": "IPOD2008PINK",
"position": 1,
"inventory_policy": "continue",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Pink",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_pink",
"grams": 567,
"image_id": 562641783,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 808950810,
"inventory_quantity": 10,
"old_inventory_quantity": 10,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"
}
]
}
Retrieve all variants for a product after a specified ID
GET /admin/api/2020-04/products/632910392/variants.json?since_id=49148385
View Response
HTTP/1.1 200 OK
{
"variants": [
{
"id": 457924702,
"product_id": 632910392,
"title": "Black",
"price": "199.00",
"sku": "IPOD2008BLACK",
"position": 4,
"inventory_policy": "continue",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Black",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_black",
"grams": 567,
"image_id": null,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 457924702,
"inventory_quantity": 40,
"old_inventory_quantity": 40,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"
},
{
"id": 808950810,
"product_id": 632910392,
"title": "Pink",
"price": "199.00",
"sku": "IPOD2008PINK",
"position": 1,
"inventory_policy": "continue",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Pink",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_pink",
"grams": 567,
"image_id": 562641783,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 808950810,
"inventory_quantity": 10,
"old_inventory_quantity": 10,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"
}
]
}
Retrieve all variants for a product with prices in specified presentment currencies
GET /admin/api/2020-04/products/632910392/variants.json?presentment_currencies=USD,CAD
View Response
HTTP/1.1 200 OK
{
"variants": [
{
"id": 39072856,
"product_id": 632910392,
"title": "Green",
"price": "199.00",
"sku": "IPOD2008GREEN",
"position": 3,
"inventory_policy": "continue",
"compare_at_price": "249.00",
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Green",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_green",
"grams": 567,
"image_id": null,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 39072856,
"inventory_quantity": 30,
"old_inventory_quantity": 30,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": {
"amount": "249.00",
"currency_code": "USD"
}
},
{
"price": {
"amount": "249.00",
"currency_code": "CAD"
},
"compare_at_price": {
"amount": "312.00",
"currency_code": "CAD"
}
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"
},
{
"id": 49148385,
"product_id": 632910392,
"title": "Red",
"price": "199.00",
"sku": "IPOD2008RED",
"position": 2,
"inventory_policy": "continue",
"compare_at_price": "249.00",
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Red",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_red",
"grams": 567,
"image_id": null,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 49148385,
"inventory_quantity": 20,
"old_inventory_quantity": 20,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": {
"amount": "249.00",
"currency_code": "USD"
}
},
{
"price": {
"amount": "249.00",
"currency_code": "CAD"
},
"compare_at_price": {
"amount": "312.00",
"currency_code": "CAD"
}
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"
},
{
"id": 457924702,
"product_id": 632910392,
"title": "Black",
"price": "199.00",
"sku": "IPOD2008BLACK",
"position": 4,
"inventory_policy": "continue",
"compare_at_price": "249.00",
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Black",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_black",
"grams": 567,
"image_id": null,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 457924702,
"inventory_quantity": 40,
"old_inventory_quantity": 40,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": {
"amount": "249.00",
"currency_code": "USD"
}
},
{
"price": {
"amount": "249.00",
"currency_code": "CAD"
},
"compare_at_price": {
"amount": "312.00",
"currency_code": "CAD"
}
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"
},
{
"id": 808950810,
"product_id": 632910392,
"title": "Pink",
"price": "199.00",
"sku": "IPOD2008PINK",
"position": 1,
"inventory_policy": "continue",
"compare_at_price": "249.00",
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Pink",
"option2": null,
"option3": null,
"created_at": "2021-04-01T14:26:30-04:00",
"updated_at": "2021-04-01T14:26:30-04:00",
"taxable": true,
"barcode": "1234_pink",
"grams": 567,
"image_id": 562641783,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 808950810,
"inventory_quantity": 10,
"old_inventory_quantity": 10,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": {
"amount": "249.00",
"currency_code": "USD"
}
},
{
"price": {
"amount": "249.00",
"currency_code": "CAD"
},
"compare_at_price": {
"amount": "312.00",
"currency_code": "CAD"
}
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"
}
]
}
Retrieve a count all variants for a product
GET /admin/api/2020-04/products/632910392/variants/count.json
View Response
HTTP/1.1 200 OK
{
"count": 4
}
fields
|
A comma-separated list of fields to include in the response |
Retrieve a product variant by ID
GET /admin/api/2020-04/variants/808950810.json
View Response
HTTP/1.1 200 OK
{
"variant": {
"id": 808950810,
"product_id": 632910392,
"title"