Hi All,
I have the task of migrating the return process of an app to graphql and I am having a bit of a problem with it.
I would like to automatically restock the returned items when creating a return, and only have the merchant approve the refund is this possible? By working through the multistep process Build for return management I can create a return and even automatically approve the refund, but I can’t seem to find a way to actually restock the products automatically.
Asking the AI Assistant gave me an invalid answer … there is no restockType property on returnLineItems.
mutation RestockReturnedItem {
returnCreate(
returnInput: {
orderId: "gid://shopify/Order/625362839",
returnLineItems: [
{
fulfillmentLineItemId: "gid://shopify/FulfillmentLineItem/820022594",
quantity: 1,
returnReason: WRONG_ITEM,
returnReasonNote: "Restocking the returned item.",
restockType: RETURN
}
]
}
) {
return {
id
status
returnLineItems(first: 1) {
edges {
node {
id
returnReason
returnReasonNote
restockType
}
}
}
order {
id
}
}
userErrors {
field
message
}
}
}
anyone manage to achieve this? or know how?
I would be grateful for a bit of help.
Cheers,
Gary