Your API key is the entire credential. Whoever holds it can call every endpoint your account can reach, including POST /v1/commerce/submissions, which places a real, billable order. Treat the key the way you would treat a saved payment method.
The key is a bearer token, so it is server-side only. Never put it in browser JavaScript, a mobile app bundle, a desktop client, or anything else the end user can open and read. Anyone who can view the code can spend against your account.
Every API key is tied to a WHCC account, so you need an account first. Sign up, then go to Connected Accounts in your account. You manage everything about your keys there, under API access and API keys. Each account can have up to 10 test keys and 10 live keys.
Test key
Test API access is enabled automatically for every account. Select Create key under Test API access and start building right away. Test keys work on apis-stage.whcc.com, where nothing is produced or billed.
Live key
Request Live access under API access on the same page. Live keys work on apis.whcc.com, where every submission is a real, billable order. Approval times vary.
Your request may show Pending review while our team takes a look. Once Live access is enabled, you create live keys the same way as test keys. See the FAQ for more.
Read the key from the environment at call time. Never write it into source, a committed config file, or a payload example.
1
2
3
4
5
6
# .gitignore (commit this)
.env
# .env (never committed)
WHCC_SANDBOX_API_KEY=<YOUR_TEST_KEY>
WHCC_PRODUCTION_API_KEY=<YOUR_LIVE_KEY>
1
2
3
4
5
# a shell does not read .env on its own, so load it first
set -a && . ./.env && set +a
curl https://apis-stage.whcc.com/api/v1/catalog/products \
-H "Authorization: Bearer $WHCC_SANDBOX_API_KEY"
Every example in these docs uses <YOUR_API_KEY> as a placeholder. When you copy one, substitute a variable rather than the literal key, so a pasted command never carries the credential.
local development
A .env file listed in .gitignore, or your OS keychain.
shared or deployed
A secret manager such as 1Password, AWS Secrets Manager, or HashiCorp Vault, injected as an environment variable at runtime. Anything shared over chat or email is a copy you can no longer account for.
.gitignore only protects a file that was never committed. If .env is already tracked, adding it to .gitignore changes nothing, and the key stays in history. See If a key is exposed.
Each key is bound to one account on one host. A test key does not work against Live, and a live key does not work against Test. The wrong key is rejected before the request reaches the API (Errors & Rate Limits).
https://
Test key. Build and test against this host first.
https://
Live key. A submission here is a real order that WHCC produces, ships, and bills you for.
Keep the two keys in different secret entries, and never let a test config fall back to the live key.
Request logging that dumps headers captures the credential on every call. Redact the Authorization header at the logger, and again before pasting anything into an issue, a support thread, or a bug report:
1
Authorization: Bearer [REDACTED]
If you need to identify which key produced a request, send the sk_ prefix and the four characters after it, never the whole value.
Give an agent access to the key through an environment variable or secret store its tools read at call time. Never paste the key into a prompt, a chat message, or an agent instruction file. See Build It with an Agent for the full setup.
Committed to a repository, pasted into a prompt, posted in a ticket, printed in a log someone else can read: treat them all the same way. Assume the key is compromised and stop using it.
Deleting the commit does not undo the exposure. The key remains in git history, in every clone and fork, and in any automated scanner that already read it. Rewriting history is not a substitute for revoking the key.
You manage your own keys on Connected Accounts, under API keys. Replace an exposed key in this order, so your integration never sits without a working key:
To check for orders you didn't place, list your submissions with GET /v1/commerce/submissions and look for any you don't recognize. If you find one, or you can't turn off the key yourself, email integrations@whcc.com with:
which key
The sk_ prefix and the few characters after it: enough to identify the key, not enough to use it. Never send the key itself. A support thread is one more place it would live.
when
When it was exposed and when you noticed, so we can tell unexpected activity apart from your own.
where
Where it was exposed (a public repository, an agent transcript, a log shipped off-site) and whether that location is still reachable.
To rotate keys on a schedule, use Set expiration on a key under API keys. Create the replacement and switch to it before the old key's expiration date, the same way as above, and the old key stops working on that date with no further step.
New to the WHCC API? Start with the Quick Start, which walks a print order end to end.
Looking for the rest of the reference? See the WHCC API Reference for hosts, endpoints, and the full response bodies.
Have a question about a route or your particular use case? Email integrations@whcc.com. We're happy to help before you build around an assumption.
Build with our API
Start adding our products into your app today. You don't need to talk to us first. Test API key access is available for every WHCC account. New to WHCC? Create an account first.
Established businesses with existing print volume
Tell us about your business and the partnership you have in mind, and we'll be in touch.
Tell us about your business and the partnership you have in mind, and we'll be in touch.