ServiceDescription for 'CancelOrder':
'CancelOrder' => [
'httpMethod' => 'POST',
'uri' => 'admin/orders/{id}/cancel.json',
'responseModel' => 'GenericModel',
'summary' => 'Cancel a given order',
'data' => ['root_key' => 'order'],
'parameters' => [
'id' => [
'description' => 'Order ID',
'location' => 'uri',
'type' => 'integer',
'required' => true
]
],
'additionalParameters' => [
'location' => 'json',
],
],
Since the root_key is set to 'order', the additional parameters passed to the cancelOrder method gets wrapped and end up looking like:
['order' => [ 'reason' => 'fraud' ]
Which does't comply with the API spec:
https://help.shopify.com/api/reference/order#cancel
I've been able to "fix" the issue by setting the root_key to NULL. This of course bypasses the unwrapping of the Shopify result as well.
What is the proper fix here?
Thanks
ServiceDescription for 'CancelOrder':
Since the root_key is set to 'order', the additional parameters passed to the cancelOrder method gets wrapped and end up looking like:
['order' => [ 'reason' => 'fraud' ]Which does't comply with the API spec:
https://help.shopify.com/api/reference/order#cancel
I've been able to "fix" the issue by setting the root_key to NULL. This of course bypasses the unwrapping of the Shopify result as well.
What is the proper fix here?
Thanks