When request signing (Documentation Index
Fetch the complete documentation index at: https://developers.kotanipay.com/llms.txt
Use this file to discover all available pages before exploring further.
isSecure mode) is enabled on your integrator account, every request you send to the Kotani Pay API must include three additional headers carrying an HMAC-SHA256 signature. The server rejects any request that is missing these headers, uses a stale timestamp, or replays a nonce it has already seen.
Request signing governs requests from your server to Kotani Pay. It is separate from webhook signature verification, which covers the opposite direction — notifications Kotani Pay sends to your server. See Webhook Notifications for that.
Required Headers
Include all three headers on every request.| Header | Description |
|---|---|
x-timestamp | Unix timestamp in seconds (e.g. 1715123456). Must be within ±5 minutes of server time. |
x-nonce | UUID v4. Must be unique per request — each value is accepted exactly once. |
x-signature | HMAC-SHA256 of the signing payload using your API secret, hex-encoded. |
Signing Payload
Construct the payload string before computing the signature. POST / PUT / PATCHlastPathSegment is the final segment of the request URL path. For example, a request to /api/v3/wallets/fiat/64a1b2c3d4e5f6a7b8c9d0e2 uses 64a1b2c3d4e5f6a7b8c9d0e2.
Example signature value
Postman Pre-request Script
Paste this into the Pre-request Script tab of your Postman collection or individual request. It reads your secret from a Postman environment variable and automatically injects the three signing headers before each request.- Open your collection → Variables tab (or Environments) and add
KOTANI_PAY_SIGNATUREwith your secret value. - Paste the script into the collection’s Pre-request Script tab so it runs for every request automatically.
- Set your request body as raw → JSON. The script reads
pm.request.body.rawdirectly, so the body must already be the final JSON string before the script runs.
Postman uses CryptoJS (not Node’s
crypto module) — CryptoJS is available globally with no require() needed. Do not use crypto.createHmac here; it will throw a reference error.Code Snippets
Node.js
Python
Security Notes
- The nonce is single-use. Reusing a nonce that the server has already accepted returns
401 Unauthorized. Generate a fresh UUID v4 for every request. - The timestamp window is ±5 minutes. A request whose
x-timestampfalls outside that window returns401 Unauthorized. Ensure your server clock is NTP-synchronised. - Compact JSON serialisation is required. Use
JSON.stringifywithout formatting options in Node.js, andjson.dumps(..., separators=(',', ':'))in Python. Extra whitespace breaks the signature. - Your API secret is shown once. The secret is displayed at key generation time and cannot be retrieved afterwards. Store it in a secrets manager or environment variable — never in source code.
- Secure mode is permanent. Once request signing is activated for your account it cannot be turned off. Test your signing implementation in the sandbox environment before going live.
Getting Your API Secret
Your API secret is generated alongside your API key in the dashboard.- Log in → Settings → API Keys
- Click Generate Key and choose Secure mode
- Copy both the API key and the API secret immediately — the secret is shown only once