Skip to main content
POST
Create business-scoped access token

What is a Business-Scoped Token?

A business-scoped token is a JWT that grants access to a specific business’s data. It’s required for endpoints that operate on business-level resources (customers, invoices, bills, etc.).

Why Two Types of Tokens?

Partner Token (Unscoped):
  • Obtained from /oauth2/token/ using your Partner UUID + API Key
  • Used for partner-level operations: listing businesses, creating new businesses
  • Can access multiple businesses you own
  • Limited scope - cannot access business-specific resources
Business Token (Scoped):
  • Obtained from /{business_id}/oauth2/token/ using a partner token
  • Used for business-specific operations: managing customers, invoices, bills, payments
  • Locked to one business - can only access that business’s data
  • Required for most API endpoints

When Do You Need This?

Use business-scoped tokens for:
  • Managing customers for a specific business
  • Creating invoices or bills
  • Processing payments
  • Any endpoint with /businesses/{business_id}/ in the path
Use partner tokens for:
  • Listing all businesses you manage
  • Creating new businesses
  • Partner-level reporting

How It Works

Step 1: Get partner token (unscoped)
Step 2: Exchange for business-scoped token
Step 3: Use business token for operations

Code Examples

Security Note

Business-scoped tokens are more secure for business operations because:
  • They can only access one specific business
  • If compromised, the blast radius is limited to that single business
  • They can be revoked independently without affecting other businesses

Token Lifecycle

  1. Partner token is long-lived (typically 24 hours)
  2. Business token is also long-lived (typically 24 hours)
  3. Both can be refreshed by re-authenticating
  4. Store securely and never expose in client-side code

Authorizations

Authorization
string
header
required

Partner-level JWT token (unscoped). Token payload includes partner_id. Business access is validated via partner ownership. Format: Bearer <your-jwt-token>

Use this for: Multi-business operations where the business_id is specified in the URL and partner has access to multiple businesses.

Path Parameters

business_id
string<uuid>
required

Response

Serializer for business-scoped token response

access_token
string
required

Business-scoped JWT Bearer token

expires_in
integer
required

Token expiration time in seconds

scope
string
required

Token scope (always 'business_access')

business_id
string<uuid>
required

ID of the business this token is scoped to

token_type
string
default:Bearer

Token type (always 'Bearer')