import { whopSdk } from "@/lib/whop-sdk";
const result = await whopSdk.payments.createCheckoutSession({
// The affiliate code to use for the checkout session
affiliateCode: "some string",
// The metadata to use for the checkout session
metadata: { any: "json" },
// The ID of the plan to use for the checkout session
planId: "xxxxxxxxxxx" /* Required! */,
// The URL to redirect the user to after the checkout session is created
redirectUrl: "some string",
});
Example output:
const response = {
// The ID of the checkout session
id: "xxxxxxxxxxx",
// The ID of the plan to use for the checkout session
planId: "xxxxxxxxxxx",
};
Was this page helpful?
import { whopSdk } from "@/lib/whop-sdk";
const result = await whopSdk.payments.createCheckoutSession({
// The affiliate code to use for the checkout session
affiliateCode: "some string",
// The metadata to use for the checkout session
metadata: { any: "json" },
// The ID of the plan to use for the checkout session
planId: "xxxxxxxxxxx" /* Required! */,
// The URL to redirect the user to after the checkout session is created
redirectUrl: "some string",
});
Example output:
const response = {
// The ID of the checkout session
id: "xxxxxxxxxxx",
// The ID of the plan to use for the checkout session
planId: "xxxxxxxxxxx",
};
Was this page helpful?