Get variants
const url = 'https://acme.mykreezalid.com/api/v1/listings/1/variants?page=1&limit=25&fields=id%2Csku%2Cquantity';const options = {method: 'GET', headers: {Authorization: 'Basic <credentials>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://acme.mykreezalid.com/api/v1/listings/1/variants?page=1&limit=25&fields=id%2Csku%2Cquantity' \ --header 'Authorization: Basic <credentials>'Returns the variants of a listing. The list is paginated with page and limit, without a pagination block in the response. Use fields to keep only some fields of each variant.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Listing’s unique identifier
Query Parameters
Section titled “Query Parameters”Page number, starting at 1.
Number of results per page (at most 100).
Example
id,sku,quantityComma-separated list of the fields to return for each variant.
Responses
Section titled “Responses”The variants of the listing
object
A version of a listing that differs by size, color or any other characteristic, with its own price, SKU and stock.
object
Variant’s unique identifier
Your own reference for the variant
Unique identifier of the listing the variant belongs to
The quantity of the variant that is available for sale
Sorts the variants with the lowest number first. Negative numbers are allowed.
Unique identifier of the listing image used for this variant
Example
{ "variants": [ { "id": 432432, "object": "Variant", "external_id": "INTERNAL_REF_234324", "listing_id": 324353, "price": 123.5, "price_unit": null, "quantity": 10, "sort_priority": 10, "sku": "BASKT-XYZ-BLN-41", "title": "Blue Shoes Size 41", "weight": 0.8, "cover_id": 4242 } ]}Missing or wrong API credentials, or variants are not enabled for your marketplace (then the body carries an error message)
object
Example generated
{ "error": "example"}The requested page does not exist