Skip to main content

Pairing Code

POST /pos/pairing-code

Generates a 6-character alphanumeric pairing code that is displayed on the POS device screen. The merchant enters this code in the backoffice web portal to claim the device. This is the second step in the POS activation flow.

Purpose

  • Generate a short, human-readable code for device-to-portal pairing
  • The code is valid for 5 minutes (300 seconds)
  • Ambiguous characters (0, O, I, 1) are excluded to avoid confusion
  • Only one active pairing code per device at a time

Authentication

POS Activation Auth — device identification headers only.

HeaderRequiredFormatDescription
X-Device-IdYesPOS-{8_HEX_CHARS}Unique identifier for the physical POS device. Must match a pre-provisioned device. Example: POS-8F3A2C91
User-AgentYesViopay-POS/{version} ({OS}; {model})POS app version string. Must start with Viopay-POS/. Example: Viopay-POS/1.4.2 (Android 12; PAX-A920)
X-Client-TypeYesposClient type identifier. Always pos for POS devices.

See the Headers Reference for complete details.

Request

No request body is required.

Response

200 OK

{
"pairing_code": "K7M3NP",
"expires_in_sec": 300
}
FieldTypeDescription
pairing_codestring6-character alphanumeric code (uppercase, no ambiguous chars)
expires_in_secintegerSeconds until the code expires (always 300)

400 Bad Request

{
"error": {
"code": "4000",
"message": "X-Device-Id header is required",
"trace_id": "abc123..."
}
}

500 Internal Server Error

{
"error": {
"code": "5000",
"message": "Failed to create pairing code",
"trace_id": "abc123..."
}
}

Code Examples

curl -X POST https://api.viopay.io/pos/pairing-code \
-H "X-Device-Id: POS-8F3A2C91" \
-H "User-Agent: Viopay-POS/1.4.2 (Android 12; PAX-A920)" \
-H "X-Client-Type: pos" \
-H "Content-Type: application/json"

What's Next?

After displaying the pairing code on the POS screen, the device should poll the status endpoint to check if the merchant has claimed it:

Next step → Check Status