Getting "Refund Of" Info via API

ahallahall Member Posts: 4

Hello! Could someone point me to documentation on how to get the "Refund Of" information returned in an API call when a Sale is a refund of another Sale? Screenshot attached for reference. Thanks in advance!


  • ahallahall Member Posts: 4

    Still looking for a response on this. Is this information available via Lightspeed's API?

  • Adrian SamuelAdrian Samuel Moderator, Lightspeed Staff Posts: 654 moderator
    edited October 2019

    Hey @ahall,

    Thanks for the question! To get this information you'll want to do something like this:

    GET /API/Account/{accountID}/Sale.json?load_relations=["SaleLines"]&SaleLines.parentSaleLineID=>,0

    This will give you all sales that have sale lines associated with a parent sale (i.e. a refund).

    You will have to loop through them and perhaps create a dictionary/database record with the information

    You can then use an IN query from the results to retrieve the list of related saleIDs.

    To do this, run this query

    GET /API/Account/{accountID}/SaleLine.json?SaleLine.json?saleLineID=IN,[parentlDArray]

    Where parentIDArray is the list of all the parentIDs you retrieved from the previous query

    Relate them using logic/database lookups and then you have your matches]

    Hope this helps!

    Adrian Samuel

    Software Developer

    Lightspeed HQ

Sign In or Register to comment.