Cannot find Retail API support

ZoeZoe Member Posts: 2
Dear team,

I’m new to learn how to use Lightspeed API, and after several testing, I can work with some APIs. But there are some issues that might need your support.

1.      An API that can download daily sales data?

We’ve now download daily report by Reports > Grouped Sales Totals > Items.

It seems that no API support this report on documental, right? Or I miss something?

I need following information for daily sales, any ideas for retrieving?

-          ID of item

-          SOLD qty


-          SUBTOTAL

2.      Some APIs not working
Although I provide all information it needs: authorization key, content setting...etc, some APIs can never work and will show below login page's xml script:

Any ideas? Your promptly reply will be much appreciated.


  • gregaricangregarican Member Posts: 901 
    edited September 2018
    Not specifically sure about #2, since you don't mention which API endpoints and what URI's are being used.

    As for #1, I have created some basic sales reports that communicate with the Sale and SaleLine API endpoints. See the two URL's below for their documentation.

    For an example URI, you could do something like this:{AccountId}/Sale.json?archived=false&load_relations=["SaleLines","SaleLines.Discount","SaleLines.Note","SaleLines.Item","SalePayments","SalePayments.PaymentType","SalePayments.SaleAccounts","Customer","Customer.Contact","Discount"]&offset=0&limit=100

    This would provide you details as to line item discounts, quantities sold, item identification, subtotals, etc. As long as you provide the correct Bearer Authorization in the header and the correct AccountId in the URI you should be set!
  • jamesratcliffejamesratcliffe Administrator, Lightspeed Staff Posts: 160 moderator

    1) Something like @gregarican suggested is the best option. You can't directly get that report, but all the data is there. You'll just have to crunch it.

    You can also filter by the completeTime to get sales for a specific day. Here's an example (with the other parameters left out so you can read it more easily):
    <a rel="nofollow" href="" title="Link:"></a>{AccountId}/Sale.json?completeTime=><,2018-09-01T00:00:00-0400,2018-09-01T23:59:0-0400
    Note that I have an offset of -0400 in each timestamp. This is the offset for my local time, EDT. You can adjust that to the local time offset of the store. If you don't specify an offset, all timestamps are assumed to be UTC.

    2) I haven't seen this before. Please give some examples of the URLs.
    James Ratcliffe
    Lightspeed HQ
  • ZoeZoe Member Posts: 2
    edited September 2018
    Hi Greg & James,

    Thanks for your help! All my problems are solved now.
    I'm just misunderstanding those documents.

    So after following the instructions, I can finally get all the data I want.
    Thanks a lot!

  • jamesratcliffejamesratcliffe Administrator, Lightspeed Staff Posts: 160 moderator
    You're welcome!
    James Ratcliffe
    Lightspeed HQ
Sign In or Register to comment.