Helper tool

Helper tool (optional)

Mercury provides a web-based tool that generates authentication headers for you. Ideal for testing, debugging, and verifying your signing implementation.

What it does

The Mercury API Authentication Tool takes your credentials and request details, and outputs the exact headers you need, saving you from manual signature computation during development.

You provide
Your API Key
Your Secret Key
HTTP method (GET, POST, etc.)
Request path (e.g. /api/v1/client)
Request body (if applicable)
It generates

A unique nonce

The canonical string

The HMAC-SHA256 signature

Ready-to-use authentication headers

Access the tool

Open the authentication helper in your browser:

Mercury API Authentication Tool

mercury.global/internal/tools/api-auth

When to use it

Debugging auth failures

Compare the tool's output against your code's output to pinpoint exactly where your signing logic diverges.

Quick exploration

Test API endpoints quickly without writing code. Paste the generated headers into cURL or Postman and go.

Validating your implementation

Use identical inputs in both the tool and your code. If the signatures match, your implementation is correct.

Helper tool vs programmatic signing

Helper Tool Programmatic Signing
Best for Testing, debugging, one-off requests Production integrations, automated flows
Speed Instant, no code required Requires initial implementation
Scalable No. Manual per request Yes. Handles any volume automatically
Nonce handling Auto-generated by tool Your code generates unique nonce per request
Production use Not recommended Required

The helper tool is for development and testing only. Production integrations must generate signatures programmatically using your own code. See the Authentication: Step-by-Step guide for implementation details in 5 languages.

Debugging workflow

If your programmatic signing returns a 401, use the helper tool to isolate the problem:

1

Enter identical inputs

Use the exact same API key, secret, method, path, and body in both the helper tool and your code.

2

Compare the canonical string

The tool shows the canonical string it constructs. Compare character-for-character with your code's output. This is where most signing bugs hide.

3

Compare the signature

If canonical strings match but signatures differ, the issue is in your HMAC computation or encoding. Check you are using SHA-256 with Base64 output.

4

Test with tool's headers directly

Copy the tool's generated headers into cURL. If the request succeeds, your credentials are valid and the bug is in your signing code.

Ready to build your own signing?

The helper tool gets you started fast. When you are ready to implement programmatic signing, follow the step-by-step guide with code examples in 5 languages.


Did this page help you?