Discount

List the discounts in a workspace.

get/workspaces/{workspace_id}/discounts

Request

Path parameters

workspace_idstring required

Query parameters

afterstring

ID of item after which the collection should be returned. More examples and info about pagination in our guides.

per_pageinteger

Records per page. Defaults to 20; raise it up to 100 for bulk reads. A larger value returns 100 records. Zero, a negative or a non-integer value is a 422. The Link next-page URL keeps the value, so a client following it keeps the page size. More in our guides.

sort_order'asc' | 'desc'

Sort order of a list response. Use 'desc' to reverse the default 'asc' (ascending) sort order. Examples in our guides.

sort_property'id' | 'updated_at'

Sort property of a list response. The default is id and thus the created_at order. If you sort by other properties, we additionally sort by id implicitly as a secondary sort property, so that you can rely on the sort order to be deterministic even if the main sort property ends up with the same values.

idstring

A comma-separated list of discount IDs to filter by.

codestring

Filter by discount code (exact match).

discount_typestring

Filter by discount type (code, automatic, sale).

discount_methodstring

Filter by discount method (percentage, fixed, shipping, bogo).

applies_tostring

Filter by scope (all_products, specific_products, specific_variants, specific_collections).

Filter by available properties in query params, like this: api/v2/resources?filter[id]=value&filter[another_property]=value1,value2. Check our Filtering guide for examples and all about filtering here.

{
  "id": "1,2,3"
}

Response

OK

idinteger

Discount ID

public_idstring nullable

Discount public ID

workspace_idinteger

Workspace ID

namestring

Internal name for the discount.

codestring

The code a buyer redeems at checkout. Uppercased on save; unique within the workspace (cannot collide with a coupon code).

discount_type'code' | 'automatic' | 'sale'

code (the default) is a redeemable coupon code. automatic and sale are deprecated.

discount_method'percentage' | 'fixed' | 'shipping' | 'bogo'

How the discount is calculated. percentage uses percent; fixed uses amount. shipping and bogo exist but are outside the simple flow.

amountstring nullable

Fixed amount off, as a decimal string (e.g. "10.00"). null for a percentage discount.

percentstring nullable

Percentage off between 0.01 and 100 (e.g. "20.0"). null for a fixed discount.

currencystring

ISO currency code, lowercased. Defaults to the workspace currency.

applies_to'all_products' | 'specific_products' | 'specific_variants' | 'specific_collections'

Scope of the discount. all_products (the default) applies workspace-wide; the specific_* values restrict it to the ids passed in product_ids / variant_ids / products_collection_ids.

apply_fromstring date-time

When the discount becomes active. Defaults to the creation time.

apply_untilstring date-time nullable

When the discount expires. null means it never expires.

limit_1_per_customerboolean

When true, each contact can redeem the discount only once.

require_minimum_spendboolean

When true, the order must meet require_minimum_spend_amount for the discount to apply.

require_minimum_spend_amountinteger nullable

Minimum order subtotal required, when require_minimum_spend is true. In whole currency units, not cents - 50 on a usd discount means $50.

discounts_per_redemptioninteger nullable

Optional cap on how many line items a single redemption discounts.

redemptions_countinteger

How many times the discount has been redeemed on an invoice. On Stripe every invoice counts, renewals included; on Payments AI each customer redemption counts once, however many renewal invoices it covers. This is not a deletability signal - a discount can report zero redemptions and still return 422 on DELETE because it is applied to an order that has no invoice yet.

product_idsinteger[]

The products the discount is scoped to (empty unless applies_to is specific_products).

variant_idsinteger[]

The variants the discount is scoped to (empty unless applies_to is specific_variants).

products_collection_idsinteger[]

The collections the discount is scoped to (empty unless applies_to is specific_collections).

activeboolean

Derived - true when the discount is neither scheduled for the future nor expired.

expiredboolean

Derived - true when apply_until is in the past. An expired discount is frozen - every further update returns 422, so rename before you expire.

scheduledboolean

Derived - true when apply_from is in the future.

created_atstring date-time nullable

Added

updated_atstring date-time nullable

Updated

Example response

[
  {
    "id": 771,
    "public_id": "gBEDMo",
    "workspace_id": 42000,
    "name": "Launch 20",
    "code": "LAUNCH20",
    "discount_type": "code",
    "discount_method": "percentage",
    "amount": null,
    "percent": "20.0",
    "currency": "usd",
    "applies_to": "all_products",
    "apply_from": "2025-01-01T00:00:00.000Z",
    "apply_until": null,
    "limit_1_per_customer": false,
    "require_minimum_spend": false,
    "require_minimum_spend_amount": null,
    "discounts_per_redemption": null,
    "redemptions_count": 0,
    "product_ids": [],
    "variant_ids": [],
    "products_collection_ids": [],
    "active": true,
    "expired": false,
    "scheduled": false,
    "created_at": "2025-01-01T00:00:00.000Z",
    "updated_at": "2025-01-01T00:00:00.000Z"
  }
]

Changes