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

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

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} } } } } } } } } } } }

Thanks!!

That is exactly what I needed.