Guardian
As the name suggests, the guardian is a core part of the HUB — its one of the security layers that the HUB has. On this page, we’ll dive into the guardian endpoint you can use to retreive a new accesstoken from the HUB. We'll look at how to create a new accesstoken for your application/integration.
The guardian API
The guardian API can only be used to create a new accesstoken within the HUB. The application or integration is responsible for the caching of the accesstoken. The default validity of the accesstoken is 24 hours.
Create accesstoken
This endpoint allows you to create a new accestoken for the POS in the HUB. This is done by providing the API key of the POS.
It is important to store the access token in a secure way on the server. This can be achieved through various methods such as encrypted files, databases, or other secure storage options. It is recommended to avoid storing the access token in plain text or in a publicly accessible location.
Request
curl -G https://payocityhub.com/api/v1/guardian \
-H "Authorization: Bearer {api_key}"
Response
{
"token": "6c9b58fc6e71f1339d9f0f68f8feb9daece972f02694e06b612393cd062876607e44884c03083d23854beccd35e3ea08c9bc7d98a66775c05e4c31a6ad6f50c5",
"expiration": 1695110571,
"expiration_datetime": "2023-09-19T10:02:51+02:00"
}