Skip to main content
Version: Node SDK

Create License

This method will create one or many a new ad hoc licenses.

Code Sample

Create one

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

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

const license = await salable.licenses.create({
planUuid: '{{PLAN_UUID}}',
member: 'orgId_1234',
granteeId: 'userId-1',
});

Create many

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

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

const license = await salable.licenses.create([
{
planUuid: '{{PLAN_UUID}}',
member: 'orgId_1234',
granteeId: 'userId-1',
},
{
planUuid: '{{PLAN_UUID}}',
member: 'orgId_1234',
granteeId: 'userId-2',
},
]);

Parameters

planUuid (required)

Type: string

uuid of the Plan you wish to create the License on


member (required)

Type: string

The ID of the member who will manage the license


granteeId (required)

Type: string or null

The grantee ID for the license

Return Type

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