MONEI / Shopify-api-node

Node Shopify connector sponsored by MONEI
https://monei.com/shopify-payment-gateway/
MIT License
954 stars 280 forks source link

When using shopify order list api it gives data but shopify api helath-check give unsupported warning #642

Open jaydeep0621 opened 10 months ago

jaydeep0621 commented 10 months ago
image
jaydeep0621 commented 10 months ago

One or more of your apps have made deprecated API calls in the last 14 days. Support for this version will be removed on January 2, 2024. Please update the apps listed below to API version or later and make the required updates outlined in the breaking changes section of the 2023-04 release.

Ryvix commented 10 months ago

I believe this is related to issue #632

jaydeep0621 commented 10 months ago

Yes @Ryvix

lpinca commented 10 months ago

None of those properties are handled by shopify-api-node. The library forwards the input as is and returns the output as is.

Ryvix commented 10 months ago

If it helps, all I know is that it only lists those deprecated properties, among others, in the interfaces within the types/index.d.ts file anywhere in my project. I don't know ts but I can't think of any other reason why it's saying they are being used when I'm not actually using them anywhere and the only place they're mentioned is in shopify-api-node.

lpinca commented 10 months ago

Try using the apiVersion option if it isn't already. If not specified, the oldest supported version is used.

jaydeep0621 commented 10 months ago

I am using the same version suggested by shopify i.e. 2023-04 but this health check .

sdrib commented 10 months ago

You can reproduce any of this behavior in isolation by dropping the apiVersion

Because you have not specified a version this package will do a call like this: https://MYSTORE.myshopify.com/admin/orders/XXXXXXX.json instead of something like this https://MYSTORE.myshopify.com/admin/api/2024-01/orders/XXXXXXX.json

You'll notice that when the api/version part is dropped, Shopify will return an order object that includes deprecated things like "delivery_category":null or "gateway": "shopify_payments" etc...

When you inspect the headers you'll see x-shopify-api-version is 2023-01. A deprecated version.

It's unclear to me why Shopify does this and subsequently complains that people are using deprecated properties but that does seem to be what is happening.

Perhaps the part about oldest supported stable version. in the README needs to be changed?

Optional - A string to specify the Shopify API version to use for requests. Defaults to the oldest supported stable version.

If the default is an unsupported version, is it still a usable default? I'd argue this isn't an optional parameter at this point.

lpinca commented 9 months ago

@sdrib it now returns 2023-04 as expected. I guess there is a grace period.