Build a local connection request
Use the OAuth API token
The REST Pay API requires that your app authenticate each request. With each request, your application must send a valid OAuth API access token
. For more information, see OAuth flows in Clover.
Note
Change authorization token validity period is not enabled for REST Pay Display. The validity period applies to temporary tokens returned during the pairing process for Network Pay Display.
Components to build a local connection request
You can create a request using these components:
- Environment and region-specific based URL (link)
- Required headers—
X-Clover-Device-Id
andX-POS-ID
- See REST Pay Display API overview tutorials for more details
- Resource (endpoint) in use
- Request body
See Locate unique identifiers (UUIDs) if you need help finding your app, developer, or test merchant's universal unique identifier (UUID) on the Developer Dashboard.
Important
For Payment Card Industry (PCI) compliance, all requests must be made using a secure (HTTPS) connection.
Example request
API code sample for interacting with the REST Pay Display:
Display a message on the device:
var request = require("request");
var options = {
method: 'POST',
url: 'https://'yourdeviceip':12346/connect/v1/device/display',
headers: {
accept: 'application/json',
'x-clover-device-id': 'deviceSerialNumber',
'x-pos-id': 'MyPOS',
'content-type': 'application/json',
authorization: 'Bearer OauthToken'
},
body: '{"text":"A message to show on the device","beep":true}'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
Updated 3 months ago