Incorrect "subtotal_amount" on Fulfillment event when discount is applied

Topic summary

Issue Identified:
Avalara reports incorrect subtotal_amount values in Shopify’s fulfillment events when percentage discounts are applied to orders.

Reproduction Steps:

  • Order created: 5 items × $20 = $100 (pre-tax)
  • 10% discount applied, reducing subtotal to $90
  • Tax recalculated: $9.27
  • Final total: $99.27
  • Order marked as paid

Problem Details:

  • First partial fulfillment (3 of 5 items): Event shows subtotal_amount of $30.00, but expected amount should reflect the proportional discount
  • Second partial fulfillment (remaining 2 items): Event shows subtotal_amount of $50.00
  • The full $10 discount appears to be applied to each fulfillment event separately, rather than being proportionally distributed

Impact:
This discrepancy causes transaction recording mismatches between Shopify and Avalara’s tax calculation system.

Status: Issue reported to Shopify team; awaiting response or resolution.

Summarized with AI on November 9. AI used: claude-sonnet-4-5-20250929.

Hello Shopify Team,
We are seeing an issue where in one scenario subtotal_amount under cart_lines → cost is inaccurate when we receive event on order fulfillment.
Here are the steps to repro the issue:

  1. Create an order with a product by adding 5 quantities of it. Say each item is $20 and therefore total amount is $100 pre-tax.

  2. Estimated tax calculated on the order is $10.30. So Total Amount of the order is $110.30

  3. Now add discount to it using the following steps:

    1. Click on add discount → Add custom order discount - > Discount Type as Percentage and add 10% as discount value
    2. Apply discount to order
  4. This discount reduces the total amount to $90 and hence taxes are recalculated. Taxes now comes as $9.27 on discounted price

  5. Total amount post estimated taxes and after discount is now $99.27

  6. Click on Collect Payment → Mark as Paid

  7. Now we will fulfill the order in 2 batches.

  8. Click on FulFill Items button and change quantity to 3 (of total 5). Click on Fulfill Items.

  9. This partially fulfilled the order with 3 quantities. But the event we received has the following data:

                      "cost": {
                        "amount_per_quantity": {
                          "amount": "18.0",
                          "currency_code": "USD"
                        },
                        "subtotal_amount": {
                          "amount": "50.0",
                          "currency_code": "USD"
                        },
                        "total_amount": {
                          "amount": "59.58",
                          "currency_code": "USD"
                        }
                      } 
    

    Please check subtotal_amount above. That seems incorrect.Now let’s fulfill the remaining 2 items as well. For that the event received has following data: (Please see subtotal_amount )

      "cost": {
                        "amount_per_quantity": {
                          "amount": "18.0",
                          "currency_code": "USD"
                        },
                        "subtotal_amount": {
                          "amount": "30.0",
                          "currency_code": "USD"
                        },
                        "total_amount": {
                          "amount": "39.72",
                          "currency_code": "USD"
                        }
                      }
    

    Due to this, we (Avalara) are seeing discrepancy on order amount in Shopify and Avalara Avatax during transaction recording. To me it looks like it applied full discount of $10 on subtotal_amount on each event.

Please suggest!