Quickstart

From zero to first webhook in five minutes.

You'll need an onpack account with at least one brand — start a free trial or sign in. All API calls use HTTPS and return JSON. Everything else you can copy off this page.

1. Issue an API token

Sign in, open your brand dashboard, and go to Settings → API. Name the token, tick the scopes it needs — dpp:read is enough for this page — and click Issue token. Copy the pkd_… value immediately: onpack stores only a hash, so it is shown exactly once.

!
A token reaches every brand your company owns unless you pin it to one when issuing it. Store it in a secrets manager, never in source control.

2. List your brands

Confirm the token works by hitting the brand index:

curl
curl https://onpack.io/api/v1/brands \
  -H "Authorization: Bearer pkd_••••••••••••••••"
Ruby
require "net/http"
require "json"
uri = URI("https://onpack.io/api/v1/brands")
req = Net::HTTP::Get.new(uri, "Authorization" => "Bearer #{ENV['ONPACK_API_TOKEN']}")
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |h| h.request(req) }
JSON.parse(res.body)
Node
const res = await fetch("https://onpack.io/api/v1/brands", {
  headers: { Authorization: `Bearer ${process.env.ONPACK_API_TOKEN}` }
});
const brands = await res.json();
JSON
[
  { "slug": "northfield", "name": "Northfield", "prefix": "NFD",
    "skus_count": 14, "units_count": 1842500, "scans_count": 8614 }
]

3. Register a webhook endpoint

In the dashboard, open Settings → Webhooks, click Add Webhook Endpoint, and enter a public HTTPS URL you control (a service like webhook.site is fine while testing). The default event subscriptions cover what your plan emits. Copy the whsec_… signing secret when it is shown, then click Send Test to confirm a signed webhook.test delivery lands.

4. Receive your first real event

Pack Identity: publish a product page — from the editor, or over the API with a PATCH …/passport — and a passport.published delivery arrives with the revision number, what changed and the page's URL.

Pack Experience: scan a production QR on your live packaging (or ask a teammate to). Within seconds a scan.processed delivery carries the full outcome: the scan, the collector (if signed in), and the promotion evaluated.

5. Verify the signature

Every delivery carries an X-Onpack-Signature header. See Webhooks → Verification for code in your language.

6. Go deeper

Common next steps: