Skip to main content
Paylink uses an HMAC-SHA256 signature scheme to authenticate requests from your server. Instead of sending your secret directly in a header, you use it as a signing key to produce a cryptographic digest of each request. The server re-derives the same digest from the headers you send and rejects the request if the values do not match. This means your secret is never transmitted over the wire and a captured request cannot be replayed. The only endpoint that does not require authentication is GET /health.

Required Headers

Every protected request must include the following three headers.
string
required
Your active merchant API key identifier. Retrieve this from the Dashboard under Settings → API Keys. This value identifies which key pair was used to sign the request.
string
required
The current Unix timestamp in seconds as a decimal string (for example, "1700000000"). The server rejects requests whose timestamp is more than 5 minutes in the past or future, protecting against replay attacks.
string
required
A lowercase hexadecimal HMAC-SHA256 digest that proves you hold the API secret. See Signing Algorithm below for exactly how to compute this value.

Signing Algorithm

Build the message to sign by concatenating the timestamp, a colon, and the raw request body:
Signed message format
For requests with no body (for example, GET requests), use an empty string as the body:
Signed message — no body
Then compute the HMAC-SHA256 digest of that message using your API secret as the key, and encode the result as a lowercase hex string.

Security Tips

Sign the exact bytes you send as the request body. If you serialize the body to a string, sign that string, and then re-serialize or pretty-print before sending, the body bytes will change and the signature will be invalid. Build the body string once, sign it, and send it as-is.
Never expose your API secret in client-side code, mobile app bundles, or public repositories. The secret must only exist on your backend server. If you suspect a secret has been compromised, rotate the key immediately in the Dashboard — old keys are invalidated the moment you rotate.

Authentication Errors

When authentication fails, the API returns a 401 Unauthorized or 403 Forbidden response with a machine-readable error message. The table below lists every possible auth error and what it means.