Shopify Order Api discount not showing for the Product in api response

Topic summary

A developer is struggling to retrieve product-level discount information from Shopify’s Order API. The specific issue involves a product with a compare-at price of 990 and a sale price of 890, but the API response doesn’t include parameters showing the original compare-at price or indicating the price difference.

Current API Response Issues:

  • No compare-at price field in the response
  • Missing indicators for product-level discounts
  • Developer needs this data to integrate with another API that requires discount information

Suggested Solution:
Another user recommends checking the discount_allocations array within line_items in the Order API response, providing a code example showing how discounts appear when present.

Important Note:
Shopify doesn’t always expose product discounts directly in the API response, which may be a platform limitation rather than a configuration issue.

Status: The discussion remains open with a potential workaround suggested but no confirmation of whether it resolves the compare-at price visibility issue.

Summarized with AI on October 29. AI used: claude-sonnet-4-5-20250929.

Hi Shopify Support,

I am facing a issue over the shopify store with the order api response I have product for which there is compare price as 990 and there is sale price of 890 And order is made with shopify end .

But the response that I get from shopify order api in json is this do not conatin any paramerter that will let me know the compared price of product that was ordered and also anything that will let me know that this product have difference in compared and sale price I required that information because I am working with other api where I have to post the dicount

{
“current_subtotal_price”: “890.00”,
“current_subtotal_price_set”: {
“shop_money”: {
“amount”: “890.00”,
},
“presentment_money”: {
“amount”: “890.00”,
}
},
“current_total_additional_fees_set”: null,
“current_total_discounts”: “50.00”,
“current_total_discounts_set”: {
“shop_money”: {
“amount”: “50.00”,
},
“presentment_money”: {
“amount”: “50.00”,
}
},
“current_total_duties_set”: null,
“current_total_price”: “890.00”,
“current_total_price_set”: {
“shop_money”: {
“amount”: “890.00”,
},
“presentment_money”: {
“amount”: “890.00”,
}
},
“current_total_tax”: “135.76”,
“current_total_tax_set”: {
“shop_money”: {
“amount”: “135.76”,
},
“presentment_money”: {
“amount”: “135.76”,
}
},

“discount_codes”: ,
“subtotal_price”: “890.00”,
“subtotal_price_set”: {
“shop_money”: {
“amount”: “890.00”,

},
“presentment_money”: {
“amount”: “890.00”,

}
},
“tags”: “”,
“tax_exempt”: false,
“tax_lines”: [
{
“price”: “135.76”,
“rate”: 0.18,
“title”: “VAT”,
“price_set”: {
“shop_money”: {
“amount”: “135.76”,

},
“presentment_money”: {
“amount”: “135.76”,

}
},
“channel_liable”: false
}
],

“total_discounts”: “50.00”,
“total_discounts_set”: {
“shop_money”: {
“amount”: “50.00”,

},
“presentment_money”: {
“amount”: “50.00”,

}
},
“total_line_items_price”: “890.00”,
“total_line_items_price_set”: {
“shop_money”: {
“amount”: “890.00”,

},
“presentment_money”: {
“amount”: “890.00”,

}
},
“total_outstanding”: “0.00”,
“total_price”: “890.00”,
“total_price_set”: {
“shop_money”: {
“amount”: “890.00”,

},
“presentment_money”: {
“amount”: “890.00”,

}
},
“total_shipping_price_set”: {
“shop_money”: {
“amount”: “50.00”,

},
“presentment_money”: {
“amount”: “50.00”,

}
},
“total_tax”: “135.76”,
“total_tax_set”: {
“shop_money”: {
“amount”: “135.76”,

},
“presentment_money”: {
“amount”: “135.76”,

}
},
“total_tip_received”: “0.00”,
“total_weight”: 0,

},
“discount_applications”: [
{
“target_type”: “shipping_line”,

“value”: “100.0”,
“value_type”: “percentage”,
“allocation_method”: “each”,
“target_selection”: “all”,

}
],
“fulfillments”: ,
“line_items”: [
{
“attributed_staffs”: ,
“fulfillment_service”: “”,
“fulfillment_status”: null,
“grams”: 0,
“name”: “xyz”,
“price”: “890.00”,
“price_set”: {
“shop_money”: {
“amount”: “890.00”,

},
“presentment_money”: {
“amount”: “890.00”,

}
},
“properties”: ,
“quantity”: 1,
“requires_shipping”: true,
“taxable”: true,
“title”: “xyz”,
“total_discount”: “0.00”,
“total_discount_set”: {
“shop_money”: {
“amount”: “0.00”,

},
“presentment_money”: {
“amount”: “0.00”,

}
},
“variant_inventory_management”: “”,
“variant_title”: “xy”,
“tax_lines”: [
{
“price”: “135.76”,
“price_set”: {
“shop_money”: {
“amount”: “135.76”,

},
“presentment_money”: {
“amount”: “135.76”,

}
},
“rate”: 0.18,
“title”: “VAT”
}
],
“duties”: ,
“discount_allocations”:
}
],
“payment_terms”: null,
“refunds”: ,
“shipping_address”: {

},
“shipping_lines”: [
{
“code”: “Standard”,
“discounted_price”: “50.00”,
“discounted_price_set”: {
“shop_money”: {
“amount”: “50.00”,

},
“presentment_money”: {
“amount”: “50.00”,

}
},
“price”: “50.00”,
“price_set”: {
“shop_money”: {
“amount”: “50.00”,

},
“presentment_money”: {
“amount”: “50.00”,

}
},
“requested_fulfillment_service_id”: null,
“source”: “shopify”,
“title”: “***”,
“tax_lines”: ,
“discount_allocations”: [
{
“amount”: “50.00”,
“amount_set”: {
“shop_money”: {
“amount”: “50.00”,

},
“presentment_money”: {
“amount”: “50.00”,

}
},
“discount_application_index”: 0
}
]
}
]
}

Hi,

Hope this will help

  • Go to Order API Response
  • Look for line_items
  • Inside line_items, check for discount_allocations

Code example

"line_items": [
  {
    "title": "Toy Car",
    "price": "20.00",
    "discount_allocations": [
      {
        "amount": "5.00",
        "discount_application_index": 0
      }
    ]
  }
]

Please note - Shopify doesn’t always show discounts directly on products.

1 Like