On this page
DocsGet started

Authentication

Every request carries a secret API key. The key says which account you are and which environment, sandbox or live, the request runs in.

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:

PrefixEnvironmentWhat it does
jp_test_SandboxTest orders. Nothing is printed, shipped or charged; charges are simulated.
jp_live_LiveReal 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.

GET/v1/orders
curl "https://jigsawpress.com/v1/orders?limit=3" \  -H "Authorization: Bearer $CORNERPIECE_KEY"
401 UnauthorizedMissing, unknown or revoked 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.

403 ForbiddenLive key before approval
{  "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:

  1. Create a new key in Dashboard › API keys.
  2. Deploy it to your servers.
  3. 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#

Authorizationrequest headerRequired
Bearer token: Bearer jp_test_… or Bearer jp_live_….
Content-Typerequest header
application/json on requests with a body.
JigsawPress-Versionrequest headerDefault 2026-11-01
Optional. The API version to use. Today there is one version, 2026-11-01.
Idempotency-Keyrequest header
Optional, on POST requests. Makes retries safe; see below.
Request-Idresponse header
On every response. Quote it when you contact us.

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.
POST/v1/orders
curl https://jigsawpress.com/v1/orders \  -H "Authorization: Bearer $CORNERPIECE_KEY" \  -H "Idempotency-Key: KP-20922" \  -H "Content-Type: application/json" \  -d @order.json
409 ConflictSame key, different body
{  "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.

GET/v1/account

Check your key: GET /v1/account#

Returns the account the key belongs to. Handy as a health check when you deploy a new key.

Returns
idstring
Your account id, acct_….
namestring
The business name on the account.
environmentstring
The environment of the key you used.
sandboxlive
live_accessstring
Where your live access request stands.
not_requestedpendingapprovedrejectedsuspended
tierstring
Your pricing tier. See Tiers and discounts.
startergrowthstudio
payment_methodobject | null
The card on file, {brand, last4}, or null.
GET/v1/account
curl https://jigsawpress.com/v1/account \  -H "Authorization: Bearer $CORNERPIECE_KEY"
200 OKResponse (live key)
{  "id": "acct_Rz4Kp9Wn2Xq7Lb",  "name": "Kindred Prints",  "environment": "live",  "live_access": "approved",  "tier": "growth",  "payment_method": {    "brand": "visa",    "last4": "4242"  }}