theme object when creating a checkout session and the returned checkout URL will include the theme parameters automatically.
Interactive playground
Use the playground below to experiment with different theme configurations. Copy the generated theme object to include in your create-checkout-session API call.How theming works
Include atheme object in the request body when calling POST /checkout/sessions. The returned checkout_url and checkout_url_with_token will have the theme parameters appended as URL query parameters so the widget renders with your custom look on first load.
Only the keys you include in the
theme object are applied; all other
properties use their defaults.Parameter reference
Color parameters
Colors accept hex (#RRGGBB, RRGGBB, #RGB) or rgb(r, g, b) format. Background colors automatically derive an accessible foreground color unless you provide an explicit override.
| Parameter | Description | Auto-derives foreground |
|---|---|---|
primaryColor | Buttons, links, primary accents | Yes (primaryButtonTextColor) |
primaryButtonTextColor | Override: text on primary buttons | N/A (explicit override) |
backgroundColor | Page background | Yes (foregroundColor) |
foregroundColor | Override: main text color | N/A (explicit override) |
cardColor | Card and popover surfaces | Yes |
secondaryColor | Secondary elements | Yes |
mutedColor | Muted backgrounds | Yes |
accentColor | Accent highlights | Yes |
destructiveColor | Error states | Yes |
borderColor | Borders and input outlines | No |
successColor | Success indicators | No |
warningColor | Warning indicators | No |
Integration example
Node.js
Next steps
Iframe integration
Set up the iframe and handle payment events.
Create checkout session
Full API reference for creating sessions with theme support.
