Hello, I am building a custom Shopify app to automate the refund process.
I wanted to confirm how payment works in the refundCreate GraphQL mutation. Is this handled automatically or do I need to create a transaction?
For example in the following:
mutation {
refundCreate(
input: {
orderId: "gid://shopify/Order/xyz",
refundLineItems: [{lineItemId:"gid://shopify/LineItem/xyz",quantity:1},{lineItemId:"gid://shopify/LineItem/xyz",quantity:1}],
shipping: {amount: "0"},
notify: true
}) {
refund {
totalRefunded {
amount
currencyCode
}
}
userErrors {
field
message
}
}
}
The result gives a total refunded amount of 0. Is this just because I am using a development store?
If a transaction is required, is it possible to automate this without the customer supplying their payment details again?
Any help appreciated.
Many thanks,
Harry