I am currently working for an online market. Once a customer completes an order, I want to transfer that order into Sage Accounting using Sage API calls.
Here is how I have thought about implementing this process:
- Customer sends an order
- A script is called, taking the order details and creating an invoice through a sage API request.
My problem is that I cannot find a way to automatize the process before making the API request. Here is how a request must be made (according to the Sage API documentation) https://sageone-uk-help.s3.amazonaws.com/sageone_oauth.png .
I am aware of the refresh token, but the problem is the code needed to obtain the access token is generated after logging into Sage. The script will therefore do nothing if it reaches the login page.