-
Notifications
You must be signed in to change notification settings - Fork 28
Stores
Branko Conjic edited this page Feb 8, 2024
·
2 revisions
Retrieves the store with the given ID.
import { type Store, getStore } from '@lemonsqueezy/lemonsqueezy.js';
const storeId = 123456;
const { error, data, statusCode } = await getStore(123456);
With related resources:
import { type Store, type GetStoreParams, getStore } from '@lemonsqueezy/lemonsqueezy.js';
const storeId = 123456;
const { error, data, statusCode } = await getStore(123456, { include: ['store'] });
/**
* Retrieve a store.
*
* @param storeId (Required) The given store id.
* @param [params] (Optional) Additional parameters.
* @param [params.include] (Optional) Related resources.
* @returns A store object.
*/
declare function getStore(storeId: number | string, params?: GetStoreParams): Promise<FetchResponse<Store>>;
{
statusCode: number | null;
error: Error | null;
data: Store | null;
}
Returns a paginated list of stores.
import { type ListStores, listStores } from '@lemonsqueezy/lemonsqueezy.js';
const { statusCode, error, data } = await listStores();
With pagination:
import { type ListStores, type ListStoresParams, listStores } from '@lemonsqueezy/lemonsqueezy.js';
const { statusCode, error, data } = await listStores({ page: { number: 1, size: 10 } });
With related resources:
import { type ListStores, listStores } from '@lemonsqueezy/lemonsqueezy.js';
const { statusCode, error, data } = await listStores({ include: ['products'] });
/**
* List all stores.
*
* @param [params] (Optional) Additional parameters.
* @param [params.page] (Optional) Custom paginated queries.
* @param [params.page.number] (Optional) The parameter determine which page to retrieve.
* @param [params.page.size] (Optional) The parameter to determine how many results to return per page.
* @param [params.include] (Optional) Related resources.
* @returns A paginated list of `store` objects ordered by name.
*/
declare function listStores(params?: ListStoresParams): Promise<FetchResponse<ListStores>>;
{
statusCode: number | null;
error: Error | null;
data: ListStores | null;
}