API Scoping & Access Control
API Scoping & Access Control
API Scoping & Access Control
All API integrations in Ottimate operate through OAuth applications tied to a specific API User. Understanding how data access is scoped is critical for integrations, especially in multi-company accounts.
When you integrate with Ottimate:
API Users can be scoped at three levels:
Examples:
Account-Scoped API User:
Company-Scoped API User (Company 123 only):
Location-Scoped API User (Location 456 only):
Every API request that creates or retrieves data must specify the appropriate company and/or location scope.
Most API endpoints require ottimate_company_id to specify which company’s data you’re working with.
Examples:
Invoices must be assigned to a specific location. Other resources (vendors, dimensions) are company-level and shared across all locations.
Examples:
Common Error: Attempting to create an invoice with an ottimate_location_id that doesn’t belong to the specified ottimate_company_id will result in a validation error.
To determine which company and location IDs to use:
Step 1: List all companies
Step 2: List all locations
Step 3: Match to your business logic
When creating an invoice, determine which company and location it belongs to based on your business rules (e.g., which ERP it came from, which site received the goods).