Possible bug with /cart.js line_level_total_discount on zero-decimal currencies (CLP, VND, maybe others)

Hi everyone,

I’ve run into what appears to be a bug (or at least an inconsistency) in the Ajax Cart API (/cart.js) when the store currency is a zero-decimal currency such as CLP or VND. I’d like to confirm whether this is expected behavior or a bug, and see if others are experiencing the same issue.


Summary

On stores using zero-decimal currencies (confirmed with CLP and VND):

  • Most money-related fields in /cart.js (like price, total_discount, line_level_discount_allocations[].amount) use the usual “cents-like” integer units.

  • But only line_level_total_discount is returned at a different scale – effectively 100× smaller than the other discount fields.

On stores using non zero-decimal currencies (for example USD/EUR), all of these fields use the same scale and behave as expected.

This makes it very hard to write cart-related logic that works consistently across currencies.


Concrete example (CLP store)

Here is a simplified excerpt from a /cart.js response from a store with currency CLP:

json

{
  "currency": "CLP",
  "items": [
    {
      "price": 1099000,
      "original_price": 1099000,
      "discounted_price": 989100,

      "total_discount": 219800,
      "discounts": [
        {
          "amount": 219800,
          "title": "AOVAI_7EJ2U0P9"
        }
      ],

      "line_level_discount_allocations": [
        {
          "amount": 219800,
          "discount_application": {
            "title": "AOVAI_7EJ2U0P9",
            "total_allocated_amount": 219800
          }
        }
      ],

      "line_level_total_discount": 2198
    }
  ]
}

Interpreting these values:

  • price: 1099000

  • total_discount: 219800

  • line_level_discount_allocations[0].amount: 219800

These are all in the usual Ajax Cart “cents-like” units (for CLP 10,990 and 2,198, etc.).

However, line_level_total_discount is 2198, which is 100× smaller than total_discount and line_level_discount_allocations[0].amount (which are 219800). In other words:

  • For this line item:

    • total_discount = 219800

    • line_level_discount_allocations sum = 219800

    • line_level_total_discount = 2198 (appears to be 219800 / 100)


Comparison with non zero-decimal currencies

On stores with a non zero-decimal currency (for example USD or EUR), using the same kind of discount setup, the fields are consistent:

  • price, total_discount, line_level_discount_allocations[].amount

  • and line_level_total_discount

…all share the same unit and scale. There is no “divide by 100” effect.


Also confirmed on VND

I’ve now also checked a store with VND as the currency and see the same pattern:

  • total_discount and line_level_discount_allocations[].amount are in the same “cents-like” unit.

  • line_level_total_discount is 100× smaller than those values.

So far I have:

  • CLP → affected

  • VND → affected

  • JPY → affected

  • Several non zero-decimal currencies → not affected (values are consistent across all these fields)

This makes it look like a zero-decimal currency–specific issue in the Ajax Cart API.


Why I think this is a bug (not a feature)

From the docs:

The documentation does not indicate that line_level_total_discount should have a different unit/scale than:

  • total_discount, or

  • line_level_discount_allocations[].amount

On non zero-decimal currencies, all of them share the same scale. On CLP/VND, only line_level_total_discount is different. If this was an intentional “feature,” I would expect it to:

  • Be documented clearly, and/or

  • Apply consistently across all currencies (not only zero-decimal ones).

From a developer perspective trying to consume /cart.js consistently across all store currencies, this strongly behaves like a bug or inconsistency in how line_level_total_discount is calculated or serialized for zero-decimal currencies.

Questions for Shopify / the community

  1. Can Shopify confirm whether this is a known bug in /cart.js for zero-decimal currencies, specifically on line_level_total_discount?

  2. Are other zero-decimal currencies (e.g. JPY, KRW, etc.) also affected in the same way?

  3. Is there any documented guidance on how line_level_total_discount is supposed to be scaled/represented for zero-decimal currencies in the Ajax Cart API?

If this is indeed a bug, it would be very helpful to:

  • Either align line_level_total_discount with the other discount fields across all currencies, or

  • Explicitly document the difference so theme/app developers can handle it correctly.

Thanks in advance for any clarification or confirmation from Shopify staff or other developers who have run into this issue.


If you’d like, I can also share more complete /cart.js payloads (with IDs and sensitive data redacted) for CLP/VND test stores.

i think they fix the issue now here it showing properly with CLP or VND currency with {amount_no_decimals}} .