Skip to main content
Version: Node SDK

Get Checkout Link

Returns the checkout link for a plan. This endpoint will only work for paid Plans.

Code Sample

Required parameters

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

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

const checkoutLink = await salable.plans.getCheckoutLink('1de11022-ef14-4e22-94e6-c5b0652e497f', {
cancelUrl: 'https://example.com/cancel',
successUrl: 'https://example.com/success',
granteeId: 'userId-1',
member: 'orgId_1',
});

Customer details

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

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

const checkoutLink = await salable.plans.getCheckoutLink('15914694-5ff1-40d7-8ccb-7acc00586508', {
cancelUrl: 'https://example.com/cancel',
successUrl: 'https://example.com/success',
granteeId: 'userId-1',
member: 'orgId_1',
customerEmail: 'person@company.com',
});

Parameters

planUuid (required)

Type: string

The uuid of the Plan to get the checkout link from

options (required)

Type: GetPlanCheckoutOptions

Query parameters to be passed in to the checkout config

ParameterTypeDescriptionRequired
successUrlstringThe URL to send users if they have successfully completed a purchase
cancelUrlstringThe URL to send users to if the transaction fails.
memberstringThe purchaser of the license
granteeIdstringValue to use as granteeId on Plan
promoCodestringEnables the promo code field in Stripe checkout. Cannot be used with promoCode.
currencystringShortname of the currency to be used in the checkout. The currency must be added to the plan's product in Salable. If not specified, it defaults to the currency selected on the product.
quantitystringOnly applicable for per seat plans. Set the amount of seats the customer pays for in the checkout.
customerEmailstringPre fills email for checkout customer
automaticTaxstringAutomatically calculate tax on checkout based on customers location and your Stripe settings.

Return Type

For more information about this request see our API documentation on Plan checkout link