Product Variants API Routes

A product variant is a saleable form of the product.

Each variant has different option values. For example, a "Shirt" product may have a "Blue" variant and a "Green" variant. Customers choose from these variants when they buy the product.

These API routes allow admin users to manage product variants.

GET /admin/product-variants#

List Product Variants

Retrieve a list of product variants. The product variants can be filtered by fields such as id. The product variants can also be sorted or paginated.

Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.

Query parameters

fieldsstringOptional
Comma-separated fields that should be included in the returned data. if a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.
offsetnumberOptional
The number of items to skip when retrieving a list.
limitnumberOptional
Limit the number of items returned in the list.
orderstringOptional
The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with -.
qstringOptional
Search term to filter the product variant's searchable properties.
idstring | string[]Optional
Filter by a variant's ID.
manage_inventorybooleanOptional
Filter by whether a variant's manage_inventory is enabled.
allow_backorderbooleanOptional
Filter by whether backorder is allowed for a variant.
created_atobjectOptional
Filter by the product variant's creation date. Accepts the filter operators.
updated_atobjectOptional
Filter by the product variant's update date. Accepts the filter operators.
deleted_atobjectOptional
Filter by the product variant's deletion date. Accepts the filter operators.
$andobject[]Optional
Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
$orobject[]Optional
Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
with_deletedbooleanOptional
Whether to include deleted records in the result.
eanstring | string[]Optional
The product variant's ean.
upcstring | string[]Optional
The product variant's upc.
barcodestring | string[]Optional
The product variant's barcode.
skustring | string[]Optional
Filter by an SKU.

Request examples

Responses

200 OK

limitnumber
The maximum number of items returned.
offsetnumber
The number of items skipped before retrieving the returned items.
countnumber
The total number of items.
variantsobject[]
The product variant's variants.

400, 401, 404, 409, 422, 500: an error response is returned.

Found a problem with this page?Report Issue
Edited Nov 14·Edit this page