Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 1.1.23 - change to 2202-07 version breaks fulfillments #264

Closed
jeroendelau opened this issue Sep 21, 2022 · 8 comments
Closed

Version 1.1.23 - change to 2202-07 version breaks fulfillments #264

jeroendelau opened this issue Sep 21, 2022 · 8 comments

Comments

@jeroendelau
Copy link
Contributor

In version 1.1.23 the Shopify version was updated from 2022-01 to 2022-07. There are some breaking changes between these versions.

This now results in 404 NOT found:
$client->Order($order->Order_ID)->Fulfillment->post($body);

200: admin/api/2022-01/orders/{order_id}/fulfillments.json
404: admin/api/2022-07/orders/{order_id}/fulfillments.json

Instead now you will have to send to a different location, with an entirely different payload.
admin/api/2022-07/fulfillments.json

I believe what would be needed is
$client->Fulfillments

And remove
$client->Order($order->Order_ID)->Fulfillment

For others with the same problem, I have fixed my version to 1.1.22

@whobutsb
Copy link
Contributor

Does your app have scope permissions for:
write_assigned_fulfillment_orders, read_assigned_fulfillment_orders. read_fulfillments, write_fulfillments?

@JoeKuhns
Copy link

JoeKuhns commented Sep 28, 2022

I'm having the same issue and am not following you on your fix. Can you clue me in a little?

Thanks.

Update, I do have scope permissions as noted above.

@jeroendelau
Copy link
Contributor Author

No, I only request: write_fulfillments (and a bunch of others, but not fulfillments)

Fairly confident that I would receive a 403 if the scope was invalid, not a 404 that returned now. The SDK is trying to call a route that doesn't exists in api version 2022-07.

IMHO - this is a breaking change and should have been released as minor version release.
1.1.x - release another minor release reverting to 2022-01
1.2.x - bump the shopify api version to 2022-07

@JoeKuhns I updated composer.json to fix the library to 1.1.22, the last one that uses api version 2022-01

// in composer.json update
...
 "phpclassic/php-shopify": "1.1.22",
...

// run 
composer update phpclassic/php-shopify

@JoeKuhns
Copy link

@jeroendelau Excellent thanks! how did I not know composer would downgrade? Works perfectly.

@tareqtms
Copy link
Contributor

@jeroendelau
I have fixed the releases as you suggested.
However, For everyone's info, it's best to use a self-defined API Version in the $config array. Like this:

$config = array(
    'ShopUrl' => 'yourshop.myshopify.com',
    'AccessToken' => '***ACCESS-TOKEN-FOR-THIRD-PARTY-APP***',
    'ApiVersion' => '2022-07',
);

This will give you better control over the API Versions. Anyhow you will need to keep updating the API Version, because versions will reach EOL after some time.

@jeroendelau
Copy link
Contributor Author

@tareqtms, many thanks!

I'll start work somewhere next week to help fix the fulfillment for the 2022-07 version.

@damix1984
Copy link

Is there any news for the fix on the fulfillment for 2022-07 version? Is someone working on it coming with a solution in few time?

@whobutsb
Copy link
Contributor

whobutsb commented Oct 6, 2022

A couple pieces of news from Shopify. Apps will have until 2023-07 release to migrate to the new version.

Legacy Fulfillment API Deprecation

Fulfillment orders migration guide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants