On this page
Authentication
API keys#
Send the key as a bearer token in the Authorization header on every request:
Authorization: Bearer jp_test_…There are two kinds of key, and the prefix tells you which is which:
| Prefix | Environment | What it does |
|---|---|---|
jp_test_ | Sandbox | Test orders. Nothing is printed, shipped or charged; charges are simulated. |
jp_live_ | Live | Real orders, made and shipped by us and charged to your card. |
You never pass the environment yourself; it comes from the key. Every object carries it in environment("sandbox" or "live"), and each environment only sees its own orders, charges and events. Fetching a sandbox order with a live key returns 404 resource_missing.
A missing, unknown or revoked key gets 401 invalid_api_key.
curl "https://jigsawpress.com/v1/orders?limit=3" \ -H "Authorization: Bearer $CORNERPIECE_KEY"{ "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The API key is missing, unknown or revoked.", "param": null, "request_id": "req_Xb4Nq8Lm2Rt7Vw" }}Live access#
Sandbox keys work as soon as you sign up. Live keys need our approval first: request live access in the dashboard with a card on file and a short description of what you are building. A person on our team reviews it.
Until the account is approved you cannot create live keys, and a live key on an account that is not approved (for example one that was suspended) gets 403 live_access_required. See Going live.
{ "error": { "type": "permission_error", "code": "live_access_required", "message": "Live access has not been approved for this account yet. Use a sandbox key, or request live access in the dashboard.", "param": null, "request_id": "req_Xb4Nq8Lm2Rt7Vw" }}Keeping keys secret#
- Server only. Call the API from your backend. Never put a key in a web page, a mobile app or a public repository; anyone with a live key can place orders that are charged to your card.
- Shown once. We show the full key once, when you create it. We store only a SHA-256 hash, so we cannot show it to you again. The dashboard shows the first characters and the last 4 so you can tell keys apart.
- One key per system. Give each server or integration its own named key. Then you can revoke one without breaking the others.
- Environment variables. Load the key from the environment or a secrets manager (the examples use
CORNERPIECE_KEY), not from code.
Rotating and revoking keys#
To rotate a key without downtime:
- Create a new key in Dashboard › API keys.
- Deploy it to your servers.
- Wait until the dashboard shows the old key is no longer being used (each key shows when it was last used), then revoke it.
Revoking takes effect right away: the next request with that key gets 401 invalid_api_key. If a key leaks, revoke it first and rotate afterwards.
Request and response headers#
Bearer jp_test_… or Bearer jp_live_….application/json on requests with a body.2026-11-012026-11-01.Versioning#
Send JigsawPress-Version: 2026-11-01 to pin your integration to the current version. It is optional; without it, requests use the current version. We add things over time (new endpoints, optional parameters, fields and event types), so write your code to ignore fields and event types it does not know.
Idempotency#
Networks fail after a request arrives. Send an Idempotency-Key header on POST requests so a retry cannot create a second order or a second charge. Your own order number makes a good key; any string you never reuse for a different request works.
- For 24 hours, a request with the same key and the same body returns the stored response from the first request, with the same status code.
- The same key with a different body gets
409 idempotency_key_reused. - Keys are scoped to your account and environment: the same key in sandbox and in live are two different keys.
curl https://jigsawpress.com/v1/orders \ -H "Authorization: Bearer $CORNERPIECE_KEY" \ -H "Idempotency-Key: KP-20922" \ -H "Content-Type: application/json" \ -d @order.json{ "error": { "type": "idempotency_error", "code": "idempotency_key_reused", "message": "This Idempotency-Key was already used with a different request body.", "param": null, "request_id": "req_Xb4Nq8Lm2Rt7Vw" }}Request IDs#
Every response, success or error, has a Request-Id header like req_Xb4Nq8Lm2Rt7Vw. Error bodies repeat it as error.request_id. Log it next to your own request. If something looks wrong, send it to developers@jigsawpress.com and we can see exactly what happened.
Check your key: GET /v1/account#
Returns the account the key belongs to. Handy as a health check when you deploy a new key.
acct_….{brand, last4}, or null.curl https://jigsawpress.com/v1/account \ -H "Authorization: Bearer $CORNERPIECE_KEY"{ "id": "acct_Rz4Kp9Wn2Xq7Lb", "name": "Kindred Prints", "environment": "live", "live_access": "approved", "tier": "growth", "payment_method": { "brand": "visa", "last4": "4242" }}