Build a local connection request

United States
Canada
Europe

Use the OAuth 2.0 token

The REST Pay API requires that your app authenticate each request. With each request, your application must send a valid OAuth 2.0 API access token. See Use OAuth 2.0 for more information.

📘

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 and X-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);
});