Applied discounts
Applied discounts are immutable records created when a reusable discount or Shopify discount is applied to an invoice or checkout session. Each record snapshots the name, entered code, and economic terms at the time of application, so later discount changes do not alter historical transactions.
The Applied Discounts API is read-only. Create discounts to define reusable terms, then apply a discount by ID or redeem its code. The applied discount’s discount field references the reusable Bias discount that produced it, while its nullable code field snapshots a Bias or Shopify customer-entered code. Shopify applied discounts have no reusable Bias discount reference.
The AppliedDiscount object
- Name
object
- Type
- "applied_discount",
- Description
- Literal representing the object's type.
- Name
id
- Type
- string,
- Description
- Unique identifier for the object.
- Name
live
- Type
- boolean,
- Description
- Has the value
trueif the object exists in a production environment or the valuefalseif the object exists in a sandbox environment.
- Name
created_at
- Type
- integer,
- Description
- Time at which the object was created. Measured in milliseconds since the Unix epoch.
- Name
amount_off
- Type
- integer or null,
- Description
- The snapshotted fixed discount amount in cents.
- Name
code
- Type
- string or null,
- Description
- The code entered by the customer when this discount was code-redeemed.
- Name
customer
- Type
- string or Customer or null,
- Description
- Expandable. The customer associated with this redemption.
- Name
discount
- Type
- string or Discount or null,
- Description
- Expandable. The reusable discount used to create this applied discount.
- Name
name
- Type
- string,
- Description
- The snapshotted display name.
- Name
percent_off
- Type
- number or null,
- Description
- The snapshotted percentage discount amount.
- Name
target
- Type
- enum,
- Description
- Whether the discount applies to merchandise or 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,
- Properties
Returns
Returns the applied discount object.
Retrieve an applied discount
Response example
List all applied discounts
Returns a list of applied discounts in reverse chronological order, with the most recently created records appearing first. Filter by discount, code, customer, name, or creation date.
Optional parameters
- Name
expand
- Type
- object,
- Properties
- Name
ending_before
- Type
- string,
- Description
- A cursor for use in pagination.
ending_beforeis an object ID that results will end before. Used to move backward through the list.
- Name
starting_after
- Type
- string,
- Description
- A cursor for use in pagination.
starting_afteris an object ID that results will start after. Used to move forward through the list.
- Name
limit
- Type
- number, at least 1, at most 1000, default is 50
- Description
- Maximum number of objects to return.
- Name
filters
- Type
- object, object, or object,
- Description
- Filters to apply to the list. Combine multiple conditions with
andandor. - Properties
Returns
Returns a list of applied discount objects.