Variants
Return a list of Variants
Storefront API
- Authentication
- Account
- Account / Address
- Account / Credit Cards
- Account / Orders
- Order Status
- Cart
- Cart / Line Items
- Cart / Other
- Cart / Coupons
- Checkout
- Checkout / State
- Checkout / Shipments
- Checkout / Payments
- Checkout / Store Credit
- Stripe
- Products
- Vendors
- Stores
- Taxons
- Countries
- CMS Pages
- Menus
- Wishlists
- Wishlists / Wished Items
- Digital Downloads
Platform API
- Authentication
- Addresses
- Adjustments
- Classifications
- CMS Pages
- CMS Sections
- Countries
- Data Feeds
- Digital Links
- Digital Assets
- Line Items
- Menu Items
- Menus
- Option Types
- Option Values
- Orders
- Payment Methods
- Payments
- Products
- Promotion Actions
- Promotion Categories
- Promotion Rules
- Promotions
- Roles
- Shipments
- Shipping Categories
- Shipping Methods
- States
- Stock Items
- Stock Locations
- Store Credit Categories
- Store Credit Types
- Store Credits
- Tax Categories
- Tax Rates
- Taxonomies
- Taxons
- Users
- Variants
- Vendors
- Webhook Events
- Webhook Subscribers
- Wished Items
- Wishlists
- Zones
Variants
Return a list of Variants
Returns a list of Variants
GET
/
api
/
v2
/
platform
/
variants
curl --request GET \
--url http://{defaultHost}/api/v2/platform/variants \
--header 'Authorization: Bearer <token>'
{
"data": [
{
"id": "284",
"type": "variant",
"attributes": {
"sku": "SKU-283",
"weight": "0.0",
"height": null,
"depth": null,
"deleted_at": null,
"is_master": true,
"cost_price": "17.0",
"position": 1,
"cost_currency": "USD",
"track_inventory": true,
"updated_at": "2022-11-08T19:35:56.573Z",
"discontinue_on": null,
"created_at": "2022-11-08T19:35:56.573Z",
"public_metadata": {},
"private_metadata": {},
"barcode": null,
"display_price": "$19.99",
"display_compare_at_price": null,
"name": "Product 213286",
"options_text": "",
"total_on_hand": 0,
"purchasable": true,
"in_stock": false,
"backorderable": true,
"available": true,
"currency": "USD",
"price": "19.99",
"compare_at_price": null
},
"relationships": {
"product": {
"data": {
"id": "214",
"type": "product"
}
},
"tax_category": {
"data": null
},
"digitals": {
"data": []
},
"images": {
"data": []
},
"option_values": {
"data": []
},
"stock_items": {
"data": [
{
"id": "300",
"type": "stock_item"
}
]
},
"stock_locations": {
"data": [
{
"id": "187",
"type": "stock_location"
}
]
}
}
},
{
"id": "285",
"type": "variant",
"attributes": {
"sku": "SKU-284",
"weight": "23.12",
"height": "92.8",
"depth": "47.37",
"deleted_at": null,
"is_master": false,
"cost_price": "17.0",
"position": 2,
"cost_currency": "USD",
"track_inventory": true,
"updated_at": "2022-11-08T19:35:56.608Z",
"discontinue_on": null,
"created_at": "2022-11-08T19:35:56.605Z",
"public_metadata": {},
"private_metadata": {},
"barcode": null,
"display_price": "$19.99",
"display_compare_at_price": null,
"name": "Product 213286",
"options_text": "Size: S",
"total_on_hand": 0,
"purchasable": true,
"in_stock": false,
"backorderable": true,
"available": true,
"currency": "USD",
"price": "19.99",
"compare_at_price": null
},
"relationships": {
"product": {
"data": {
"id": "214",
"type": "product"
}
},
"tax_category": {
"data": null
},
"digitals": {
"data": []
},
"images": {
"data": []
},
"option_values": {
"data": [
{
"id": "83",
"type": "option_value"
}
]
},
"stock_items": {
"data": [
{
"id": "301",
"type": "stock_item"
}
]
},
"stock_locations": {
"data": [
{
"id": "187",
"type": "stock_location"
}
]
}
}
},
{
"id": "286",
"type": "variant",
"attributes": {
"sku": "SKU-285",
"weight": "90.94",
"height": "108.64",
"depth": "191.7",
"deleted_at": null,
"is_master": false,
"cost_price": "17.0",
"position": 3,
"cost_currency": "USD",
"track_inventory": true,
"updated_at": "2022-11-08T19:35:56.633Z",
"discontinue_on": null,
"created_at": "2022-11-08T19:35:56.629Z",
"public_metadata": {},
"private_metadata": {},
"barcode": null,
"display_price": "$19.99",
"display_compare_at_price": null,
"name": "Product 213286",
"options_text": "Size: S",
"total_on_hand": 0,
"purchasable": true,
"in_stock": false,
"backorderable": true,
"available": true,
"currency": "USD",
"price": "19.99",
"compare_at_price": null
},
"relationships": {
"product": {
"data": {
"id": "214",
"type": "product"
}
},
"tax_category": {
"data": null
},
"digitals": {
"data": []
},
"images": {
"data": []
},
"option_values": {
"data": [
{
"id": "84",
"type": "option_value"
}
]
},
"stock_items": {
"data": [
{
"id": "302",
"type": "stock_item"
}
]
},
"stock_locations": {
"data": [
{
"id": "187",
"type": "stock_location"
}
]
}
}
}
],
"meta": {
"count": 3,
"total_count": 3,
"total_pages": 1
},
"links": {
"self": "http://www.example.com/api/v2/platform/variants?page=1&per_page=&include=&filter[product_id_eq]=&filter[sku_i_cont]=",
"next": "http://www.example.com/api/v2/platform/variants?filter%5Bproduct_id_eq%5D=&filter%5Bsku_i_cont%5D=&include=&page=1&per_page=",
"prev": "http://www.example.com/api/v2/platform/variants?filter%5Bproduct_id_eq%5D=&filter%5Bsku_i_cont%5D=&include=&page=1&per_page=",
"last": "http://www.example.com/api/v2/platform/variants?filter%5Bproduct_id_eq%5D=&filter%5Bsku_i_cont%5D=&include=&page=1&per_page=",
"first": "http://www.example.com/api/v2/platform/variants?filter%5Bproduct_id_eq%5D=&filter%5Bsku_i_cont%5D=&include=&page=1&per_page="
}
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Query Parameters
Select which associated resources you would like to fetch, see: <a href="https://jsonapi.org/format/#fetching-includes">https://jsonapi.org/format/#fetching-includes</a>
Response
200
application/vnd.api+json
Records returned
Was this page helpful?
curl --request GET \
--url http://{defaultHost}/api/v2/platform/variants \
--header 'Authorization: Bearer <token>'
{
"data": [
{
"id": "284",
"type": "variant",
"attributes": {
"sku": "SKU-283",
"weight": "0.0",
"height": null,
"depth": null,
"deleted_at": null,
"is_master": true,
"cost_price": "17.0",
"position": 1,
"cost_currency": "USD",
"track_inventory": true,
"updated_at": "2022-11-08T19:35:56.573Z",
"discontinue_on": null,
"created_at": "2022-11-08T19:35:56.573Z",
"public_metadata": {},
"private_metadata": {},
"barcode": null,
"display_price": "$19.99",
"display_compare_at_price": null,
"name": "Product 213286",
"options_text": "",
"total_on_hand": 0,
"purchasable": true,
"in_stock": false,
"backorderable": true,
"available": true,
"currency": "USD",
"price": "19.99",
"compare_at_price": null
},
"relationships": {
"product": {
"data": {
"id": "214",
"type": "product"
}
},
"tax_category": {
"data": null
},
"digitals": {
"data": []
},
"images": {
"data": []
},
"option_values": {
"data": []
},
"stock_items": {
"data": [
{
"id": "300",
"type": "stock_item"
}
]
},
"stock_locations": {
"data": [
{
"id": "187",
"type": "stock_location"
}
]
}
}
},
{
"id": "285",
"type": "variant",
"attributes": {
"sku": "SKU-284",
"weight": "23.12",
"height": "92.8",
"depth": "47.37",
"deleted_at": null,
"is_master": false,
"cost_price": "17.0",
"position": 2,
"cost_currency": "USD",
"track_inventory": true,
"updated_at": "2022-11-08T19:35:56.608Z",
"discontinue_on": null,
"created_at": "2022-11-08T19:35:56.605Z",
"public_metadata": {},
"private_metadata": {},
"barcode": null,
"display_price": "$19.99",
"display_compare_at_price": null,
"name": "Product 213286",
"options_text": "Size: S",
"total_on_hand": 0,
"purchasable": true,
"in_stock": false,
"backorderable": true,
"available": true,
"currency": "USD",
"price": "19.99",
"compare_at_price": null
},
"relationships": {
"product": {
"data": {
"id": "214",
"type": "product"
}
},
"tax_category": {
"data": null
},
"digitals": {
"data": []
},
"images": {
"data": []
},
"option_values": {
"data": [
{
"id": "83",
"type": "option_value"
}
]
},
"stock_items": {
"data": [
{
"id": "301",
"type": "stock_item"
}
]
},
"stock_locations": {
"data": [
{
"id": "187",
"type": "stock_location"
}
]
}
}
},
{
"id": "286",
"type": "variant",
"attributes": {
"sku": "SKU-285",
"weight": "90.94",
"height": "108.64",
"depth": "191.7",
"deleted_at": null,
"is_master": false,
"cost_price": "17.0",
"position": 3,
"cost_currency": "USD",
"track_inventory": true,
"updated_at": "2022-11-08T19:35:56.633Z",
"discontinue_on": null,
"created_at": "2022-11-08T19:35:56.629Z",
"public_metadata": {},
"private_metadata": {},
"barcode": null,
"display_price": "$19.99",
"display_compare_at_price": null,
"name": "Product 213286",
"options_text": "Size: S",
"total_on_hand": 0,
"purchasable": true,
"in_stock": false,
"backorderable": true,
"available": true,
"currency": "USD",
"price": "19.99",
"compare_at_price": null
},
"relationships": {
"product": {
"data": {
"id": "214",
"type": "product"
}
},
"tax_category": {
"data": null
},
"digitals": {
"data": []
},
"images": {
"data": []
},
"option_values": {
"data": [
{
"id": "84",
"type": "option_value"
}
]
},
"stock_items": {
"data": [
{
"id": "302",
"type": "stock_item"
}
]
},
"stock_locations": {
"data": [
{
"id": "187",
"type": "stock_location"
}
]
}
}
}
],
"meta": {
"count": 3,
"total_count": 3,
"total_pages": 1
},
"links": {
"self": "http://www.example.com/api/v2/platform/variants?page=1&per_page=&include=&filter[product_id_eq]=&filter[sku_i_cont]=",
"next": "http://www.example.com/api/v2/platform/variants?filter%5Bproduct_id_eq%5D=&filter%5Bsku_i_cont%5D=&include=&page=1&per_page=",
"prev": "http://www.example.com/api/v2/platform/variants?filter%5Bproduct_id_eq%5D=&filter%5Bsku_i_cont%5D=&include=&page=1&per_page=",
"last": "http://www.example.com/api/v2/platform/variants?filter%5Bproduct_id_eq%5D=&filter%5Bsku_i_cont%5D=&include=&page=1&per_page=",
"first": "http://www.example.com/api/v2/platform/variants?filter%5Bproduct_id_eq%5D=&filter%5Bsku_i_cont%5D=&include=&page=1&per_page="
}
}