Extension

Lemon Squeezy beta

Read your Lemon Squeezy orders, customers, license keys and other data from your stores

by Dashkit

Download

One-time download. No subscription.

This extension is currently in free beta. Note that the functionality can still be incomplete and that the tables can still change.

  • Version 0.1.0
  • Operating systems Linux & Mac (ARM)

This SQLite extension connects to your Lemon Squeezy stores via REST API, allowing you to easily query their latest orders, customers, licenses, and other other information with a live connection.

Example

select strftime('%Y-%m', created_at) as month, count(*) as orders from lemon_order group by month; ┌─────────┬────────┐ │ month │ orders │ ├─────────┼────────┤ │ 2025-06 │ 45 │ └─────────┴────────┘

Key points

  • Calls Lemon Squeezy directly from your local machine
  • Works with any SQLite program or programming language
  • Uses read-only calls, throttled and safeguarded
  • Fast in-memory cache with a five minute expiry
  • One-time download, no subscription needed
  • Lifetime updates

Tables 19

lemon_affiliate

All affiliates

Column Type Description
affiliate_id int Affiliate ID
store_id int Store ID
user_id int Affiliate owner user ID
name text Affiliate full name
email text Affiliate email
domain text Domain for product promotion
status text Status
earnings real Total earnings
unpaid real Unpaid earnings
products json Products enabled for affiliate
application_note text Application note
created_at datetime Created at
updated_at datetime Updated at
lemon_checkout

Custom checkout pages

Column Type Description
checkout_id text Checkout ID
store_id int Store ID
variant_id text Variant ID
custom_price real Custom price
product_options json Product options
checkout_options json Checkout options
checkout_data json Prefill or custom data
expires_at datetime Expires at
checkout_url text Checkout URL
created_at datetime Created at
updated_at datetime Updated at
test_mode bool Whether created in test mode
lemon_customer

All customers

Column Type Description
customer_id text Customer ID
store_id int Store ID
name text Full name
email text Email
status text Email marketing status
city text City name
region text Region
country text Country ISO 3166 code
revenue real Total sales revenue (USD)
mrr real Monthly recurring revenue (USD)
portal_url text Portal URL
test_mode bool Whether created in test mode
lemon_discount

All discounts

Column Type Description
discount_id int Discount ID
store_id int Store ID
name text Name
code text Checkout code, 3-256 chars
status text Status
amount_type text Amount type
amount_percent real Percent value for percent type
amount_fixed real Fixed value for fixed type
limit_products bool Whether only for specific products
limit_redemptions bool Whether to limit redemption times
max_redemptions int Maximum redemption times
starts_at datetime Discount starts at
expires_at datetime Discount ends at
duration text How often discount is applied to a subscription
duration_months int Number of months to apply a repeating discount
created_at datetime Created at
updated_at datetime Updated at
test_mode bool Whether created in test mode
lemon_discount_redemption

All discount redemptions

Column Type Description
discount_redemption_id int Discount redemption ID
discount_id int Discount ID
order_id int Order ID
name text Discount name
code text Discount code
amount_type text Discount amount type
amount_percent real Value for percent discount
amount_fixed real Value for fixed discount
amount_order real Applied discount amount in order currency
created_at datetime Created at
updated_at datetime Updated at
lemon_file

All downloadable files

Column Type Description
file_id int File ID
variant_id int Variant ID
identifier text Identifier
name text Filename
status text Status
extension text Filename extension
size int Filesize in bytes
version text Software version number
download_url text Temporary download URL
created_at datetime Created at
updated_at datetime Updated at
test_mode bool Whether created in test mode
lemon_license_key

All license keys

Column Type Description
license_key_id int License key ID
store_id int Store ID
customer_id int Customer ID
order_id int Order ID
order_item_id int Order item ID
product_id int Product ID
customer_name text Customer name
customer_email text Customer email
key_short text Short license key
key_full text Full license key
status text Status
activation_times int Activation times
activation_limit int Activation limit
expires_at datetime Expires at
created_at datetime Created at
updated_at datetime Updated at
lemon_license_key_instance

All license key instances or activations

Column Type Description
license_key_instance_id int License key instance ID
license_key_id int License key ID
identifier text Identifier
name text Instance name
created_at datetime Created at
updated_at datetime Updated at
lemon_order

All orders

Column Type Description
order_id int Order ID
store_id int Store ID
customer_id int Customer ID
identifier text Identifier
order_number int Sequential order number
status text Order status
customer_name text Customer name
customer_email text Customer email
currency text ISO 4217 currency code
currency_rate real Currency rate in USD at purchase time
total real Total cost
subtotal real Subtotal
setup_fee real Setup fee
discount real Total discount applied
tax real Total tax applied
refunded real Refunded amount
total_usd real Total cost (USD)
subtotal_usd real Subtotal (USD)
setup_fee_usd real Setup fee (USD)
discount_usd real Total discount applied (USD)
tax_usd real Total tax applied (USD)
refunded_usd real Refunded amount (USD)
tax_name text Name of tax rate
tax_rate real Tax rate applied
tax_inclusive bool Whether order prices included tax
refunded_at datetime Refunded at
receipt_url text Customer facing receipt URL
created_at datetime Created at
updated_at datetime Updated at
test_mode bool Whether created in test mode
lemon_order_item

Order items for each order

Column Type Description
order_item_id int Order item ID
order_id int Order ID
product_id int Product ID
variant_id int Variant ID
product_name text Product name
variant_name text Variant name
price real Item price in order currency
quantity int Item quantity
created_at datetime Created at
updated_at datetime Updated at
lemon_price

Prices for each variant

Column Type Description
price_id int Price ID
variant_id int Variant ID
category text Variant category
tax_code text Product tax category
scheme text Pricing model
usage_aggregation text Usage aggregation type for usage-based billing
price real Unit price without usage aggregation
price_usage real Unit price with usage aggregation
package_size int Number of units in each package
setup_fee real Setup fee
use_setup_fee bool Whether to use setup fee
renew_interval int Subscription billing interval
renew_unit text Subscription billing interval unit
trial_interval int Free trial length
trial_unit text Free trial length unit
min_price real Minimum price for Pay what you want
suggest_price real Suggested price for Pay what you want
created_at datetime Created at
updated_at datetime Updated at
lemon_price_tier

Pricing tiers for each variant price

Column Type Description
price_id int Price ID
last_unit int Top limit of this tier, null for highest-level
price real Unit price without usage aggregation
price_usage real Unit price with usage aggregation
fixed_fee real Fixed fee charged with unit price
lemon_product

All products

Column Type Description
product_id int Product ID
store_id int Store ID
name text Name
slug text Slug
status text Status
price real Product price
min_price real Lowest variant price
max_price real Highest variant price
use_pwyw bool Whether to accept price from customer
description text Description
buy_now_url text Product purchase URL using Lemon Squeezy checkout
thumb_url text Thumbnail URL (100x100px)
large_thumb_url text Thumbnail URL (1000x1000px)
created_at datetime Created at
updated_at datetime Updated at
test_mode bool Whether created in test mode
lemon_store

All stores

Column Type Description
store_id int Store ID
name text Name
slug text Slug
domain text Domain
plan text Billing plan
country text Country ISO 3166 code
currency text ISO 4217 currency code
sales int Number of sales
revenue real Total revenue (USD)
last_30d_sales int Number of sales from last 30 days
last_30d_revenue real Revenue from last 30 days
store_url text Store URL
avatar_url text Avatar URL
lemon_subscription

All subscriptions

Column Type Description
subscription_id int Subscription ID
store_id int Store ID
customer_id int Customer ID
order_id int Order ID
order_item_id int Order item ID
product_id int Product ID
variant_id int Variant ID
product_name text Product name
variant_name text Variant name
customer_name text Customer name
customer_email text Customer email
status text Status
billing_anchor int Day of month for payments
processor text Payment processor
card_brand text Card brand used in last payment
card_last_4 text Last 4 digits from card used in last payment
pause_mode text Pause mode
resumes_at datetime Resumes at
trial_ends_at datetime Trial ends at
renews_at datetime When next invoice is issued
ends_at datetime Subscription expires at
billing_url text URL to subscription billing in customer portal
created_at datetime Created at
updated_at datetime Updated at
test_mode bool Whether created in test mode
lemon_subscription_invoice

Invoices for each subscription

Column Type Description
subscription_invoice_id int Subscription invoice ID
store_id int Store ID
subscription_id int Subscription ID
customer_id int Customer ID
customer_name text Customer name
customer_email text Customer email
billing_reason text Reason for generating invoice
status text Status
card_brand text Card brand used in payment
card_last_4 text Last 4 digits from card used in payment
currency text ISO 4217 currency code
currency_rate real Currency rate in USD at payment time
total real Total cost
subtotal real Subtotal
discount real Total discount applied
tax real Total tax applied
refunded real Refunded amount
total_usd real Total cost (USD)
subtotal_usd real Subtotal (USD)
discount_usd real Total discount applied (USD)
tax_usd real Total tax applied (USD)
refunded_usd real Refunded amount in USD
tax_inclusive bool Whether invoice prices included tax
refunded_at datetime Refunded at
invoice_url text Customer facing invoice URL
created_at datetime Created at
updated_at datetime Updated at
test_mode bool Whether created in test mode
lemon_subscription_item

Items for each subscription

Column Type Description
subscription_item_id int Subscription item ID
subscription_id int Subscription ID
price_id int Price ID
quantity int Item quantity
is_usage_based bool Whether subscription product uses usage-based billing
created_at datetime Created at
updated_at datetime Updated at
lemon_usage_record

Usage records for subscription items with usage-based billing

Column Type Description
usage_record_id int Usage record ID
subscription_item_id int Subscription item ID
action text Action type
quantity int Usage quantity
created_at datetime Created at
updated_at datetime Updated at
lemon_variant

All product variants

Column Type Description
variant_id int Variant ID
product_id int Product ID
name text Name
slug text Slug
status text Status
use_license_keys bool Whether to generate license keys on purchase
limit_activation bool Whether to limit license key activations
activation_limit int License key activation limit
limit_license_length bool Whether to limit license length
license_length int License length
license_length_unit text License length unit
created_at datetime Created at
updated_at datetime Updated at
test_mode bool Whether created in test mode

Configuration

Every new SQLite connection should call function lemon_config with authentication details. This information is not saved, and kept in-memory for the duration of the connection.

select lemon_config('api_key: ..');

  • api_key API key to your Lemon Squeezy account
  • prefix Prefix for table names, defaults to lemon_

FAQ

For any questions, support, or feedback regarding this extension, please contact support

Why use SQLite extensions?

SQLite extensions can make your development faster and more efficient. They are helpful for both developers and users who are comfortable with SQL. Extensions provide privacy, control, and locality to your data and credentials. Read more

Why should I try this beta extension?

This extension is currently available for free to anyone who wants to try the Lemon Squeezy extension. If you send your feedback to support, you will receive the personal version for free when it is released.

Where do I find my Lemon Squeezy API key?
Please refer to Lemon Squeezy documentation for detailed instructions. Your API key is used only to read data from the Lemon Squeezy REST API.
How quickly can I fetch Lemon Squeezy data?
This extension uses the Lemon Squeezy rate limit for maximum of 300 requests over 60 seconds, translating to theoretical maximum of 30k rows.
What other software do I need?

You will need either Linux or Mac (ARM) 64-bit operating system. Windows is currently not supported.

In addition, you should have SQLite version 3.45.1 or newer installed, with support for extensions.

How do I receive updates?

We will email you when an update to the same extension version has been released.