{% extends 'Layouts/Doc/default.html.twig' %} {% block title %}Documentation{% endblock %} {% block headerPageTitle %} {{ 'app.documentation.page.title.authorization'|trans |upper}} {% endblock %} {% block body %}

Authorization

In Popina Order's API all routes are protected by JWT authentication. If you would like to test these endpoints in our Swagger UI docs, you need to retrieve a JWT token (duration = {{tokenDuration}} min) first. You could do that by using an endpoint with your credentials for API as webshop, manager or show owner:

Login

In the response, you will get a token that has to be passed in each request header. In the Swagger UI, you can set the authentication token for each request.

Login response

Notice the Authorize button and unlocked padlock near the available URLs:

Authorize

Click the Authorize button and put the authentication token (remember about the Bearer prefix):

Bearer authorization

After clicking Authorize, you should see locked padlock near URLs and the proper header should be added to each API call:

After authorization

Refresh Token

A vital component in our authentication system, enabling secure and seamless user access management.

  • Endpoint: {{api_route_prefix}}/token/refresh

Parameters

  • refresh_token: The refresh token is obtained alongside the authentication token.
  • franchiseId: The franchise ID you intend to log in to.

Response

  • Token: Authentication token (duration = {{tokenDuration}} min).
  • refresh_token: Refresh token (duration = {{refreshTokenDuration}} min).

Headers

Each endpoint you call must contain the mandatory headers.

The mandatory headers are the folowing:

  • version: The API's version you like to use. The version changes from time to time when adding new feature or after fixing bugs. Available versions are (2.0.0).
  • source: The source of your request to help us identify which one requesting this endpoint. Available versions are (popina, kezia-cloud, jalia and foxorders-front).
  • franchise-token: To identify the franchise from which the request was made, this is a mandatory and blocking parameter for some endpoints. The token is used to ensure the legitimacy of the request.
  • shop-token: To be able to retrieve the default device token if the deviceToken parameter not communicated in the header. This is a mandatory and blocking parameter for some endpoints.
  • device-token: Each device (cash desk/terminal) has its own token. This is a mandatory and blocking parameter for some endpoints. For others if this parameter is not communicated, it takes the default value from shopToken parameter (C&C).

Google authentication

Popina Order provides seamless and secure authentication through Google accounts. With our Google authentication integration, users can easily sign up and sign in to your application using their Google credentials. This enhances the user experience by eliminating the need to create and remember additional login details.

Rate limiter

Rate limiter is a method of controlling traffic flow to a service or server by restricting the number of requests that can be made within a certain time frame. It is an essential technique for preventing resource abuse, ensuring fair use of services and protecting against DDoS attacks.

The current Rate limit for Popina Order is: {{rateLimiterLimit}} / {{rateLimiterInterval}}

{% endblock %}