SIHOT.POS authenticates at your server with credentials that you provide to the hotel. Your server returns a token, and SIHOT.POS sends this token with every following request.
You provide the following values to the hotel. The hotel enters them in the configuration of the voucher interface in SIHOT.POS:
| Value | Description |
|---|---|
| Base URL | URL of your server, for example https://voucher.example.com/v1/. See Implementation Basics. |
| Customer id | Id that you assign to the hotel. SIHOT.POS sends it as customerId. |
| User name | SIHOT.POS sends it as userName. |
| Password | SIHOT.POS sends it as userPassword. |
SIHOT.POS requests a token when it needs one for the first time.
Request – POST <base URL>auth/token
Response
Return the token in the field value with HTTP status 200:
auth/token. Make sure your server accepts it.
SIHOT.POS sends the token in the header Authorization of every voucher request:
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
401. It requests a new token only after a network error. Issue tokens that stay valid, and do not invalidate them, for example when your server restarts. Otherwise, SIHOT.POS cannot use your server until SIHOT.POS is restarted.
If the credentials are wrong, answer with an error status and a JSON body without the field value, for example the error object. SIHOT.POS then sends the voucher request with an empty token; reject it with 401. The cashier sees that the voucher status is unknown. SIHOT.POS requests a token again with the next GetVoucher request.
If the response to the token request has an empty body or a body that is not JSON, SIHOT.POS sends no voucher request, and the cashier sees a connection error.