Standard discounts
Discount Ninja applies product, order and shipping discounts using Shopify functions. This results in standard discounts that are no different from discounts that are applied using out-of-the-box Shopify discount codes or Shopify automatic discounts.
Order object
Shopify provides a GraphQL Admin API that allows developers to query the Order object, documented here: https://shopify.dev/docs/api/admin-graphql/latest/objects/Order
The information provided below is based on the documentation of the 2025-04 version of Shopify's GraphQL Admin API. For any questions or issues with this API, please contact Shopify directly.
Discount information is available from the following properties of this object:
Product discounts: an order contains an array of LineItem objects, each of which has a property with the Discount Allocations
Order discounts: the cart discount amount property
The total order-level discount amount.
Shipping discounts: an order contains an array of ShippingLine objects, each of which has a discounted price set property
The shipping price after applying discounts.
Total discounts: the total discount set property
Additional information
If the information available in the Order object is not sufficient, you can enable additional information to be persisted in metafields associated with the Order.
This can be done in the menu of Discount Ninja: Settings > General > Orders > Metafields.
This feature adds data to orders that are discounted using Discount Ninja to document which offers were applied. The data is stored in JSON format in three metafields that can be used as input for custom integration logic.
These metafields are stored in the 'discountninja' namespace:
product_discounts: stores an array of objects with two properties.
The first property Key is the unique identifier of the order line item.
The second property Applications documents the product discounts that were applied to the line item. Each discount application is represented by an object with the following properties: DiscountCode, OfferToken, TriggerToken, Value
order_discounts: stores an array of objects that documents the order discounts that were applied to the order. Each discount application is represented by an object with the following properties: OfferToken, TriggerToken, Value
shipping_discounts: stores an array of objects that documents the shipping discounts that were applied to the order. Each discount application is represented by an object with the following properties: DiscountCode, PriceRuleTitle, PriceRuleId, OfferToken, TriggerToken