The vendor ID for a Paddle account
The API key for a Paddle account
Optional
publicKey: stringThe public key for a Paddle account used to verify webhooks, only required for verifyWebhookData
Optional
options: OptionsThe API key for a Paddle account
Optional
optionsThe public key for a Paddle account used to verify webhooks, only required for verifyWebhookData
The vendor ID for a Paddle account
Private
_firstPrivate
_getPrivate
Get the list of transactions for a resource.
API documentation: https://developer.paddle.com/api-reference/89c1805d821c2-list-transactions
Optional
page: numberPrivate
_requestPrivate
Execute a HTTP request
Optional
body?: TBodybody parameters / object
Optional
checkoutAPIVersion?: CheckoutAPIVersionOptional
form?: booleanserialize the data object to urlencoded format
Optional
headers?: objectheader parameters
Optional
json?: booleanCancels an active subscription.
API documentation: https://developer.paddle.com/api-reference/9b808453c3216-cancel-user
const result = await client.cancelSubscription(123);
Make an immediate one-off charge on top of an existing user subscription
API documentation: https://developer.paddle.com/api-reference/23cf86225523f-create-one-off-charge
const result = await client.createOneOffCharge(123, 10, 'description');
Create a subscription modifier to dynamically change the subscription payment amount.
API documentation: https://developer.paddle.com/api-reference/dc2b0c06f0481-create-modifier
const result = await client.createSubscriptionModifier(123, 10);
const result = await client.createSubscriptionModifier(123, 10, { recurring: false, description: 'description' });
Optional
options: { Optional
description?: stringOptional
recurring?: booleanDelete an existing subscription modifier.
API documentation: https://developer.paddle.com/classic/api-reference/dcdd0db5b20a1-delete-modifier
const result = await client.deleteSubscriptionModifier(123);
Generate a custom pay link.
API documentation: https://developer.paddle.com/api-reference/3f031a63f6bae-generate-pay-link
const custom = await client.generatePayLink({
title: 'my custom checkout',
custom_message: 'some custom message',
prices: [
'USD:19.99',
'EUR:15.99'
]
});
Get the list of transactions for a checkout.
API documentation: https://developer.paddle.com/api-reference/89c1805d821c2-list-transactions
const checkoutTransactions = await client.getCheckoutTransactions('123');
const checkoutTransactionsNext = await client.getCheckoutTransactions('123', 2);
Optional
page: numberPrivate
getGet information about an order after a transaction completes.
API documentation: https://developer.paddle.com/api-reference/fea392d1e2f4f-get-order-details
const result = await client.getOrderDetails('219233-chre53d41f940e0-58aqh94971');
Get the list of transactions for an order.
API documentation: https://developer.paddle.com/api-reference/89c1805d821c2-list-transactions
const orderTransactions = await client.getOrderTransactions(123);
const orderTransactionsNext = await client.getOrderTransactions(123, 2);
Optional
page: numberGet prices
API documentation: https://developer.paddle.com/api-reference/e268a91845971-get-prices
const result = await client.getPrices([123, 456]);
const result = await client.getPrices([123, 456], { coupons: ['EXAMPLE'], customerCountry: 'GB', customerIp: '127.0.0.1' });
Optional
options: { Optional
coupons?: string[]Optional
customerOptional
customerGet the current list of coupons for a product.
API documentation: https://developer.paddle.com/api-reference/6a59b795bd653-list-coupons
const coupons = await client.getProductCoupons(123);
Get the list of transactions for a product.
API documentation: https://developer.paddle.com/api-reference/89c1805d821c2-list-transactions
const productTransactions = await client.getProductTransactions(123);
const productTransactionsNext = await client.getProductTransactions(123, 2);
Optional
page: numberGet the current list of products.
API documentation: https://developer.paddle.com/api-reference/0f31bd7cbce47-list-products
s *
const products = await client.getProducts();
Get subscription modifiers.
API documentation: https://developer.paddle.com/api-reference/f575ab89eb18c-list-modifiers
const result = await client.getSubscriptionModifiers();
const result = await client.getSubscriptionModifiers({ subscriptionID: 123 });
Optional
options: { Optional
planID?: numberOptional
subscriptionID?: numberGet the list of all payments or payments for a subscription plan.
API documentation: https://developer.paddle.com/api-reference/80462f27b2011-list-payments
const payments = await client.getSubscriptionPayments();
const payments = await client.getSubscriptionPayments({ subscriptionID: 123 });
Legacy usage for backwards compatibility: pass planID as a number instead of options object
const payments = await client.getSubscriptionPayments(123);
Optional
options: number | { Get the plan based on its ID.
API documentation: https://developer.paddle.com/api-reference/a835554495295-list-plans
const plan = await client.getSubscriptionPlan(123);
Get a list of all the available subscription plans.
API documentation: https://developer.paddle.com/api-reference/a835554495295-list-plans
const plans = await client.getSubscriptionPlans();
Get the list of transactions for a subscription.
API documentation: https://developer.paddle.com/api-reference/89c1805d821c2-list-transactions
= *
const subscriptionTransactions = await client.getSubscriptionTransactions(123);
const subscriptionTransactionsNext = await client.getSubscriptionTransactions(123, 2);
Optional
page: numberGet the list of transactions for a user.
API documentation: https://developer.paddle.com/api-reference/89c1805d821c2-list-transactions
const userTransactions = await client.getUserTransactions(123);
const userTransactionsNext = await client.getUserTransactions(123, 2);
Optional
page: numberGet the current list of all users or users for a subscription plan.
API documentation: https://developer.paddle.com/api-reference/e33e0a714a05d-list-users
const users = await client.getUsers();
const users = await client.getUsers({ planID: 123 });
const users = await client.getUsers({ state: 'active' });
const users = await client.getUsers({ subscriptionID: 456 });
If you have a large amount of active users, you will need to create paginated calls to this function.
Optional
options: { Optional
page?: numberOptional
planID?: string | numberOptional
resultsOptional
state?: SubscriptionUserStateOptional
subscriptionID?: numberGet the list of latest webhooks history.
API documentation: https://developer.paddle.com/api-reference/7695d655c158b-get-webhook-history
const webhooksHistory = await client.getWebhooksHistory();
Change the due date of an upcoming subscription payment.
API documentation: https://developer.paddle.com/api-reference/fe93f28aa7f7e-reschedule-payment
const result = await client.reschedulePayment(123, new Date('2022-12-04'));
Update subscription details, quantity, price and or currency.
API documentation: https://developer.paddle.com/api-reference/e3872343dfbba-update-user
const result = await client.updateSubscriptionPlan(123, { quantity: 2 });
Optional
billOptional
currency?: stringOptional
keepOptional
passthrough?: stringOptional
pause?: booleanOptional
planID?: numberOptional
price?: numberOptional
prorate?: booleanOptional
quantity?: numberVerify a webhook alert data using signature and a public key to validate that it was indeed sent from Paddle.
For more details: https://paddle.com/docs/reference-verifying-webhooks
const client = new PaddleSDK('your-vendor-id', 'your-unique-api-key', 'your-public-key');
// inside an Express handler which uses express.bodyParser middleware
const isVerified = client.verifyWebhookData(req.body);
The object with all the parameters sent to the webhook
Generated using TypeDoc
Example