Appearance
Sandbox vs live
A key minted with the hk_test_ prefix runs in sandbox mode; every other key is live. Mode is derived from the key alone - there is no separate environment toggle to forget - and is echoed on every response:
X-Harmon-Mode: sandboxGET /v1/ping also returns "mode": "sandbox" | "live", so you can assert your test environment is wired to a test key before placing an order:
bash
curl -s https://api.harmon.example/v1/ping \
-H "Authorization: Bearer hk_test_pub_your_key_here"
# → {"…":"…","mode":"sandbox"}How to use it
Use a sandbox key plus a sandbox merchant data set to build and test your integration end-to-end - read the catalog, build a cart, place an order - without ever touching live commercial data. When you're ready for production, swap in your live key; nothing else about your code changes.
Sandbox by default when exploring. The interactive Try-it console and the runnable snippets in these docs default to a sandbox (
hk_test_…) key and host so you can never accidentally mutate live data while learning the API.
Switching to live
- Issue a live key pair (publishable + secret) from the admin API keys screen - see Authentication & keys.
- Set the live key in your production configuration (server-side for the secret key).
- Confirm
GET /v1/pingreturns"mode": "live".
Next steps
- Authentication & keys - the publishable/secret capability split.
- Quickstart - your first sandbox call.
In the API Reference
GET /v1/ping- confirm whether a key resolves tosandboxorlive