Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

API version for REST admin orders

API version for REST admin orders

Tony49
Shopify Partner
36 2 6

Hello,

    I have a weird problem with API versions.  According to the documentation, I should be able to use 2022-10 or 2022-07 (last 2 versions), but I get resource not found (404 error) with both.  If I use "2022-01" instead of "2022-07", it works fine.  Is there some issue with the rest API?  Or maybe with the documentation?

[wmsodbc]> curl -X GET 'https://tsmtestwholesale.myshopify.com/admin/api/2022-7/orders/count.xml' -H X-Shopify-Access-Token:TOKEN -H 'Cache-Control: no-cache' -o Version2022_7_count.xml -D Version2022_7_count_header
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 83 0 83 0 0 112 0 --:--:-- --:--:-- --:--:-- 434
[wmsodbc]> curl -X GET 'https://tsmtestwholesale.myshopify.com/admin/api/2022-07/orders/count.xml' -H X-Shopify-Access-Token:TOKEN -H 'Cache-Control: no-cache' -o Version2022_07_count.xml -D Version2022_07_count_header
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
[wmsodbc]> curl -X GET 'https://tsmtestwholesale.myshopify.com/admin/api/2022-01/orders/count.xml' -H X-Shopify-Access-Token:TOKEN -H 'Cache-Control: no-cache' -o Version2022_01_count.xml -D Version2022_01_count_header
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 72 0 72 0 0 118 0 --:--:-- --:--:-- --:--:-- 327

[wmsodbc]> head -1 Version2022_*header
==> Version2022_01_count_header <==
HTTP/1.1 200 OK

==> Version2022_07_count_header <==
HTTP/1.1 404 Not Found

==> Version2022_7_count_header <==
HTTP/1.1 404 Not Found

 

Replies 3 (3)

mikerowave
Shopify Staff (Retired)
22 3 2

Hi @Tony49!

Support for .xml responses was deprecated starting in version 2022-07. You can read the change log for more details.

Mike M (mikerowave) | API Support @ Shopify 
 - Was my reply helpful? Click Like to let me know!
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit shopify.dev or the Shopify Web Design and Development Blog

Tony49
Shopify Partner
36 2 6

Why was this changed, per chance?  Not like it is hard to turn JSON into XML, which is probably what you guys were doing anyway.  Just curious.

 

Also, more importantly, will this also impact webhooks?

Tony49
Shopify Partner
36 2 6

Never mind, https://shopify.dev/api/admin-rest/2022-10/resources/webhook#post-webhooks says "xml" is still a valid format.  Yes, I know that XML is not supported for all topics, but it is for all the ones I care about.  So change was only for Admin REST API.