A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Here is an example JSON needed to refund an order with multiple transactions since the shopify documenation does not provide one.
I wasted a lot of time with this, so hopefully this helps someone avoid that :))
{
"refund": {
"notify": "true",
"note": "",
"shipping": {
"full_refund": "false"
},
"refund_line_items": [
{
"price": 191.94,
"line_item_id": xxx,
"quantity": 1,
"restock_type": "no_restock",
"location_id": xxx
},
{
"price": 155.94,
"line_item_id": xxx,
"quantity": 1,
"restock_type": "no_restock",
"location_id": xxx
},
{
"price": 21,
"line_item_id": xxx,
"quantity": 1,
"restock_type": "no_restock",
"location_id": xxx
}
],
"transactions": [
{
"parent_id": xxx,
"currency": "EUR",
"amount": "347.88",
"kind": "refund",
"gateway": "bogus"
},
{
"parent_id": xxx,
"currency": "EUR",
"amount": "21.00",
"kind": "refund",
"gateway": "bogus"
}
]
}
}
As you can see, the refund_line_items need to all be individual objects in one array, otherwise you get the:
array expected to be hash
error
The multiple transactions need to also be individual objects in one array
Cheers,
Matthias7