Developer docs

Apps, scopes and the OAuth install flow

Dispense Flow developers

In short

Send the merchant to https://app.dispenseflow.com/dashboard/apps/authorize?client_id=…&redirect_uri=…&state=…. They see every scope in plain words and approve; the browser returns to your redirect_uri with code, state and store_id. Your server exchanges the code at POST https://api.dispenseflow.com/v1/oauth/token with your client ID and secret within ten minutes, and gets the store's access token.

Step 1: send the merchant to the consent screen

Use one of your registered redirect URLs (exact match) and a random state you keep in the merchant's session. A merchant can also start from their Integrations page, under Apps by developers, which opens the same screen.

https://app.dispenseflow.com/dashboard/apps/authorize?client_id=dfapp_ci_9f...&redirect_uri=https%3A%2F%2Fyourapp.example%2Fdflow%2Fcallback&state=6c1d...

Step 2: the merchant approves

The screen names your app and company, lists every scope with what it opens, shows the monthly price and the host the merchant returns to. Approving installs the app, creates its webhook endpoint for that store and sends the browser to:

https://yourapp.example/dflow/callback?code=dfac_...&state=6c1d...&store_id=6a0f...

Step 3: exchange the code

Check state, then exchange the code. It is single use and expires after ten minutes. JSON or form-encoded both work.

curl -X POST https://api.dispenseflow.com/v1/oauth/token \
  -d grant_type=authorization_code \
  -d client_id=dfapp_ci_9f... \
  -d client_secret=dfcs_... \
  -d code=dfac_... \
  -d redirect_uri=https://yourapp.example/dflow/callback
{
  "access_token": "dfapp_3f2a91c0_...",
  "token_type": "bearer",
  "scope": "read_store read_orders read_customers",
  "store_id": "6a0f...",
  "store": { "id": "6a0f...", "name": "Northside Health", "slug": "northside" }
}

Scopes

A store grants every scope your app requests, or does not install it. Ask only for what you use: merchants read the list. read_store comes with every app.

ScopeWhat it opensHealth information
read_storeThe store's name, address on the web and time zone. Every app gets this.No
read_productsProduct names, prices and whether they are published. Never what the store pays for them.No
read_ordersOrder numbers, totals, payment and shipping status, refunds and disputes. Not what was prescribed.No
read_customersCustomer names and email addresses, and contact form messages' sender details.No
read_subscriptionsSubscription and membership status, renewals and failed payments.No
read_marketingWhen email campaigns start sending and how many people they reach.No
read_visitsWhich customer started, finished, or was approved or declined for a visit, and for which product. This is protected health information: it needs a signed BAA and our approval.Yes: BAA and approval

The PHI scope

read_visits is protected health information. To request it you sign our Business Associate Agreement in the app form (your full name and the date are recorded), and we review the request by hand. Until we approve it, the scope is withheld from every install, test stores included, and the consent screen says so. Visit events go only to installs granted it. See HIPAA and PHI rules for developers.

Uninstalling

A merchant can uninstall at any time. The access token stops working at once, the webhook endpoint is removed and billing stops. Your next call answers 401: treat that as the uninstall and delete the store's data within 30 days, as the Developer Terms require.

Listing, review and paid apps

Drafts install only on your own test stores. Submit the app for review to list it for every store. An app may be free or charge a monthly price (USD 0 to 1,000): we bill it to the store on its platform invoice and credit your earnings each month, at the revenue share. Widening the scopes of a published app sends it back to review; existing installs keep what they granted until the merchant approves again.

Questions

Can my app request scopes later?

Yes. Edit the app and resubmit; send merchants through the consent screen again to grant the new scopes.

Can I list an app without a redirect URL?

No. Review needs at least one, so merchants who install from the Integrations page return to your app with a code.