import DodoPayments from 'dodopayments';
const client = new DodoPayments({
bearerToken: 'My Bearer Token',
});
const checkoutSessionResponse = await client.checkoutSessions.create({
product_cart: [{ product_id: 'product_id', quantity: 0 }],
});
console.log(checkoutSessionResponse.session_id);
{
"checkout_url": "<string>",
"session_id": "<string>"
}
Unified endpoint for creating checkout sessions for all types of billing requirements.
import DodoPayments from 'dodopayments';
const client = new DodoPayments({
bearerToken: 'My Bearer Token',
});
const checkoutSessionResponse = await client.checkoutSessions.create({
product_cart: [{ product_id: 'product_id', quantity: 0 }],
});
console.log(checkoutSessionResponse.session_id);
{
"checkout_url": "<string>",
"session_id": "<string>"
}
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Checkout session successfully created
The response is of type object
.
Was this page helpful?