Hitting a snag with the orderEditUpdateShippingLine
mutation. API version: 2024-10.
The docs seem to be incorrect as to whether the expected input for shippingLineId is a ShippingLine
or CalculatedShippingLine
.
I’ve actually tried both. When I use the ShippingLine I get “invalid ID” as the error message.
I’m pretty sure it should be CalculatedShippingLine
but when I try that I’m getting this error:
The shipping line can’t be updated because it doesn’t exist or wasn’t added during this edit
Even though the shipping line clearly exists in the calculated order:
{
"id": "gid://shopify/CalculatedOrder/67149234294",
"shippingLines": [
{
"id": "gid://shopify/CalculatedShippingLine/4777590653046",
"price": {
"shopMoney": {
"amount": "500.0"
}
}
}
],
"lineItems": {
"nodes": [
{
"id": "gid://shopify/CalculatedLineItem/14232468324470",
"sku": "59912709",
"quantity": 1,
"originalUnitPriceSet": {
"shopMoney": {
"amount": "208.53"
}
}
},
{
"id": "gid://shopify/CalculatedLineItem/14232468357238",
"sku": "59912175",
"quantity": 1,
"originalUnitPriceSet": {
"shopMoney": {
"amount": "499.5"
}
}
},
{
"id": "gid://shopify/CalculatedLineItem/14232468390006",
"sku": "59011463",
"quantity": 1,
"originalUnitPriceSet": {
"shopMoney": {
"amount": "799.5"
}
}
}
]
}
}
This is the mutation I’m doing:
mutation orderEditUpdateShippingLine($id: ID!, $shippingLine: OrderEditUpdateShippingLineInput!, $shippingLineId: ID!) {
orderEditUpdateShippingLine(id: $id, shippingLine: $shippingLine, shippingLineId: $shippingLineId) {
calculatedOrder {
id
shippingLines {
id
price {
shopMoney {
amount
}
}
}
}
userErrors {
field
message
}
}
}
With variables:
{
"id": "gid://shopify/CalculatedOrder/67149234294",
"shippingLine": {
"price": {
"amount": 600,
"currencyCode": "USD"
}
},
"shippingLineId": "gid://shopify/CalculatedShippingLine/4777590653046"
}