Skip to content

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: sandbox

GET /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

  1. Issue a live key pair (publishable + secret) from the admin API keys screen - see Authentication & keys.
  2. Set the live key in your production configuration (server-side for the secret key).
  3. Confirm GET /v1/ping returns "mode": "live".

Next steps

In the API Reference

  • GET /v1/ping - confirm whether a key resolves to sandbox or live

Built on the Harmon platform — the storefront API for merchants.