Skip to main content

Taking payments

Checkout links offer the quickest and simplest way to accept payments from your users.

import { getCheckoutLink } from '@salable/js'

const { checkoutUrl } = await getCheckoutLink({
apiKey: 'your-salable-api-key',
planUuid: 'your-salable-plans-uuid',
successUrl: 'https://your.app/payment-success'
cancelUrl: 'https://your.app/payment-cancelled',
granteeId: 'your-grantees-id',
owner: 'your-grantees-organisation-id',
})

// Now you are free to present this `checkoutLink` to your user however you see
// fit.
OptionDescriptionRequired
successUrlThe url to redirect a customer after a successful checkout.
cancelUrlThe url to redirect a customer if they cancel the checkout.
granteeIdThe ID of the grantee which will be assigned to the first seat of the subscription, for example the user ID or a board ID. If the subscription is per-seat all additional seats created will be unassigned.
ownerThe ID of the customer's organisation.
For per-seat plans

On successful payment, the first seat will be assigned to the granteeId provided - the rest will be unassigned.

To assign the rest of the seats, you can update seats.