I create a cart with a working discount code, and it successfully updates the cost according to the discount applied:
mutation CartCreate($input: CartInput!) {
cartCreate(input: $input) {
cart {
id
discountCodes {
code
applicable
}
discountAllocations {
discountedAmount {
amount
}
}
cost {
totalAmount {
amount
}
}
}
}
}
But when I try to retrieve the discounted amount with “discountAllocations” following the API, it gives me an empty object.
{
"data": {
"cart": {
"id": "gid://shopify/Cart/2bbbd6d5e115b0f661a3642d1521efb2",
"discountAllocations": []
}
}
}