curl --request POST \
--url https://api.exowpee.com/v1/catalog/pos-sync/instances/{instance}/heartbeat \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contract_version": 2,
"last_synced_at": "2023-11-07T05:31:56Z",
"lag_seconds": 1
}
'import requests
url = "https://api.exowpee.com/v1/catalog/pos-sync/instances/{instance}/heartbeat"
payload = {
"contract_version": 2,
"last_synced_at": "2023-11-07T05:31:56Z",
"lag_seconds": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({contract_version: 2, last_synced_at: '2023-11-07T05:31:56Z', lag_seconds: 1})
};
fetch('https://api.exowpee.com/v1/catalog/pos-sync/instances/{instance}/heartbeat', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.exowpee.com/v1/catalog/pos-sync/instances/{instance}/heartbeat",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'contract_version' => 2,
'last_synced_at' => '2023-11-07T05:31:56Z',
'lag_seconds' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/catalog/pos-sync/instances/{instance}/heartbeat"
payload := strings.NewReader("{\n \"contract_version\": 2,\n \"last_synced_at\": \"2023-11-07T05:31:56Z\",\n \"lag_seconds\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.exowpee.com/v1/catalog/pos-sync/instances/{instance}/heartbeat")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contract_version\": 2,\n \"last_synced_at\": \"2023-11-07T05:31:56Z\",\n \"lag_seconds\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/pos-sync/instances/{instance}/heartbeat")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contract_version\": 2,\n \"last_synced_at\": \"2023-11-07T05:31:56Z\",\n \"lag_seconds\": 1\n}"
response = http.request(request)
puts response.read_body{
"data": {
"contract_version": 123,
"action": "<string>"
}
}{
"message": "<string>",
"errors": {}
}Report device sync status
A POS device reports it is alive and how far it has synced, and is told whether it must update, rotate credentials or resync.
curl --request POST \
--url https://api.exowpee.com/v1/catalog/pos-sync/instances/{instance}/heartbeat \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contract_version": 2,
"last_synced_at": "2023-11-07T05:31:56Z",
"lag_seconds": 1
}
'import requests
url = "https://api.exowpee.com/v1/catalog/pos-sync/instances/{instance}/heartbeat"
payload = {
"contract_version": 2,
"last_synced_at": "2023-11-07T05:31:56Z",
"lag_seconds": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({contract_version: 2, last_synced_at: '2023-11-07T05:31:56Z', lag_seconds: 1})
};
fetch('https://api.exowpee.com/v1/catalog/pos-sync/instances/{instance}/heartbeat', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.exowpee.com/v1/catalog/pos-sync/instances/{instance}/heartbeat",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'contract_version' => 2,
'last_synced_at' => '2023-11-07T05:31:56Z',
'lag_seconds' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/catalog/pos-sync/instances/{instance}/heartbeat"
payload := strings.NewReader("{\n \"contract_version\": 2,\n \"last_synced_at\": \"2023-11-07T05:31:56Z\",\n \"lag_seconds\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.exowpee.com/v1/catalog/pos-sync/instances/{instance}/heartbeat")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contract_version\": 2,\n \"last_synced_at\": \"2023-11-07T05:31:56Z\",\n \"lag_seconds\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/pos-sync/instances/{instance}/heartbeat")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contract_version\": 2,\n \"last_synced_at\": \"2023-11-07T05:31:56Z\",\n \"lag_seconds\": 1\n}"
response = http.request(request)
puts response.read_body{
"data": {
"contract_version": 123,
"action": "<string>"
}
}{
"message": "<string>",
"errors": {}
}- The caller must present the device’s own access token as a bearer token, and the token must match the device in the URL; otherwise the call is refused with 401.
- The device must be active; a revoked device is refused with 401.
- state must be one of stale, syncing, synced or error, and contract_version is required and must be at least 1; the device cannot omit the contract version it was built for.
- Stores the last seen time, the reported state and the reported metadata (last sync time, lag, contract version) on the device.
- Clears a pending resync request when a device on the current contract reports synced with a last_synced_at later than the request.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identifier of the POS sync device (27-character KSUID).
Body
Validates the state reported by a POS instance heartbeat.
contract_version is REQUIRED, and that is the load-bearing rule of this whole
request: it is the version the till's applier and local schema were BUILT for.
A till that omits it cannot be told that its contract is behind, so it may not
omit it.
Local sync state reported by the device: stale, syncing, synced or error. Required.
stale, syncing, synced, error Integer version of the sync contract the device was built for, at least 1. Required; a version below the published one makes the answer update_required.
x >= 1When the device last finished a sync (ISO 8601). Optional; a synced report only clears a pending resync request if this is later than the request.
How many seconds the device is behind the catalogue stream, an integer of at least 0. Optional.
x >= 0Response
PosSyncHeartbeatResource
Items of this page.
Show child attributes
Show child attributes