Dashboard

Manage your stores

Checkout API

Generate secure Stripe checkout sessions.

Create Checkout Session

Converts a Cart into a Stripe Checkout URL. Redirect the user to this URL to complete payment.

Initiate Checkout
const session = await swat.checkout.create(cartId, {
  successUrl: 'https://mystore.com/success',
  cancelUrl: 'https://mystore.com/cart'
});

// Redirect user to payment page
window.location.href = session.url;

Prerequisites

You must connect your Stripe account in the Billing tab of the dashboard before this API will work. Transactions will fail if no payment provider is configured.