Subscription
Manage your Linked API subscription: check status, adjust seats, get pricing, and handle billing. See the Admin overview for initialization.
Get status
typescript
try {
const status = await admin.subscription.getStatus();
console.log(status.status); // 'active' | 'trialing' | 'past_due' | 'canceled' | undefined
console.log(status.eligibleForTrial); // boolean
console.log(status.cancelAtPeriodEnd); // boolean
} catch (e) {
if (e instanceof LinkedApiError) {
console.error(`Critical Error - Type: ${e.type}, Message: ${e.message}`);
} else {
console.error('An unexpected, non-API error occurred:', e);
}
}Data
status–active,trialing,past_due,canceled, orundefinedif no subscription.eligibleForTrial– whether a 7-day free trial is available.cancelAtPeriodEnd– whether the subscription is scheduled to cancel at the end of the current billing period.
Get seats
typescript
const { seats } = await admin.subscription.getSeats();
for (const seat of seats) {
console.log(`${seat.seatType} × ${seat.quantity} (${seat.billingPeriod})`);
}Data
Array of seat objects:
seatType–coreorplus. Theplustier unlocks Sales Navigator actions (nv.*).quantity– number of seats. Each seat allows one connected LinkedIn account.billingPeriod–monthoryear.
Get pricing
typescript
const { products } = await admin.subscription.getPricing();
for (const product of products) {
console.log(`${product.seatType} ${product.billingPeriod}: $${product.unitPrice / 100}/seat`);
}Data
Array of product objects:
id– Stripe price identifier.seatType–coreorplus.billingPeriod–monthoryear.unitPrice– price per seat in cents (USD). E.g.,6900= $69.00.
Set seats
New users can start with a 7-day free trial.
typescript
const result = await admin.subscription.setSeats({
quantity: 5,
seatType: 'plus',
billingPeriod: 'year',
});
if (result.status === 'processing') {
// No active subscription – redirect user to checkout
console.log('Complete payment:', result.paymentLink);
} else {
console.log('Seats updated');
}Params
quantity– number of seats (1–1000).seatType–coreorplus.billingPeriod–monthoryear.
Data
status–complete(subscription updated) orprocessing(checkout required).paymentLink– Stripe checkout URL (only whenstatusisprocessing).
Note: When reducing seats below the number of connected accounts, excess accounts will be automatically frozen.
Get billing link
typescript
const { stripeLink } = await admin.subscription.getBillingLink();
// Redirect user to manage payment methods and invoicesData
stripeLink– URL to the Stripe billing portal.
Cancel
typescript
const { cancelAtDate } = await admin.subscription.cancel();
console.log(`Subscription ends: ${cancelAtDate}`);Data
cancelAtDate– ISO 8601 timestamp of when the subscription will end.
Warning: This is a real cancellation. After the billing period ends, all connected LinkedIn accounts will be disconnected.
Errors
All subscription methods may throw:
linkedApiTokenRequired– missing token.invalidLinkedApiToken– invalid or expired token.tooManyRequests– rate limit exceeded.
For the complete HTTP API reference, see Admin API: Subscription.