Skip to main content
Version: Node SDK

Get All Usage Records for a Grantee

Returns a list of all the usage records for grantee's metered licenses

Code Sample

import { Salable } from '@salable/node-sdk';

const salable = new Salable('{{API_KEY}}', 'v2');

const records = await salable.usage.getAllUsageRecords({
granteeId: 'grantee_1'
});

Parameters

options (required)

Type: GetLicenseOptions

OptionTypeDescriptionRequired
granteeIdstringThe granteeId of the license
typestringFilter by the type of usage record
statusstringFilter by the status of the license
planUuidstringThe UUID of the plan the license belongs to
subscriptionUuidstringFilters usage records by their license's subscription
sortstringSorts usage records by createdAt field. Default ('asc'). Enum: 'asc' | 'desc'
cursorstringCursor value, used for pagination
takestringThe amount of licenses to fetch

Return Type

For more information about this request see our API documentation on Usage Record Object