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:
- I provide a discount with
currencyCode: 'AUD'
in the input - The
addedDiscountStagedChange
shows the discount withcurrencyCode: 'AUD'
as expected - However, the
calculatedDiscountAllocations
showscurrencyCode: '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!