API Get order v 2022-07 X-Shopify-API-Deprecated-Reason headers

Solved

API Get order v 2022-07 X-Shopify-API-Deprecated-Reason headers

longtruong99
New Member
9 0 0

Hello,

 

I'm trying to use to Postman client to interact with Shopify

Our version is 2022-07

 

However, when I make a simple

https://shopify.dev/api/admin-rest/2022-04/resources/order#get-orders?status=any

 

I get a header in the response,

X-Shopify-API-Deprecated-Reason: https://shopify.dev/changelog/property-deprecations-in-the-admin-api-order-and-lineitem-resource

 

I get list order, everything goes smoothly.

 

What am I missing? What should I do, to fix it?

 

Thanks for your help

Accepted Solution (1)
suphero
Shopify Partner
15 2 3

This is an accepted solution.

I thought you were having this issue on GraphQL. I didn't use the REST version much. But, I think the URL returns some deprecated fields and if you're using these fields you should be careful.

https://shopify.dev/api/admin-rest/2022-04/resources/order#resource-object

 

Deprecated fields: gateway, payment_details

Screen Shot 2022-09-05 at 17.41.08.png

Screen Shot 2022-09-05 at 17.41.35.png

 

  1. You can ignore the message if you're not using these fields.
  2. Or you can select only the fields you are interested and if these fields are not deprecated you shouldn't be getting this warning message.

Screen Shot 2022-09-05 at 17.43.59.png

View solution in original post

Replies 6 (6)

longtruong99
New Member
9 0 0

FYI, the X-Request-ID 786e021a-5e8d-4a1b-852d-6e08a8c49670

suphero
Shopify Partner
15 2 3

Here's what I do to detect deprecated fields. I paste my query into the Shopify GraphiQL API page and check every field to look for the deprecation message.

For example, if you are using Order.referrerUrl, deprecation message suggests "Use customerJourneySummary.lastVisit.referrerUrl instead".

Screen Shot 2022-09-05 at 13.08.34.png

 

You will get your results now, but in future versions, the query may not work. So you should update your query as suggested.

longtruong99
New Member
9 0 0

Thanks you so much, @suphero ,

 

But I only call API to get orders, I just call with simple query (status=any)

https://my-store.myshopify.com/admin/api/2022-07/orders.json?status=any

 

I get a header in the response,

X-Shopify-API-Deprecated-Reason: https://shopify.dev/changelog/property-deprecations-in-the-admin-api-order-and-lineitem-resource

 

I don't know why it return above response in the header.

image (3).png

suphero
Shopify Partner
15 2 3

This is an accepted solution.

I thought you were having this issue on GraphQL. I didn't use the REST version much. But, I think the URL returns some deprecated fields and if you're using these fields you should be careful.

https://shopify.dev/api/admin-rest/2022-04/resources/order#resource-object

 

Deprecated fields: gateway, payment_details

Screen Shot 2022-09-05 at 17.41.08.png

Screen Shot 2022-09-05 at 17.41.35.png

 

  1. You can ignore the message if you're not using these fields.
  2. Or you can select only the fields you are interested and if these fields are not deprecated you shouldn't be getting this warning message.

Screen Shot 2022-09-05 at 17.43.59.png

longtruong99
New Member
9 0 0

Thanks so much, @suphero 

But Shopify don't approve to public my app,

suphero
Shopify Partner
15 2 3

You're welcome. Shopify verification process may take long but I assume it is unrelated to this topic. If my answer solves your deprecation issue please accept the answer to keep the platform clean and you can open another issue.