Skip to main content

Collections

Methods for handling collections.

listCollections v1.18.0 read products Types​

Get a paginated list of collections for the store.

import { listCollections } from '@rechargeapps/storefront-client';
await listCollections(session, {
limit: 25,
sort_by: 'id-asc',
});

getCollection v1.18.0 read products Types​

Get a collection by collection ID.

import { getCollection } from '@rechargeapps/storefront-client';
await getCollection(session, 123);

listCollectionProducts v1.18.0 read products Types​

Get a list of products for a collection in collection sort order, additional product search query params may filter out products from the collection by collection ID.

Currently this will return up to 250 products, pagination is not currently supported.

import { listCollectionProducts } from '@rechargeapps/storefront-client';
await listCollectionProducts(session, 123, { format_version: '2022-06' });