Solved

Admin API does not return latest updates in orders dataset

geordanacaixeta
Visitor
2 0 0

I am trying to export data from orders dataset using ShopifyQL API. However, the result does not match the data I have in ShopifyWeb. The latest orders are missing (Now, it is "Apr 17, 2024 03:00 PM" and the last order I get from API was made at "Apr 15, 2024 09:00 PM") and some "returns" and "net_sales" values are outdated. Any suggestion?

 

Here is a query example: 

 

FROM
    orders
SHOW 
    additional_fees,
    discounts_adjustments,
    gross_sales_adjustments,
    returns,
    additional_fees,
    discounts,
    duties,
    gross_sales,
    net_sales,
    shipping,
    taxes,
    tips,
    ordered_product_quantity,
    returned_product_quantity,
    net_product_quantity,
    orders
GROUP BY
    hour,
    billing_city,
    billing_country,
    billing_region,
    order_id,
    sales_channel,
    shipping_city,
    shipping_country,
    shipping_region
SINCE 
    -30d
UNTIL 
    today
ORDER BY
    hour

 

Accepted Solution (1)

ShopifyDevSup
Shopify Staff
1357 225 475

This is an accepted solution.

Hi @geordanacaixeta 

 

I've moved this thread to the Customers, Discounts, and Orders board as it is more suiting for this question. However I can confirm that this is expected behaviour, as the Orders dataset from the ShopifyQL API does experience a delay in data of about 14 to 26 hours, occasionally longer.

If you do require data from orders that are the most up to date, I would recommend retrieving the data from the Order resource in the Admin API directly. Here's some relevant Shopify.dev documentation to help you with that as well.
 

  • order - GraphQL Admin API query to retrieve a single order by it's Global ID
  • orders - GraphQL Admin API query to retrieve multiple orders by various filters
  • Order - GraphQL Admin API Order object reference

 

I hope this helps, and I hope you have a great day!

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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

View solution in original post

Reply 1 (1)

ShopifyDevSup
Shopify Staff
1357 225 475

This is an accepted solution.

Hi @geordanacaixeta 

 

I've moved this thread to the Customers, Discounts, and Orders board as it is more suiting for this question. However I can confirm that this is expected behaviour, as the Orders dataset from the ShopifyQL API does experience a delay in data of about 14 to 26 hours, occasionally longer.

If you do require data from orders that are the most up to date, I would recommend retrieving the data from the Order resource in the Admin API directly. Here's some relevant Shopify.dev documentation to help you with that as well.
 

  • order - GraphQL Admin API query to retrieve a single order by it's Global ID
  • orders - GraphQL Admin API query to retrieve multiple orders by various filters
  • Order - GraphQL Admin API Order object reference

 

I hope this helps, and I hope you have a great day!

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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