Objects
The documentation below describes the API as of version 9.x of the script.
Public properties or functions that are not in the discountNinja.api
namespace should be considered obsolete and will be removed in the next major version release.
Using undocumented functions or objects will result in issues as custom code that relies on those functions or objects may break in the future when Discount Ninja's script is automatically updated.
Product variant price info
|
| The discount amount, expressed in cents. |
|
| The offer token, Shopify discount code or promotion code associated with the applied discount. |
|
| The discounted price, expressed in cents. |
|
|
|
|
|
|
|
| The token of the offer associated with the applied discount. |
|
| The original price (i.e. the price before discounts are applied), expressed in cents. |
|
| The discount percentage. |
|
| The handle of the product associated with the object. |
|
| The id of the selected selling plan for subscription products. |
|
| The token of the promotion associated with the applied discount. |
|
| The id of the selected variant. |
Entitlement info
|
| The token of the offer. |
|
| Indicates if the offer has been applied to the cart. |
|
| Set to " |
|
| |
|
| An array of objects that lists the line items that are considered prerequisites for this offer to apply.
Each object has two properties:
- |
|
| |
|
| The amount that is discounted. |
|
| Indicates at what level the offer discounts the cart. |
|
| The type of entitlement that is applied by the offer. |
|
| |
|
| A comma-separated list of variant ids the customer is entitled to. |
|
| A comma-separated list of collection handles the customer is entitled to. |
|
| A comma-separated list of product handles the customer is entitled to. |
|
| Set to |
|
| Set to |
|
| |
|
| The number of items the customer is entitled to. |
|
| The number of entitled items the customer has added to the cart. |
|
| An array of objects that lists the line items that are considered entitled items.
Each object has two properties:
- |
|
| An array of objects that lists the sets ( a group of prerequisites and entitlements). |
Discounted Cart
|
| The list of the product, discount and shipping promotions applied to the cart. |
|
| The token of the Discount Ninja offer. |
|
| The token of the Discount Ninja promotion. |
|
| The discount code if the discount is applied using a Shopify discount code. |
|
| The identifier of the Shopify price rule if the discount is applied using a Shopify discount code. |
|
| The discount amount, in cents. |
|
| The number of the tier of the offer that is applied. The first tier is |
|
| Indicates at what level the offer discounts the cart. |
|
| The ISO code of the currency of the cart. |
|
| The native Shopify discount code that is applied to the cart. |
|
| The list of line items in the cart. |
|
| The token of the Discount Ninja offer. |
|
| The token of the Discount Ninja promotion. |
|
| The discount code if the product discount is applied using a Shopify discount code. |
|
| The identifier of the Shopify price rule if the product discount is applied using a Shopify discount code. |
|
| |
|
| |
|
| The discount, in cents, per product. |
|
| The discount per product as a percentage. |
|
| |
|
| The discount for the cart line, in cents. |
|
| The discount for the cart line as a percentage. |
|
|
|
|
|
|
|
| |
|
| |
|
| The discounted price per product, in cents. |
|
| The original price per product, in cents. |
|
| The compare-at price per product, in cents. |
|
| |
|
| The discounted price for the cart line, in cents. |
|
| The compare-at price for the cart line, in cents. |
|
| The compare-at price for the cart line, in cents. |
|
| |
|
|
|
|
| A comma-separated list of collection identifiers associated with the product. |
|
| A comma-separated list of collection handles associated with the product. |
|
| The handle of the product. |
|
| The identifier of the product. |
|
| The identifier of the selling plan. |
|
| A comma-separated list of tags associated with the product. |
|
| The title of the variant. |
|
| The identifier of the variant. |
|
| The total order discount in cents. |
|
| The list of order discounts applied to the cart. |
|
| The token of the Discount Ninja offer. |
|
| The token of the Discount Ninja promotion. |
|
| The discount code if the order discount is applied using a Shopify discount code. |
|
| The identifier of the Shopify price rule if the order discount is applied using a Shopify discount code. |
|
| The discount amount, in cents. |
|
| The discount percentage. |
|
| The number of the tier of the offer that is applied. The first tier is |
|
| The list of line items affected by the order discount. |
|
| The type of discount. |
|
| An object containing information about the shipping discount that is applied to the cart. |
|
| The token of the Discount Ninja offer. |
|
| The token of the Discount Ninja promotion. |
|
| The discount code if the shipping discount is applied using a Shopify discount code. |
|
| The identifier of the Shopify price rule if the shipping discount is applied using a Shopify discount code. |
|
| Overview of the subtotal of the cart, after applying product discounts. |
|
| The discount in cents. This is the sum of all product discounts. |
|
| The subtotal in cents after product discounts. |
|
| The subtotal in cents before product discounts. |
|
| Overview of the total of the cart, after applying product and order discounts. |
|
| The discount in cents. This is the sum of all product and order discounts. |
|
| The total in cents after product and order discounts. |
|
| The total in cents before product and order discounts. |
|
| The token of the cart, provided by Shopify. |
Last updated