REST Admin API Orders retrieve specified shipping line source

Yura_Solugate
New Member
1 0 0

Hello, 

I only want to request/query specific fields from the REST Admin API endpoints where a field equals a specific value. For example only get these specific fields for authorized orders:

 

1) The response GET https://{store}.myshopify.com/admin/api/2020-04/order.json (below photo)

GETorders.png

 

2) I want get where the source of shipping lines equals 'KshippingService'

https://{store}.myshopify.com/admin/api/2020-04/order.json?source='KshippingService'

 

Like the command above, I only need orders that use a specific shipping line source.

'Shipping_lines' has the form of a json array. Is there a way to filter by one element in this array?

0 Likes
_JB
Shopify Staff
Shopify Staff
750 87 165

Hey @Yura_Solugate,

 

When using the REST API, you can add the `fields` parameter to your call and the response will only include the specified fields. This doesn't work with nested fields, so in this case you'll need to retrieve the entire shipping_lines object: https://{store}.myshopify.com/admin/api/2020-04/orders.json?fields=shipping_lines

 

Although the REST API does allow filtering your query on certain fields, the shipping_lines.source field can't currently be filtered on. You can see our order API docs here for a list of all the fields that support filtering.

JB | Developer 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

0 Likes