Hi all,
I am trying to refund orders through the API and end up with the following error:
{"errors":{"transactions":"expected Hash to be a Array"}}
Steps that I have done:
- Queried transactions from order object. Result:
Array
(
[transactions] => Array
(
[0] => Array
(
[id] => 3711974310050
[order_id] => 3024381083810
[kind] => sale
[gateway] => Bitcoin via COINQVEST
[status] => pending
[message] => Pending the Bitcoin via COINQVEST payment from the buyer
[created_at] => 2021-01-20T17:29:35+01:00
[test] =>
[authorization] =>
[location_id] =>
[user_id] =>
[parent_id] =>
[processed_at] => 2021-01-20T17:29:35+01:00
[device_id] =>
[error_code] =>
[source_name] => web
[receipt] => Array
(
)
[amount] => 0.01
[currency] => EUR
[admin_graphql_api_id] => gid://shopify/OrderTransaction/3711974310050
)
[1] => Array
(
[id] => 3711977029794
[order_id] => 3024381083810
[kind] => sale
[gateway] => Bitcoin via COINQVEST
[status] => success
[message] => Marked the Bitcoin via COINQVEST payment as received
[created_at] => 2021-01-20T17:31:16+01:00
[test] =>
[authorization] =>
[location_id] =>
[user_id] =>
[parent_id] => 3711974310050
[processed_at] => 2021-01-20T17:31:16+01:00
[device_id] =>
[error_code] =>
[source_name] => 4187065
[receipt] => Array
(
)
[amount] => 0.01
[currency] => EUR
[admin_graphql_api_id] => gid://shopify/OrderTransaction/3711977029794
)
)
)
- Built a refund object and posted to the refunds.json API endpoint:
Array
(
[refund] => Array
(
[notify] => 1
[note] => Refunded through COINQVEST merchant account
[transactions] => Array
(
[0] => Array
(
[parent_id] => 3711974310050
[amount] => 0.01
[kind] => refund
[gateway] => Bitcoin via COINQVEST
)
)
)
)
Result is the above mentioned error.
At this point I am not sure how the transactions array should look like. Do I need to add all transactions from the above query result? Or only the second one which is marked as success? Or am I missing something completely different?
Thanks for your help!