Signing Algorithm
Thesign field is computed as:
datais the request body payload (thedatafield ofReqPayload)merchant_tokenis your configured secret tokenHMAC-SHA256produces a binary digestHEXconverts it to a lowercase hexadecimal string (64 characters)
Important: JSON Serialization
Thedata object must be serialized to JSON with no extra whitespace. Different JSON libraries may produce different output:
Request Envelope
Each request must include these four fields as a JSON object:Language Examples
Node.js
Python
Java
Go
Verification
XPayLabs verifies each request by:- Recomputing the HMAC-SHA256 signature from the
datafield and your stored merchant token. - Checking that the computed signature matches the provided
signvalue. - Validating that the
timestampis within 5 minutes of the server clock. - Ensuring the
noncehas not been used before.
401 Unauthorized response:
GET Request Signing
ForGET requests that require authentication (e.g., /v1/order/status/{orderId}, /v1/order/pay, /v1/order/getOrderStatus), the sign parameter is passed as a query string value. The signature is computed over the relevant parameters (typically orderId):

