Overview
This guide explains the exact HMAC-SHA256 signing contract used by the HopNow Client API.For the complete authentication overview, see Authentication.
Signing Contract
Every client API request must include these headers:
Use the API key’s
secret as the HMAC key. The api_key value goes in the X-API-Key header.
Examples:
Example Payload
For this request:Implementation Examples
Test Vectors
Use these fixed inputs to validate your local implementation before making API calls.Test Case 1: POST Request
Expected payload:
Test Case 2: GET Request With Query String
Expected payload:
Common Mistakes
- Signing the full URL. Sign
/v1/..., nothttps://api.hopnow.io/v1/.... - Omitting
X-Nonceor leaving the nonce out of the payload. - Signing a pretty-printed JSON body but sending compact JSON, or vice versa.
- Signing query parameters in a different order than the actual request URL.
- Reusing a nonce within the 5-minute replay window.
- Sending a Bearer token instead of the four HMAC headers.
Troubleshooting Checklist
- Log the exact payload before signing.
- Confirm the signed path starts with
/and includes the query string exactly as sent. - Confirm the timestamp header matches the timestamp in the payload.
- Confirm the nonce header matches the nonce in the payload.
- Confirm the body string is byte-for-byte the same string sent in the request.
- Confirm the HMAC key is the API key
secret, not theapi_keyheader value.