Pair POS device
curl --request POST \
--url https://staging.api.commercengine.io/api/v1/{store_id}/storefront/pos/auth/pair-device \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"pairing_code": "<string>"
}
'import requests
url = "https://staging.api.commercengine.io/api/v1/{store_id}/storefront/pos/auth/pair-device"
payload = { "pairing_code": "<string>" }
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({pairing_code: '<string>'})
};
fetch('https://staging.api.commercengine.io/api/v1/{store_id}/storefront/pos/auth/pair-device', 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://staging.api.commercengine.io/api/v1/{store_id}/storefront/pos/auth/pair-device",
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([
'pairing_code' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$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://staging.api.commercengine.io/api/v1/{store_id}/storefront/pos/auth/pair-device"
payload := strings.NewReader("{\n \"pairing_code\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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://staging.api.commercengine.io/api/v1/{store_id}/storefront/pos/auth/pair-device")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"pairing_code\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.commercengine.io/api/v1/{store_id}/storefront/pos/auth/pair-device")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"pairing_code\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"success": true,
"content": {
"device": {
"id": "<string>",
"name": "<string>",
"device_type": "pos-terminal",
"external_device_id": "<string>",
"vendor": "<string>",
"model_number": "<string>",
"mac_address": "<string>",
"location_id": "<string>",
"location_name": "<string>",
"claimed_by": {
"id": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>",
"email": "jsmith@example.com"
},
"is_busy": true
}
}
}{
"message": "<string>",
"success": true,
"code": "<string>",
"error": {}
}{
"message": "<string>",
"success": false,
"code": "<string>"
}Device Management
Pair POS device
This endpoint allows a POS device to be activated by submitting a valid pairing code received via phone or email. The endpoint requires authentication with an API key that has the scope set to ‘storefront’ for a particular store, ensuring secure access for device activation operation.
POST
/
pos
/
auth
/
pair-device
Pair POS device
curl --request POST \
--url https://staging.api.commercengine.io/api/v1/{store_id}/storefront/pos/auth/pair-device \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"pairing_code": "<string>"
}
'import requests
url = "https://staging.api.commercengine.io/api/v1/{store_id}/storefront/pos/auth/pair-device"
payload = { "pairing_code": "<string>" }
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({pairing_code: '<string>'})
};
fetch('https://staging.api.commercengine.io/api/v1/{store_id}/storefront/pos/auth/pair-device', 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://staging.api.commercengine.io/api/v1/{store_id}/storefront/pos/auth/pair-device",
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([
'pairing_code' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$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://staging.api.commercengine.io/api/v1/{store_id}/storefront/pos/auth/pair-device"
payload := strings.NewReader("{\n \"pairing_code\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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://staging.api.commercengine.io/api/v1/{store_id}/storefront/pos/auth/pair-device")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"pairing_code\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.commercengine.io/api/v1/{store_id}/storefront/pos/auth/pair-device")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"pairing_code\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"success": true,
"content": {
"device": {
"id": "<string>",
"name": "<string>",
"device_type": "pos-terminal",
"external_device_id": "<string>",
"vendor": "<string>",
"model_number": "<string>",
"mac_address": "<string>",
"location_id": "<string>",
"location_name": "<string>",
"claimed_by": {
"id": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>",
"email": "jsmith@example.com"
},
"is_busy": true
}
}
}{
"message": "<string>",
"success": true,
"code": "<string>",
"error": {}
}{
"message": "<string>",
"success": false,
"code": "<string>"
}Was this page helpful?
⌘I