Stock Data Changed Web Hook

To allow POS to be updated real time with new data from Stock there is a web hook on the POS Engine.

You will need to have a Client ID and secret issued from the ID system.

Authenticating

You will need to acquire a bearer token from the IdP before sending a request to POS Engine.

This can be acquired by calling the following endpoint, with the method HTTP POST and a form body and content type of application/x-www-form-urlencoded

QA Endpoint = https://id.jsm.systems/realms/pos-qa/protocol/openid-connect/token

PROD Endpoint = https://id.jsm.systems/realms/pos-prod/protocol/openid-connect/token

Body

Name Value
grant_type client_credentials
client_id stock
client_secret TO BE PROVIDED
audience api-pos-engine
scope roles

The IdentityModel NuGet package can make this easier to manage :).

Web Hook Endpoint

To inform POS of any data changes then a POST call to the endpoints below with the site ID is all that is needed.

QA End Point = https://api.qa.pos.jsm.systems/webhooks/stock-data-changed?stockSiteId=XX

PROD End Point = https://api.pos.pubinvest.co.uk/webhooks/stock-data-changed?stockSiteId=XX

Authorization header as Bearer and then your token.