-
Notifications
You must be signed in to change notification settings - Fork 26
LicenseKeyInstances
Branko Conjic edited this page Feb 8, 2024
·
2 revisions
Retrieves the license key instance with the given ID.
import { type LicenseKeyInstance, getLicenseKeyInstance } from '@lemonsqueezy/lemonsqueezy.js';
const licenseKeyInstanceId = 234567;
const { statusCode, error, data } = await getLicenseKeyInstance(licenseKeyInstanceId);
With related resources:
import { type LicenseKeyInstance, type GetLicenseKeyInstanceParams, getLicenseKeyInstance } from '@lemonsqueezy/lemonsqueezy.js';
const licenseKeyInstanceId = 234567;
const { statusCode, error, data } = await getLicenseKeyInstance(licenseKeyInstanceId, { include: ['license-key'] });
/**
* Retrieve a license key instance.
*
* @param licenseKeyInstanceId The given license key instance id.
* @param [params] (Optional) Additional parameters.
* @param [params.include] (Optional) Related resources.
* @returns A license key instance object.
*/
declare function getLicenseKeyInstance(licenseKeyInstanceId: number | string, params?: GetLicenseKeyInstanceParams): Promise<FetchResponse<LicenseKeyInstance>>;
Returns a license key instance object.
{
statusCode: number | null;
error: Error | null;
data: LicenseKeyInstance | null;
}
Returns a paginated list of license key instances.
import { type ListLicenseKeyInstances, listLicenseKeyInstances } from '@lemonsqueezy/lemonsqueezy.js';
const { statusCode, error, data } = await listLicenseKeyInstances();
With filter:
import { type ListLicenseKeyInstances, type ListLicenseKeyInstancesParams, listLicenseKeyInstances } from '@lemonsqueezy/lemonsqueezy.js';
const { statusCode, error, data } = await listLicenseKeyInstances({ filter: { licenseKeyId: 234567 } });
With pagination:
import { type ListLicenseKeyInstances, type ListLicenseKeyInstancesParams, listLicenseKeyInstances } from '@lemonsqueezy/lemonsqueezy.js';
const { statusCode, error, data } = await listLicenseKeyInstances({ page: { number: 1, size: 10 } });
With related resources:
import { type ListLicenseKeyInstances, type ListLicenseKeyInstancesParams, listLicenseKeyInstances } from '@lemonsqueezy/lemonsqueezy.js';
const { statusCode, error, data } = await listLicenseKeyInstances({ include: ['license-key'] });
/**
* List all license key instances.
*
* @param [params] (Optional) Additional parameters.
* @param [params.filter] (Optional) Filter parameters.
* @param [params.filter.licenseKeyId] (Optional) The license key ID.
* @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 license key instance objects ordered by `id`.
*/
declare function listLicenseKeyInstances(params?: ListLicenseKeyInstancesParams): Promise<FetchResponse<ListLicenseKeyInstances>>;
Returns a paginated list of license key instance objects ordered by id
.
{
statusCode: number | null;
error: Error | null;
data: ListLicenseKeyInstances | null;
}