AuthOrigin
Documentation menu
Guides

Getting started

This guide takes you from a fresh account to a product your customers can verify — a product, a batch, a set of unique codes, and one verification. It takes about ten minutes.

1. Create an account and an API key

First, create an account (the Starter plan is free). Then, in the dashboard, open Settings → API keys and create a key. Copy it immediately — the secret is shown only once.

Keep keys server-side
API keys carry the permissions of your organization. Use them only from your backend — never ship a key in a browser, mobile app, or public repository.

2. Set the base URL and auth header

All API requests go to the versioned base URL and carry your key in the X-Api-Key header:

Base URL
https://api.getauthorigin.com/api/v1
bash
export AUTHORIGIN_KEY="ak_live_xxx"
export BASE="https://api.getauthorigin.com/api/v1"

3. Create a product

A product is the thing you make. At minimum it needs a name and SKU.

POST /products
curl -X POST "$BASE/products" \
  -H "X-Api-Key: $AUTHORIGIN_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Pain Relief 500mg",
    "sku": "ACME-PR-500",
    "category": "Pharmaceuticals",
    "description": "Box of 24 tablets"
  }'

The response includes the new product's id — you'll use it next.

4. Create a batch

A batch is a production run of a product. It sets the quantity and, optionally, the markets the goods are authorized for — a genuine unit scanned outside them is flagged as diversion.

POST /batches
curl -X POST "$BASE/batches" \
  -H "X-Api-Key: $AUTHORIGIN_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "productId": "prod_...",
    "batchNumber": "LOT-2026-0042",
    "quantity": 1000,
    "authorizedMarkets": ["US", "CA"]
  }'

5. Generate the codes

A barcode job mints unique, unclonable codes for a batch. Set approved and activateImmediately to true so the units are ready to verify as soon as they're printed.

POST /barcode-generation-jobs
curl -X POST "$BASE/barcode-generation-jobs" \
  -H "X-Api-Key: $AUTHORIGIN_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "batchId": "batch_...",
    "quantity": 1000,
    "format": "qr",
    "approved": true,
    "activateImmediately": true
  }'

Generation runs in the background. Poll GET /barcode-generation-jobs/{jobId} until its status is completed, then download the codes:

  • GET /barcode-generation-jobs/{jobId}/download — the generated code images, and
  • GET /batches/{id}/barcodes.csv — a CSV mapping each unit to its verification URL.

6. Verify a product

Each code encodes a verification URL of the form https://getauthorigin.com/v/{token}. Your customers verify simply by scanning it with a phone camera — no app required. You can also check one programmatically:

GET /v/{token}
curl "https://api.getauthorigin.com/v/THE-SCANNED-TOKEN"

The response returns the verdict (genuine, warning or counterfeit) with product and batch details.

That's the whole loop
Product → batch → codes → verify. Everything else — analytics, webhooks, recalls, distributor custody — builds on these same objects.
NextAuthentication