Skip to main content

Changing the Theme for a Checkout Session Created via the API

1

Create a Checkout Session

Create a Checkout Session by following our How to Create Checkout Session guide and obtain the url.
2

Switch to dark theme

To switch to the dark theme, append the query parameter theme=dark to your checkout session URL as obtained earlier. For example, if your checkout session URL is:
https://polar.sh/checkout/polar_c_ES7DwhlyvlYTPNaLiccKqiwJPda43FIzer
You should use:
https://polar.sh/checkout/polar_c_ES7DwhlyvlYTPNaLiccKqiwJPda43FIzer?theme=dark
The checkout session then looks like below:
3

Switch to light theme

Similarly, to switch to the light theme, append the query parameter theme=light to your checkout session URL.For example:
https://polar.sh/checkout/polar_c_ES7DwhlyvlYTPNaLiccKqiwJPda43FIzer?theme=light
The checkout session then looks like below:
1

Create a checkout link

Create a checkout link by referring to our Create a checkout link guide.
2

Switch to dark theme

To switch to the dark theme, append the query parameter theme=dark to your checkout link.For example, if your checkout link is:
https://sandbox-api.polar.sh/v1/checkout-links/polar_cl_QHMjrDLsORxLIRfyQlfyqF1TWUR6Cy4afVcd/redirect
You should use:
https://sandbox-api.polar.sh/v1/checkout-links/polar_cl_QHMjrDLsORxLIRfyQlfyqF1TWUR6Cy4afVcd/redirect?theme=dark
The checkout session then looks like below:
3

Switch to light theme

Similarly, to switch to the light theme, append the query parameter theme=light to your checkout link.For example:
https://sandbox-api.polar.sh/v1/checkout-links/polar_cl_QHMjrDLsORxLIRfyQlfyqF1TWUR6Cy4afVcd/redirect?theme=light
The checkout session then looks like below: