Lemon Squeezy

List products and create checkout links with Lemon Squeezy.

Finance and paymentsAPI key7 actionsAll integrations

On this page
  1. Connect
  2. Call it from a workflow
  3. Actions (7)
  4. create_checkout
  5. custom_api_call
  6. get_order
  7. list_customers
  8. list_orders
  9. list_products
  10. list_subscriptions
  11. Details

Connect

Auth type: API key (secret_text). Pass the provider's API key or token as the connection's credential. It is sealed at rest and only opened on the server when an action runs.

  • From your agent: integrations {action: "connect", piece, credentials, env} stores the credentials for dev, prod or all. Answers name the fields, never the values.
  • Or set the integration's project secrets with the secrets tool (SLACK_BOT_TOKEN, DISCORD_WEBHOOK_URL, TELEGRAM_BOT_TOKEN, TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN …): a call uses the connection, else those secrets. integrations {action: "catalog", piece} lists which ones work.
  • Try one action now with integrations {action: "call", piece, piece_action, input}. It really sends.

Call it from a workflow

step.ctx.integrations.invoke("lemon-squeezy", action, input) resolves with the provider's answer and rejects when Lemon Squeezy isn't connected or refuses. Wrap it in step.run so a retry sends once. See step.ctx. Its actions run through the integration runner, which the server's operator turns on: integrations {action: "catalog", piece: "lemon-squeezy"} says whether yours can call it.

Workflow
// workflows/notify.ts: call Lemon Squeezy when a booking is confirmed
import { on } from "@appbricx/workflows";

export const tellLemonsqueezy = on.transition("booking", "status", "confirmed", async (_event, step) => {
  // Recorded once: a retry doesn't send it twice. Rejects when Lemon Squeezy isn't connected.
  const output = await step.run("Lemon Squeezy", () =>
    step.ctx.integrations.invoke("lemon-squeezy", "create_checkout", {
      "storeId": "<storeId>",
      "variantId": "<variantId>"
    }),
  );
  step.ctx.log("Lemon Squeezy answered", output);
});
Try it from your agent
{
  "name": "integrations",
  "arguments": {
    "project_id": "<project-id>",
    "action": "call",
    "piece": "lemon-squeezy",
    "piece_action": "create_checkout",
    "input": {
      "storeId": "<storeId>",
      "variantId": "<variantId>"
    },
    "env": "dev"
  }
}
From another backend (connector proxy)
curl -X POST "$APP_ORIGIN/__appbricx/connector-proxy/lemon-squeezy/create_checkout" \
  -H "Authorization: Bearer $APP_KEY" \
  -H "content-type: application/json" \
  -d '{"props":{"storeId":"<storeId>","variantId":"<variantId>"}}'

Actions

create_checkout

Create Checkout. Create a checkout URL for a specific Lemon Squeezy product variant.

InputTypeDescription
storeIdrequiredid (picked from your account)The store the checkout belongs to.
productIdoptionalid (picked from your account)Select a product to filter the variant list below.
variantIdrequiredid (picked from your account)The product variant to create a checkout for.
customerEmailoptionaltextPre-fill the customer email address on the checkout page.
customerNameoptionaltextPre-fill the customer name on the checkout page.
customPriceoptionalnumberOverride the product price in the smallest currency unit (e.g. 999 = $9.99). Only works if custom prices are enabled on the variant.
discountCodeoptionaltextPre-apply a discount code to the checkout.
redirectUrloptionaltextURL to redirect the customer to after a successful purchase.
expiresAtoptionaltextISO 8601 datetime when this checkout URL expires (e.g. 2024-12-31T23:59:59Z). Leave empty for no expiry.
customDataoptionalJSONKey-value pairs of custom data to attach to the order (accessible via webhooks).

custom_api_call

Custom API Call. Make a custom API call to a specific endpoint

InputTypeDescription
urlrequiredobject (depends on other props)url
methodrequiredone of "GET" | "POST" | "PATCH" | "PUT" | "DELETE" | "HEAD"Method
headersrequiredobjectAuthorization headers are injected automatically from your connection.
queryParamsrequiredobjectQuery Parameters
body_typeoptionalone of "none" | "json" | "form_data" | "raw"Body Type
bodyoptionalobject (depends on other props)Body
response_is_binaryoptionalbooleanEnable for files like PDFs, images, etc.
failsafeoptionalbooleanNo Error on Failure
timeoutoptionalnumberTimeout (in seconds)
followRedirectsoptionalbooleanFollow redirects

get_order

Get Order. Retrieve the details of a specific order by its ID.

InputTypeDescription
orderIdrequiredid (picked from your account)Select the order to retrieve.

list_customers

List Customers. Retrieve a paginated list of customers from your Lemon Squeezy store.

InputTypeDescription
storeIdoptionalid (picked from your account)Filter customers by store. Leave empty to return customers from all stores.
emailoptionaltextFilter customers by their email address.
pageoptionalnumberPage number for pagination (starts at 1).
perPageoptionalnumberNumber of customers to return per page (1–100). Default is 10.

list_orders

List Orders. Retrieve a paginated list of orders from your Lemon Squeezy store, with optional filters.

InputTypeDescription
storeIdoptionalid (picked from your account)Filter orders by store. Leave empty to return orders from all stores.
userEmailoptionaltextFilter orders by customer email address.
statusoptionalone of "" | "pending" | "failed" | "paid" | "refunded" | "partial_refund" | "chargedback"Filter orders by status.
pageoptionalnumberPage number for pagination (starts at 1).
perPageoptionalnumberNumber of orders to return per page (1–100). Default is 10.

list_products

List Products. Retrieve a paginated list of products from your Lemon Squeezy store.

InputTypeDescription
storeIdoptionalid (picked from your account)Filter products by store. Leave empty to return products from all stores.
pageoptionalnumberPage number for pagination (starts at 1).
perPageoptionalnumberNumber of products to return per page (1–100). Default is 10.

list_subscriptions

List Subscriptions. Retrieve a paginated list of subscriptions from your Lemon Squeezy store.

InputTypeDescription
storeIdoptionalid (picked from your account)Filter subscriptions by store.
orderIdoptionalid (picked from your account)Filter subscriptions by order.
orderItemIdoptionaltextFilter subscriptions by a specific order item ID.
productIdoptionalid (picked from your account)Filter subscriptions by product.
variantIdoptionalid (picked from your account)Filter subscriptions by variant.
userEmailoptionaltextFilter subscriptions by customer email address.
statusoptionalone of "" | "on_trial" | "active" | "paused" | "past_due" | "unpaid" | "cancelled" | "expired"Filter subscriptions by status.
pageoptionalnumberPage number for pagination (starts at 1).
perPageoptionalnumberNumber of subscriptions to return per page (1–100). Default is 10.

Details

Id
lemon-squeezy
Category
Finance and payments
Tags
payments, digital-products, subscriptions, checkout
Package
@activepieces/piece-lemon-squeezy@0.1.5
Runs
Through the integration runner