Shopify is ignoring currency codes when adding discounts

When I provide a discount in AUD, the API returns the discount allocation in CAD with the same numeric value. This seems incorrect as the currencies should match or be properly converted.

GraphQL Mutation

Here’s the mutation I’m using:

mutation orderEditAddLineItemDiscount(
  $discount: OrderEditAppliedDiscountInput!,
  $id: ID!,
  $lineItemId: ID!,
  $namespace: String = "$app:orderediting"
) {
  orderEditAddLineItemDiscount(
    discount: $discount,
    id: $id,
    lineItemId: $lineItemId
  ) {
    calculatedLineItem {
      ...CalculatedLineItemFields
    }
    addedDiscountStagedChange {
      value {
        __typename
        ... on MoneyV2 {
          amount
          currencyCode
        }
        ... on PricingPercentageValue {
          percentage
        }
      }
    }
    calculatedOrder {
      id
    }
    userErrors {
      field
      message
    }
  }
}

Input Data

// Discount input
{
  id: 'gid://shopify/CalculatedOrder/149345534015',
  lineItemId: 'gid://shopify/CalculatedLineItem/88128dd4-a820-4a9b-aec0-17dbc150e999',
  discount: {
    description: 'Discount',
    percentValue: undefined,
    fixedValue: { amount: 10, currencyCode: 'AUD' }
  }
}

Response Data

{
  calculatedLineItem: {
    __typename: 'CalculatedLineItem',
    id: 'gid://shopify/CalculatedLineItem/88128dd4-a820-4a9b-aec0-17dbc150e999',
    quantity: 1,
    calculatedDiscountAllocations: [
      {
        allocatedAmountSet: { presentmentMoney: { amount: '10.0', currencyCode: 'CAD' } }
      }
    ],
    originalUnitPriceSet: { presentmentMoney: { amount: '250.0', currencyCode: 'CAD' } },
    discountedUnitPriceSet: { presentmentMoney: { amount: '240.0', currencyCode: 'CAD' } },
    variant: {
      __typename: 'ProductVariant',
      id: 'gid://shopify/ProductVariant/1',
      sku: 'XXX',
      product: {
        __typename: 'Product',
        id: 'gid://shopify/Product/0'
        salesChannelPercentageDiscount: null
      }
    }
  },
  calculatedOrder: { id: 'gid://shopify/CalculatedOrder/149345534015' },
  userErrors: []
}

The Discrepancy

Notice the following:

  1. I provide a discount with currencyCode: 'AUD' in the input
  2. The addedDiscountStagedChange shows the discount with currencyCode: 'AUD' as expected
  3. However, the calculatedDiscountAllocations shows currencyCode: 'CAD' with the same numeric amount

Is this a bug in the API, or am I missing something about how currency handling works in the Order Editing API?

Any help would be appreciated!

Hey @keiraarts :waving_hand: . This does look odd to me, thanks for sharing your mutations/input values. I can’t say for sure what’s causing this at the moment as I’m unable to replicate it, but if you are able to share the original order ID/shop ID, I can definitely take a closer look into this for you here and do some troubleshooting on my end. :slight_smile:

Can I share this info over email? And then we’ll post the solution to the forum when found. @Alan_G

Hey @keiraarts - sure! If you’re comfortable sharing it over DM in the forums, I can message you that way (just ping me here if you’re cool with that), otherwise, if you’d like to reach out through the live chat at https://help.shopify.com/ , just share this thread and say that Alan from Developer Support asked you to reach out that way so that the Dev Support team can help out directly and we can assist more securely over email if you’d prefer to do that.

Where did we land on this one @Alan_G ? :folded_hands: