Happening now | Office Hours: Customizing Your Theme With Moeed | Ask your questions now!

How to determine which month a lineItem from the Orders GraphQL data falls into

How to determine which month a lineItem from the Orders GraphQL data falls into

marvinbaltazar
Shopify Partner
10 0 0

Hello,

 

We are using the GraphQL API and rebuilding the "Total Sales by Order" report in Shopify's Admin Analytics dashboard. In this report the Order Line Items are grouped by month.

 

Using the `processedAt` timestamp in the Order data, this works for most of the cases. However, there were some instances where the Line Item month does not use the `processedAt` timestamp. For example, even though the `processedAt` timestamp is August 2024, some Line Items in the order appeared under September 2024 when you use the  "Total Sales by Order" report.

 

Some things we tried are:

- using the refund timestamp if the lineItem is refunded

- using the fulfillment updatedAt timestamp if the fulfillment status is "SUCCESS"

 

While the above works for the specific Orders in question, this does not work for the general case. Are there other scenarios/logic that we need to take into account in determining where the lineItem month should be?

Replies 0 (0)