Checkout from your site or app
There are two ways to sell with Licensr:
- Your Licensr buy page (
/buy/<your-slug>): link to it and you are done. - Your own website or product: buyers click Buy on your pricing page or inside your app, pay on your payment provider's checkout, and come back to your website. This page covers that flow.
Both deliver the same way: after payment Licensr creates the license and emails the key (or your server does, if you send license emails yourself). You do not set up payment webhooks, and the customer pastes the key into your license screen as usual.
Paste this into Claude Code, Cursor, or a similar tool and it can do the integration for you.
Add a Buy button to my own site that sends buyers to Licensr checkout.
Follow https://docs.licensr.app/advanced/in-app-checkout and ask me for any value you need.
Keep secrets in environment variables on my server, never in code that ships to customers.
How it works
- Your server calls
POST /v1/billing/checkoutwith the plan, the buyer's email, and optionally where to send them afterwards. - Licensr returns
{ "checkout_url": "..." }. Redirect the buyer's browser to it. - After paying, the buyer lands on your
success_url(or Licensr's "thank you" page), and the license key arrives by email.
curl -s -X POST "https://api.licensr.app/v1/billing/checkout" \
-H "Authorization: Bearer $LICENSR_SERVER_KEY" \
-H "Content-Type: application/json" \
-d '{"plan_id": "<plan-id>", "customer_email": "buyer@example.com", "success_url": "https://your-site.example/thanks", "cancel_url": "https://your-site.example/pricing"}'
- Use a server key (
srv_live_…: pick On your own server when you create it). Call checkout from your own server and never embed that key in a distributed product or a web page. A Client key gets403 insufficient_scope. plan_id: click Copy ID next to the plan on the Products page.customer_email: where the license key is sent. Ask the buyer for it on your page.
See the checkout endpoint for every field.
Selling only this way? Turn your buy page off under Buy page in the dashboard. Checkout from your site keeps working, and /buy/<your-slug> is a page not found.
Terms and a note on the checkout page
With Stripe, two optional fields shape the hosted checkout page:
require_terms:trueadds a checkbox the buyer must tick, "I agree to your Terms of Service and Privacy Policy". The links come from the Terms and Privacy URLs in your Stripe account's public details, so set them there first.custom_text.submit: a short plain-text message (up to 1200 characters, no links) shown above the pay button, for example{"custom_text": {"submit": "Cancel any time from the customer portal."}}.
Your logo, icon, colors and business name also come from your Stripe account (Settings → Branding), for test and live checkouts alike.
Other payment providers don't support these fields. A request that sets either one answers 409 checkout_options_unsupported.
Custom return pages
By default the customer returns to Licensr's own "thank you" and "cancelled" pages after paying. To send them back to your website instead, pass success_url and cancel_url in the checkout request.
Each URL must use https and its website must be listed on the product, otherwise the request fails with 403 redirect_not_allowed:
- Browser products: add the website under Advanced options → Allowed websites.
- Native products (desktop apps, WordPress and other server-side code): add the website under Advanced options → Checkout return websites.
List each website as https://host[:port] with no path. * is not accepted for return pages.