POST
/
checkouts
JavaScript
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>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Response

200
application/json

Checkout session successfully created

The response is of type object.