Create business-scoped access token
Create a business-scoped JWT token for accessing business-specific endpoints. Requires a valid partner (unscoped) Bearer token in the Authorization header. Use the BearerUnscoped option in Swagger UI.
Documentation Index
Fetch the complete documentation index at: https://docs.thredfi.com/llms.txt
Use this file to discover all available pages before exploring further.
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
- 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
- Listing all businesses you manage
- Creating new businesses
- Partner-level reporting
How It Works
Step 1: Get partner token (unscoped)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
- Partner token is long-lived (typically 24 hours)
- Business token is also long-lived (typically 24 hours)
- Both can be refreshed by re-authenticating
- Store securely and never expose in client-side code
Authorizations
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
Response
Serializer for business-scoped token response
Business-scoped JWT Bearer token
Token expiration time in seconds
Token scope (always 'business_access')
ID of the business this token is scoped to
Token type (always 'Bearer')