I’m working on a Shopify App that calls the GraphQL mutation draftOrderCalculate.
In this past we were able to pull shipping rate options from this mutation via the availableShippingRates field, but we noticed yesterday that it is always returning an empty list of options now.
It’s possible there was a change in the API, but I wasn’t able to find anything in the release notes. If there was a breaking change, I know:
- This code was working at least back in April 2022.
- It was referencing API version 2021-04, which I see is gone now.
The app’s permissions are:
['read_products', 'write_orders', 'write_draft_orders']
Our mutation looks like this:
mutation draftOrderCalculate($input: DraftOrderInput!) {
draftOrderCalculate(input: $input) {
calculatedDraftOrder {
subtotalPrice
totalPrice
totalShippingPrice
totalTax
availableShippingRates {
handle
title
price {
amount
}
}
taxLines {
title
rate
ratePercentage
priceSet {
presentmentMoney {
amount
}
}
}
}
userErrors {
field
message
}
}
}
With the input looking like this:
{
"input": {
"lineItems": [
{
"variantId": "gid://shopify/ProductVariant/40641593573531",
"quantity": 1,
"appliedDiscount": null
}
],
"shippingAddress": {
"firstName": "Test",
"lastName": "User",
"address1": "1 Main St",
"address2": "",
"city": "Beverly Hills",
"provinceCode": "California",
"countryCode": "US",
"phone": "",
"zip": "90210"
}
}
}
And the relevant line in the result looks like:
"availableShippingRates": [],
Any ideas on what could be causing this?