Build a cloud connection request

Use the OAuth 2.0 token

Your application must send a valid OAuth 2.0 API access token with each request. See Using OAuth 2.0 for more information.

Components to build a cloud connection request

You can create a request using these components:

  • Environment- and region-specific base URL
  • Required headers (X-Clover-Device-Id and X-POS-ID)
  • Resource (endpoint) in use
  • Request body

🚧

Important

For Payment Card Industry (PCI) compliance, all requests must be made using a secure (HTTPS) connection.

Example request

Display a message on the device:

var request = require("request");

var options = {
  method: 'POST',
  url: 'https://sandbox.dev.clover.com/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);
});