List a product's variants
AI agents: read /llms.txt; add .md to any page URL. This page as Markdown: /reference/product-variants/v1-product-variant-index.md. Index of every page and the rules for every call: /llms.txt. Guides and concepts in one file: /llms-full.txt. OpenAPI: /openapi.json.
GET/
Lists the live variants (size and color combinations) of a variant product, paged. Each variant has its id (use it as the db_variant id on sales order lines), size_id, size_label, color_id, color_label, color_hex, default_price, price_data, weight, vendor_id and supplier_id.
Each variant has its own phased_out, phased_out_at and phased_out_by ({id, name} or null: on sale, or nobody recorded), loaded for the whole list in one query. The list is paged: pagination gives total, count, perPage, currentPage and totalPages. Ask for the next page with page; the page size is the team's setting (50 unless changed), and per_page is ignored.
Path parameters
Your team slug, shown as Team ID next to your API key in Profile.
- Example
your-team
- Example
The product's id (
idfrom List products). A hash id from an earlier answer; unique keys and document numbers (such asPO0042) don't work here.- Example
EDhVUaC6jbLbed
- Example
Query parameters
pageintegerThe page to return. Pages hold the team's page size (
pagination_per_pagein team settings: 50 unless changed, 5 to 100).per_pageis not read here.- Default
1 - Minimum 1
- Example
1
- Default
Request body
This operation takes no request body.
Response
200Successful response.
Fields of each item (23)
- Always
"variant_option"
- Always
This variant's selling price. Never null. Thousandths, an older encoding:
12500is 12.50. Usually a whole number; an amount finer than a thousandth comes back as a number with a fraction (1234.5is 1.2345), or as a string ("1234.5") when you sendX-Yoprint-Decimal-Format: exact-v1. See Money and quantities.The variant id: the
db_variantline's product id.barcodestring | nullbrandstring | nullThe parent product's brand.
color_hexstring | nullcolor_idstring | nullcolor_labelstring | nulldescriptionstring | nullThe parent product's description.
enablebooleanphased_out_atstring (date-time) | nullphased_out_byobject | nullWho did it, as
{id, name}; null when on sale or nobody was recorded.price_dataobject | arrayPrices for pricing groups, as saved: keyed by the pricing group's internal number (not its hash id), each
{"price": <thousandths>}. An empty list[]when there are none.size_idstring | nullsize_labelstring | nullsupplier_idstring | nulltaxablebooleanThe parent product's
taxable.titlestring | nullThe parent product's title.
track_inventorybooleanvendor_idstringThe vendor id, or an empty string when none.
weightnumber | string | null
paginationobjectChild fields (6)
Links to the neighbouring pages:
previousandnext, each present only when that page exists. An empty list,[], when there is only one page.
Errors
401The API key is missing or wrong (
unauthenticated).403You are not allowed to do this.
api_access_not_in_plan: your team's plan doesn't include API access (Pro and above, with an active subscription or trial), so every request answers this until the team upgrades. When your role lacks the permission the operation needs, the body is only{"message": "Insufficient Permission"}. Other refusals use the error envelope, withunauthorizedoruser_is_not_authorized.404Not found.
page_not_found: the team slug is unknown, you are not a member of the team, or an id in the path is not one of this team's.code: null, with a message that starts "No query results for": there is no record with that id.
Notes
- Amounts here use thousandths, an older encoding:
12500is 12.50. Usually a whole number; an amount finer than a thousandth comes back as a number with a fraction (1234.5is 1.2345), or as a string ("1234.5") when you sendX-Yoprint-Decimal-Format: exact-v1. See Money and quantities.
Related
- POSTAdd a variant to a product
/v1/ api/ store/ {team_slug}/ product/ {hash_id}/ variant - POSTPhase out variants (stop selling them)
/v1/ api/ store/ {team_slug}/ product/ {hash_id}/ variant/ phase_out - POSTAdd a line item to a sales order or quote
/v2/ api/ store/ {team_slug}/ v2/ sales_order/ {order_unique_key}/ order_item
