Using an API to automate tax calculation and reporting

Surge777xSurge777x Posts: 4Member
edited August 23 in Development
I'm currently working on an API that can be accessed when an employee clicks a custom button on the sale screen. The flow I'm working on is as follows:

Employee clicks the GetTax Button -> Lightspeed opens a page to our API endpoint -> Using the account, store, and sale id from the query parameters call the Lightspeed API and get tax relevant information (store address, line items from sale, etc.) -> Access the Lightspeed API to update the tax on the order and the sale total. -> return to the sale page with the update sale information being used for the purchase.

Right now we're stuck on how to call back to the Lightspeed API without having our employee user having to login to the OAuth credentials anytime they need taxes. Judging from the documentation even if they sign in through OAuth they only are able to perform actions they could normally perform as an employee (Doubt they have access to change the sale price for an order).

*UPDATE: 

I've discovered the Refresh token feature to get an access token for my account. I am however having issues updating sale lines on an order. The documentation says I should be able to update fields like calcTax1, but after submitting a PUT request those values comeback the same as they were when I retrieved them from the API.

Post edited by Surge777x on

Best Answer

Answers

  • Surge777xSurge777x Posts: 4Member
    edited August 23
    Didn't mean to leave this as an answer I thought I was commenting on my own post.
  • Surge777xSurge777x Posts: 4Member
    I've discovered the Refresh token feature to get an access token for my account. I am however having issues updating sale lines on an order. The documentation says I should be able to update fields like calcTax1, but after submitting a PUT request those values comeback the same as they were before.
Sign In or Register to comment.