Go live

The checklist

Markdown

A sandbox never issues a real pass, so going live happens in your organization, not here. Work through this list in your sandbox first, then repeat the last two items against the real organization.

Check your sandbox code

  1. Your key comes from PASSBOOK_KEY, never from source or a browser. A key sent with browser headers is refused with 403 KEY_IN_BROWSER.
  2. Every create sends an Idempotency-Key: see issue on purchase.
  3. Every update sends If-Match and handles 412 VERSION_CONFLICT: see update a pass.
  4. Errors are read by code, not by message. Retry only what the error entry marks retryable, with backoff, and honour Retry-After on 429.
  5. Webhook handlers verify the raw body, dedupe on event id and answer fast: see react to events.

Check what your key can do

Check which key you use
curl -X GET "https://passbook.mobile/api/v1/api-keys/me" \  -H "Authorization: Bearer $PASSBOOK_KEY"
import { PassBook } from '@passbook/sdk';const pb = new PassBook({ apiKey: process.env.PASSBOOK_KEY ?? '' });const key = await pb.apiKeys.retrieveCurrent();console.log(key.mode, key.scopes);
Copy as
Open in consoleOpens the console with this request filled in.

The scopes should be what your code needs and no more.

Rotate a webhook secret

Rotate before you launch and when a secret leaks. For overlapHours (0, 24 or 72, default 24) both secrets sign each request, one v1= each. Deploy the new secret inside that window; a verifier that accepts any matching v1= never drops an event.

Use your sandbox's capture endpoint: get its id first.

{ "eventTypes": ["pass.issued"] }
Open in consoleOpens the console with this request filled in.

Then rotate. Paste the endpoint id into the path.

{ "overlapHours": 24 }
Open in consoleOpens the console with this request filled in.

The new secret is shown once.

In your real organization

  1. Create a Live key with only the scopes you use. See API keys.
  2. Use your own Apple identity for passes you issue, so they carry your name. This is set in the admin, not the API.
  3. Make a webhook endpoint with your real URL, and check its first delivery.

Result

GET /api-keys/me on your sandbox shows mode: test. The same call with your Live key shows mode: live, your scopes and your organization.

Operations