N1 APIDemo shop

GUIDE

Demo shop

Synthetic shops and tokens for trying the API. Nothing here is real.

Every example in this site uses synthetic data: invented shops, people, GSTINs and phone numbers. There is no real customer data in Local or Staging, and there never will be.

Seeded demo shops

pnpm db:seed loads synthetic shops into your local database. Shop A has the id 0192f0c1-0000-7000-8000-00000000000a, and a second shop B exists so you can see that one shop never reads another’s data.

Getting a token

Until login (POST /auth/login, ticket N1C-021) ships, local Core accepts unsigned test tokens when started with N1_DEV_AUTH=stub. A test token is stub. followed by the base64url of a small JSON identity:

TOKEN="stub.$(printf '%s' '{"audience":"app","tenantId":"0192f0c1-0000-7000-8000-00000000000a","userId":"0192f0c1-0000-7000-8000-0000000000a1","roles":["owner"]}' | base64 | tr '+/' '-_' | tr -d '=')"
Test tokens are for your machine only. Core refuses to start with N1_DEV_AUTH=stub in production. Once login ships, paste a demo-shop token from a real sign-in instead.

Running requests from this site

The Run button sends the request from your browser to the environment you pick. Local Core must list this site’s origin in DOCS_ORIGINS (for example DOCS_ORIGINS=http://localhost:4321 pnpm dev) so the browser may call it. Your token stays in this tab (sessionStorage), is never stored anywhere else, and is sent only to the environment you picked.