Implementation Basics

This page describes the rules that your server must follow for all endpoints of the SIHOT.PMS Gift Voucher Interface.

Base URL

SIHOT.PMS appends the endpoint name to the base URL that is configured for your server:

Endpoint URL
Token <base URL>/S_AUTHENTICATE
Get voucher <base URL>/S_EXTERNAL_GIFTVOUCHER_GET
Redeem voucher <base URL>/S_EXTERNAL_GIFTVOUCHER_REDEEM

The base URL can contain a path, for example https://giftvoucher.example.com/sihot. Provide it without a trailing slash: SIHOT.PMS adds the / before the endpoint name itself.

Provide your endpoints via HTTPS.

Requests

  • Method: SIHOT.PMS sends all requests as POST.
  • Token request: form-encoded body with Content-Type: application/x-www-form-urlencoded. See Authentication.
  • Voucher requests: JSON body with Content-Type: application/json and the header Authorization: Bearer <access_token>.
  • Environment: every request, including the token request, contains the header X-SIHOT-Env with the environment of the calling SIHOT.PMS installation (PROD, LAB, QA or DEV). Your server must check it, see Environment Check.
  • Transaction id: every voucher request contains a new transactionId (a GUID). Return it unchanged in your response. SIHOT.PMS does not compare it.
  • Waiting user: SIHOT.PMS waits for your response while the user waits. The hotel configures the timeout; the default is 10 seconds.

Environment Check

Your server must check the header X-SIHOT-Env and accept requests only from a SIHOT.PMS installation of the same environment as your system. For example, your production system accepts only requests with PROD, and your test system only requests from the corresponding test environment. This ensures that a test system never communicates with a production system, and vice versa.

  • Check the header already at the token request S_AUTHENTICATE. If the environment does not match, do not issue a token and answer with an error status, for example 403. SIHOT.PMS then shows the user that the authentication with the partner system failed.
  • Check the header on every voucher request as well, and reject requests from another environment with an error status, for example 403.
  • Include the environment in the token as claim env. See Authentication.
NOTE

SIHOT.PMS sends the header X-SIHOT-Env as of version 1100.06.02. Requests from earlier versions do not contain it.

Responses

HTTP Status

Status Meaning for SIHOT.PMS
200 (or 201) The response body is evaluated. result.success decides whether the operation was successful.
400 The response body is evaluated as well. Use it for business errors, with result.success = false.
Any other status The operation failed. SIHOT.PMS shows the HTTP status to the user and does not evaluate the body.
IMPORTANT

For 200 and 400, SIHOT.PMS decides only by result.success. A 400 response with result.success = true is treated as success. Always set result.success = false for errors.

Response Structure

Every response of S_EXTERNAL_GIFTVOUCHER_GET and S_EXTERNAL_GIFTVOUCHER_REDEEM must contain the following fields, also when the operation failed:

Field Rule
transactionId String, the transactionId of the request. Must not be null.
giftVoucher Array of vouchers. Can be empty if the operation failed.
result Object with the boolean success. If success is false, SIHOT.PMS shows errorCode and errorMessage to the user.

The field names are case-sensitive.

Sample Error Response

JSON
{
  "transactionId": "6F9619FF-8B86-D011-B42D-00C04FC964FF",
  "giftVoucher": [],
  "result": {
    "success": false,
    "errorCode": "VOUCHER_EXPIRED",
    "errorMessage": "The gift voucher has expired.",
    "messages": []
  }
}

If the response does not have this structure, SIHOT.PMS shows an error and does not continue.

Voucher Data

Each voucher in giftVoucher must contain all of the following fields with the given JSON types. A voucher with a missing field or a wrong type is ignored.

Field JSON type
status string
externalVoucherNumber string, identical to the requested voucher number (case-sensitive)
originalAmount number
remainingAmount number
partialRedemptionAllowed boolean
sellDate string, YYYY-MM-DD
expiryDate string, YYYY-MM-DD
IMPORTANT

SIHOT.PMS does not evaluate status, sellDate, expiryDate or partialRedemptionAllowed. If a voucher cannot be redeemed, for example because it is expired, blocked or not valid, answer with result.success = false and an errorMessage.

Data Formats

  • Amounts are JSON numbers. SIHOT.PMS sends amounts with two decimals, for example 60.00. Return amounts with at most two decimals.
  • Dates use the format YYYY-MM-DD. revenueDate is the business date of the hotel.
  • Voucher numbers should consist of ASCII characters only.