This repository has been archived by the owner on Feb 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Stores
Caven edited this page Jan 31, 2024
·
2 revisions
Retrieves the store with the given ID.
import { type Store, getStore } from '@heybrostudio/lemonsqueezy.js'
const storeId = 123456
const { error, data, statusCode } = await getStore(123456)
With related resources:
import { type Store, type GetStoreParams, getStore } from '@heybrostudio/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 '@heybrostudio/lemonsqueezy.js'
const { statusCode, error, data } = await listStores()
With pagination:
import { type ListStores, type ListStoresParams, listStores } from '@heybrostudio/lemonsqueezy.js'
const { statusCode, error, data } = await listStores({ page: { number: 1, size: 10 }})
With related resources:
import { type ListStores, listStores } from '@heybrostudio/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
}