Payonclick Developer Docs
v1

Request Signing

The seven-line canonical message, a worked example to test your code against, and the mistakes that break it.


Every request carries X-Signature: an HMAC-SHA256 of the canonical message below, keyed with your signing secret, as lowercase hex.

Canonical message (7 lines, joined with \n)
POC1
{METHOD}            GET, POST, DELETE …
{PATH}              /ext/v1/bbps/billers
{QUERY}             category=electricity&page=1   (empty line when there is none)
{TIMESTAMP}         the X-Timestamp value
{NONCE}             the X-Nonce value
{BODY_SHA256}       SHA-256 hex of the exact body bytes (hash of "" when none)

signature = HMAC-SHA256(key=signing_secret, msg=canonical).hexdigest()
⚠️
Get these right

PATH is the full path exactly as written in the URL you send (/ext/v1/bbps/bill/pay, not /bill/pay). QUERY is the query string exactly as it appears in the URL you send, without the ? — build it once and use that same string in the URL and in the signature (do not let your HTTP library reorder or re-encode it). BODY: serialise once, hash that buffer, send that same buffer. No trailing newline after the last line. A new nonce on every request, retries included.

Worked example — test your code against this

Signing secret sk_live_0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef, POST /ext/v1/freedmt/charges, body {"amount": 1000}, timestamp 1785312000, nonce 6f1d2c3b4a5e6f708192a3b4c5d6e7f8. The canonical message is these seven lines (the fourth is empty: no query string):

POC1
POST
/ext/v1/freedmt/charges

1785312000
6f1d2c3b4a5e6f708192a3b4c5d6e7f8
2bc3ff4662cdced9a155389dad67abf995b70fe6854525eb1f8fb82e30607db9

and the signature is:

99e0f31ede959250f15ec97596cbb0534e465e272e2a781c0f5865b60c058815

With a query string — GET /ext/v1/bbps/billers?category=electricity&page=1, same secret and timestamp, nonce 0a1b2c3d4e5f60718293a4b5c6d7e8f9, no body — the signature is c7bbdd7c1aac508477cb29c1c4e08de9f97bbf34ae81058162e001b089e2ac0d.

Pick your language in the Request panel on any endpoint page — each sample computes this signature for that exact endpoint, ready to paste. The Python client wraps it in one helper.

If you get INVALID_SIGNATURE

CheckWhy
The secret, not the Key ID, is the HMAC keyThe Key ID only identifies the key
The body you hash is the body you sendPretty-printing or re-serialising changes the bytes
The query string is signed as sentLibraries that sort or encode params change it
Seven lines, POC1 first, no trailing newlineOne extra character changes the HMAC
The same timestamp and nonce in the headers and the messageThey are part of the message