Lemon Squeezy icon

Lemon Squeezy

Interact with Lemon Squeezy API

Discount → Get Many

AI-generated

Summary

Retrieves discounts from Lemon Squeezy, either all of them via automatic pagination or up to a set limit, with optional status and store filters, sorting, and related-resource inclusion.

Inputs

  • Return All — When on, follows pagination to fetch every discount. Default is off.
  • Limit — Maximum number of results (1–100, default 50). Shown only when Return All is off.
  • Filters — Optional filters: Status (Any, Draft, Published) and Store ID. They are sent to the API as filter[...] query parameters.
  • Advanced Options — Optional Sort Field (Created At or Updated At), Sort Direction (asc or desc, default desc), Pagination Timeout in seconds for Return All (default 300, 0 means no timeout), and Include Related (Store, Discount Redemptions).
  • Simplify — When on (default), flattens JSON:API attributes to the top level of each item, along with id and type. When off, returns the raw JSON:API structure with type, attributes, and relationships.
  • Retry Options — Max Retries (default 3, 0 disables) and Initial Delay in ms (default 1000, doubles on each retry) for failed API requests.

Output shape

A list of discount items, one n8n item per discount. Each is flattened (id, type, attributes) when Simplify is on, or in raw JSON:API form when it is off.

With Return All off, results are capped by Limit (max 100). With Return All on, the run stops if the Pagination Timeout is exceeded. Included related resources (store, discount redemptions) are merged under their relationship names when simplified. Rate-limit (429) and 5xx/network errors are retried according to the Retry Options.

Examples

Example 1: List all published discounts for one store, newest first

Return All on; Filters: Status = Published, Store ID = your store ID; Advanced Options: Sort Field = Created At, Sort Direction = Descending.

Example 2: Get the 10 most recently updated discounts with their redemptions

Return All off; Limit = 10; Advanced Options: Sort Field = Updated At, Include Related = Discount Redemptions.

Links

Discussion