Applied discounts
An applied discount records a discount applied to an invoice, checkout session or line item, with the name, code and terms it had at the time. Renaming or deleting the discount doesn’t change past transactions.
The AppliedDiscount object
- Name
object
- Type
- "applied_discount",
- Description
- The object's type.
- Name
id
- Type
- string,
- Description
- Unique identifier for the object.
- Name
live
- Type
- boolean,
- Description
trueif the object is live, orfalseif it's in a sandbox.
- Name
created_at
- Type
- integer,
- Description
- When the object was created, in milliseconds since the Unix epoch.
- Name
amount_off
- Type
- integer or null,
- Description
- The amount off in cents when the discount was applied.
- Name
code
- Type
- string or null,
- Description
- The code the customer entered, or
nullwhen it was applied without one.
- Name
customer
- Type
- string or Customer or null,
- Description
- Expandable. The customer the discount was applied for.
- Name
discount
- Type
- string or Discount or null,
- Description
- Expandable. The discount this was applied from.
- Name
name
- Type
- string,
- Description
- The discount's name when it was applied.
- Name
percent_off
- Type
- number or null,
- Description
- The percentage off when the discount was applied.
- Name
target
- Type
- enum,
- Description
- What the discount applies to. Only discounts from a connected Shopify store apply to
shipping. - Properties
The AppliedDiscount object
Get an applied discount
Retrieve an applied discount by its ID.
Required parameters
- Name
id
- Type
- string,
- Description
- The ID of the applied discount to retrieve.
Optional parameters
- Name
expand
- Type
- object,
- Description
- Related objects to expand in the response.
- Properties
Returns
Returns the applied discount object.
Retrieve an applied discount
Response example
List all applied discounts
Retrieve a paginated list of applied discounts, most recently created first.
Optional parameters
- Name
expand
- Type
- object,
- Description
- Related objects to expand in the response.
- Properties
- Name
ending_before
- Type
- string,
- Description
- The ID of the object to list before, for pagination.
- Name
starting_after
- Type
- string,
- Description
- The ID of the object to list after, for pagination.
- Name
limit
- Type
- integer, at least 1, at most 1000, default is 50
- Description
- The maximum number of objects to return, from 1 to 1000. Defaults to 50.
- Name
filters
- Type
- object, object, or object,
- Description
- Properties
Returns
Returns a list of applied discount objects.