Skip to content

tys.products.list()

Method@tryyoursize/node

Newest first. Await for one page, or for await over every product.

list(params: ProductListParams = {}, options?: RequestOptions): PagePromise<ProductPage, Product>
paramsProductListParamsOptional= {}

limit, cursor, and sku to find one product by SKU.

optionsRequestOptionsOptional

PagePromise<ProductPage, Product>: Products, newest first. Await it for one page ({ data, has_more, next_cursor }), or for await over every item. See PagePromise.

// One page
const page = await tys.products.list({ limit: 50 });
// Every product, across pages
for await (const p of tys.products.list()) {
console.log(p.external_id, p.published_version);
}
// One product by SKU
const { data } = await tys.products.list({ sku: "TEE-001" });

Was this page helpful?