Get date of line item was added to an order by using Shopify API

Solved

Get date of line item was added to an order by using Shopify API

TomCalmigo
Shopify Partner
21 0 3

Hi,

I started to use the Admin REST API and Admin GraphQL API.

I'm trying to get specific information about lineItems of an order but I don't find any endpoints for that in the API of Shopify.

I am trying to the get the specific date about when a lineitem was added to an order or when a lineitem was removed (not refunded) from an order  (as you know orders in Shopify can be edited manually by people with sufficient permission in the website, and I'm trying to get the info with Shopify API of what exactly happened when an order was edited) 

 

Thanks for any helpers

Accepted Solution (1)

CloudlabSam
Shopify Partner
584 47 100

This is an accepted solution.

I believe you can use the agreements object within orders in the GraphQL API.

 

{ orders(first: 1, query: "name:#5019") { edges { node { name id agreements(first: 10) { edges { node { id happenedAt reason sales(first: 10) { edges { node { lineType actionType quantity totalAmount{shopMoney{amount}} ... on ProductSale { lineItem{id} } } } } } } } } } } }

 

View solution in original post

Replies 2 (2)

CloudlabSam
Shopify Partner
584 47 100

This is an accepted solution.

I believe you can use the agreements object within orders in the GraphQL API.

 

{ orders(first: 1, query: "name:#5019") { edges { node { name id agreements(first: 10) { edges { node { id happenedAt reason sales(first: 10) { edges { node { lineType actionType quantity totalAmount{shopMoney{amount}} ... on ProductSale { lineItem{id} } } } } } } } } } } }

 

TomCalmigo
Shopify Partner
21 0 3

Thanks!!

That is exactly what I needed.