Skip to content

API Overview

Key Concepts

The Terminals as a Service (TaaS) solution uses both a REST API over HTTPS as well as a web socket API over WSS. The REST endpoints are used to initially register POS systems and terminals with the TaaS Backend. Once a device is registered all communication is done through the WSS API using the device tokens returned from the REST API.

Examples in this documents are shown using curl for HTTPS connections and wscat for WSS connections.

REST Authorization

The REST API uses standard Authorization headers for authorization. The tokens used are provided by Paynetworx for general API operations. The responses will return per device tokens to be used specifically for the WSS connections.

Example:

sh
curl https://f1ysoj9np6.execute-api.us-west-2.amazonaws.com/dev
   -H "Content-Type: application/json"
   -H "Authorization: <APIToken>"

WSS Authorization

Due to the nature of WSS and the ability to support as many clients as possible, we accept either an Authorization header or a URL query parameter to authorize the WSS connection. As some clients may only support one or the other, either is usable by any client.

Example with header:

sh
wscat -c wss://9z4rjyxi1e.execute-api.us-west-2.amazonaws.com/dev
  -H "Authorization: <DeviceToken>"

Example with query parameter:

sh
wscat -c 'wss://9z4rjyxi1e.execute-api.us-west-2.amazonaws.com/dev?authorization=<DeviceToken>'

Web Socket Resources

WebSocket Authentication Information

WebSocket Information