I developed a web application that uses the Shopify API a while back, it’s been running without a problem for about 2 months now, until this week when an error started to occur.
We are trying to update an orders fulfilment using an API call in PHP.
In PHP we POST to the following:
http://www.the-web-shop-like-this.com/admin/orders/0123456789/fulfillments.json
We POST the following variable: $fulfillment_update
The variable is set like so:
$fulfillment_update = "
'fulfillment': {
'tracking_number': '',
'notify_customer': true
}";
POST’ing the blank tracking_number was to force the shopify system into generating the fulfilment email and for marking that order as fulfilled – no tracking number is ever added and notify_customer is always set to true.
Shopify API comes back (since the weekend) saying: ‘Unprocessable Entity’.
Any ideas Ladies & Gents?
Thanks in advance!
I’m seeing some strange param encoding on your request params. Here’s what Rails is getting:
This is a hash with a key
'_json'and a value containing the json as a string. This suggests that you’re passing your data incorrectly somehow. Can you post the full code you’re using to kick off the HTTP request?P.S.: Are you aware of the existing client libraries for PHP? Here’s a list, I highly recommend using one of them unless you have a specific reason not to: http://wiki.shopify.com/Shopify_App_Development#.E2.80.9CI.E2.80.99m_a_PHP_developer.E2.80.9D