Hi there, I’d like to fully refund an order https://maxim-khanate.myshopify.com/admin/orders/4353798733888.json
Note that the lines items have already been refunded.
When I try to refund just the shipping (api_version 2024-10),
mutation refundshipping($id: ID!) {
refundCreate(
input: {
orderId: $id
shipping: { fullRefund: true }
}
) {
refund {
id
createdAt
}
userErrors {
field
message
}
}
}
I get the error: “either refund line items or refund duties or transactions must be present”
- I do not have any line items to refund
- I do not have any transactions
What should I do?
For reference, I the order was created with Order - REST
Hi @sengming
I believe you are encountering this error because the refundCreate mutation requires at least one of the following to be present in the input: refund line items, refund duties, or refund transactions. Refunding only shipping (with no line items, duties, or transactions) is not supported by this mutation.
If all line items have already been refunded, and there are no duties or transactions left to refund, the API does not allow a “shipping only” refund as a standalone operation.
What you could do instead is find or create the relevant Return object for the order and use the returnProcess mutation to process the shipping refund as part of the return.
Hi @Liam-Shopify thanks for the suggestion! It looks like I can’t create a return because all the line items have been refunded.
Creates a return from an existing order that has at least one fulfilled line item that hasn’t yet been refunded. If you create a return on an archived order, then the order is automatically unarchived. returnCreate - GraphQL Admin
Do you have any other ideas?
I really just want to fully refund the order, if there is a way to do that without refunding the shipping line that would work too!
I would also suggest using the OrderCancel mutation and passing refund:true as the property.
1 Like