Skip to main content

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:
The signature is calculated over this payload:
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:
With:
The payload to sign is:

Implementation Examples

Test Vectors

Use these fixed inputs to validate your local implementation before making API calls.

Test Case 1: POST Request

Expected payload:
Expected signature:

Test Case 2: GET Request With Query String

Expected payload:
Expected signature:

Common Mistakes

  • Signing the full URL. Sign /v1/..., not https://api.hopnow.io/v1/....
  • Omitting X-Nonce or 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

  1. Log the exact payload before signing.
  2. Confirm the signed path starts with / and includes the query string exactly as sent.
  3. Confirm the timestamp header matches the timestamp in the payload.
  4. Confirm the nonce header matches the nonce in the payload.
  5. Confirm the body string is byte-for-byte the same string sent in the request.
  6. Confirm the HMAC key is the API key secret, not the api_key header value.