Developer docs

Authentication: app tokens, OAuth credentials and developer API keys

Dispense Flow developers

In short

An installed app calls the App API with an access token (Authorization: Bearer dfapp_...) that belongs to one install on one store and carries only the scopes the store granted. The app gets that token by exchanging an OAuth authorization code with its client ID and secret. Your own scripts and the theme CLI use a developer API key (dfdev_...).

App access tokens

Each install of your app on a store gets its own offline access token, prefixed dfapp_. It reads only that store, and only what its scopes allow; a call outside them answers 403 with SCOPE_NOT_GRANTED. It does not expire. It stops working the moment the store uninstalls the app, or if the app or your developer account is suspended, and then answers 401.

We keep only a SHA-256 hash of every token, so we cannot show one again. If you lose a token, ask the store to install again (approving again issues a new code).

curl https://api.dispenseflow.com/v1/app-api/orders?limit=25 \
  -H "Authorization: Bearer dfapp_3f2a91c0_..."

OAuth client credentials

Every app has a public client ID (dfapp_ci_...) and a client secret (dfcs_...), used only on your server to exchange a code for a token at POST /v1/oauth/token. Rotate the secret from the app page at any time; the old one stops working at once. See Apps and OAuth for the flow.

Developer API keys

Under API keys you create keys that act as you, not as a store: the theme CLI pushes theme versions with one (DFTHEME_API_KEY=dfdev_... npx dftheme push). Keys are hashed, shown once and revocable.

Rate limits

Each install may make 120 App API calls a minute by default; past that the API answers 429 with standard RateLimit-* headers. Spread bulk reads with cursor pagination and use webhooks instead of polling. The token endpoint and sign-in are rate limited per IP.

Audit

Every App API call is logged with its method, path and status (never a body), along with installs, token issues and uninstalls. You see your app's log on the app page; the store sees what your app did on its store from its Integrations page.

Questions

Can I use a merchant API token from my app?

No. Merchant tokens (dflow_...) are the store owner's own key for their own scripts and AI agents. An app uses the scoped token the store granted it.

Do tokens expire?

No, they are offline tokens. They end when the store uninstalls the app or the app is suspended.