Shopify GraphQL draftOrderCreate error: "Applied discount value can have at most 2 digits after decimal point" — but value is correctly formatted

Hi Shopify Community,

I’m encountering an issue with the draftOrderCreate GraphQL mutation when applying a fixed amount discount to a line item. Despite formatting the appliedDiscount.value field to exactly two decimal places, the mutation consistently fails with this error:

Error: Applied discount value can have at most 2 digits after decimal point
Field Path: lineItems[0].appliedDiscount.value

We’re building a custom integration to programmatically create draft orders with a fixed amount discount applied per line item. Here’s a simplified example of the mutation payload we’re sending:

{
  "variantId": "gid://shopify/ProductVariant/49974694904086",
  "quantity": 3,
  "appliedDiscount": {
    "amount": "42.65",
    "description": "TFM Price Difference",
    "value": 42.65,
    "valueType": "FIXED_AMOUNT",
    "title": "TFM Discount"
  }
}

What We’ve Tried
Used decimal.Decimal in Python to calculate and round the discount value precisely to 2 decimal places (Decimal(‘0.01’) with ROUND_HALF_UP).

Verified the payload is being serialized correctly with custom JSON encoding (e.g., 42.65 is not turning into 42.650000000000006).

Removed amount field to see if there was a conflict — still the same error.

Manually tested mutation using Shopify’s GraphiQL admin app with the same input — still fails.

Tried with smaller values (e.g., 1.00) — still fails.

Questions
Is this a known issue or limitation in the DraftOrder API?

Are there undocumented constraints or formatting expectations for appliedDiscount.value?

Should we be using a different data type or approach to ensure compliance with Shopify’s backend validation?

1 Like

I don’t use this exact API but can you pass the value as a string?

Hey @Ravi_Ighare

I tested your exact payload format (including both "amount": "42.65" and "value": 42.65 fields together) and it worked without any errors in my environment. @dogowner’s suggestion to pass the value as a string doesn’t work though. The GraphQL schema rejects it with a coercion error since that field expects a number.

Since the exact formatting you’re using works fine when I test it, the issue might be specific to your environment, GraphQL client, or how the values are being serialized before reaching the API. Since you mentioned that you’ve tested that already, can you share an x-request-id from the mutation returning the errors? I may be able to pull some additional insight from our logs.