First, you’ll need a Lemon Squeezy account. If you haven’t already, please
Note: You can build your Lemon Squeezy integration while you're waiting for store approval. You have full access to our Dashboard and APIs in test mode.
Read our Getting Started guide to get your Lemon Squeezy account set up.
Create an API key
To get started with the API, you will need an API key, which you can create from Settings > API.
Create a new API key with a custom name. If you plan to use multiple API keys, make sure you use names that make sense to you and your team (you can't edit names later on).
The API key is shown to you after you submit the form. Copy it somewhere secure, as each key is only ever shown to you once in the Lemon Squeezy dashboard.
Make sure you keep your API keys private. Never save API keys in your code or in Github. Instead use environment files and, for an extra level of security, rotate API keys regularly.
If you ever have issues with losing an API key, you can always create and delete keys from Settings > API in your Lemon Squeezy dashboard.
The Lemon Squeezy API can be accessed from
https://api.lemonsqueezy.com/v1/. All requests should be made over HTTPS and every request requires authentication.
The API is based on the JSON:API spec and as such you are required to add the following headers in each request.
The API uses Bearer authentication for all requests. You will need an API key from Settings > API.
To authenticate, add an Authorization header to all requests containing a valid API key:
In total, you need three headers (
Authorization) when making requests to our API.
For more information about authentication and rate limiting, please visit the API reference.
The Lemon Squeezy API covers all data types used in your store such as Products, Customers, Discounts and Files.
You can use the API to manage your store as well as set up payments for customers, access prior orders and manage ongoing subscriptions and software license keys.
Some examples of what’s possible with the API:
- Show what you're selling inside your app
- Create checkout links to sign up new subscribers
- Create custom-priced checkouts for certain customers
- Access customer details and a list of their previous orders
- Create discount codes on-the-fly
- Activate and validate license keys
- Upgrade, downgrade, cancel, resume, pause and un-pause subscriptions
As per the JSON:API spec, responses will contain object data along with references to all relationships and optional "included" data.
Webhooks allow your application to stay in sync with your billing system as events happen in Lemon Squeezy.
Download packages for your app that make it easy to interface with the Lemon Squeezy API.