Introduction
Woosage50 has its own REST API that is used by the Woosage50 Service to transfer data between the website and Sage.
The Woosage50 API is an extension of the WordPress API and uses the endpoint https://WEBSITE-URL/wp-json/woosage/v1/ where WEBSITE-URL is the URL of the website where the Woosage50 plugin is installed.
The API was developed to replace the use of the WooCommerce API to ensure only the relevant data is being transmitted, in order to speed up processing and place less of a burden on the website. It performs a wide range of functions relating to orders processing, stock updates and products, using the HTTP GET and POST methods.
Note: The Woosage50 API does not use the PUT, PATCH or DELETE HTTP methods
Authentication
In order for the Woosage50 Service to access the API it has to be authenticated each time it is used using API keys passed with each call. There are two keys that are created in WooCommerce (see this article) and then stored in an encrypted configuration file that is used by the Woosage50 Service and supplied during installation.
The default method of of authentication (i.e. how the keys are passed to, and authenticated by, the website) is referred to as OAUTH 1.0, whereby the keys are encoded and passed in the Request Headers. Alternatively, the keys can be passed as an encoded parameter.
The Woosage50 API offers a basic authentication method that can be used where the server or website security settings prevent the above being used. This method can either encode the keys as a username & password string in the headers or pass the keys as parameters.
The authentication method and means of passing the keys is held in an encrypted config file that is created prior to the installation by the Woosage Support team and once set this should not require changing unless the website is moved to another server or security settings are changed,
Errors
As mentioned above, REST API errors should only occur when changes are made to the server or website security settings. However, if the service or website is unavailable then REST API error 10026 may occur. The details of the cause of the error will be reported in the log and via email with the following message.
There was a REST API error. If this persists please contact Woosage Support.
The error may be temporary (i.e. the website is down) and may resolve itself during subsequent processing cycles. If not, then
support@woosage.com giving details of full error message, including the details of the cause.