Skip to content

Additional CancelOrder params being wrapped in "order" breaks functionality #66

Description

@tseven

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions