Endpoint Details
- URL:
/api/v0/taxes
- Method:
POST
- Authentication: Required (API Key Authentication)
- Content-Type:
application/json
Authentication
This endpoint requires API key authentication using:x-client-key
: Your API client keyx-client-secret
: Your API client secret
Request Body
Required Fields
Field | Type | Description | Validation |
---|---|---|---|
name | string | Tax name (e.g., “VAT”, “Sales Tax”, “GST”) | Required, non-empty |
percentage | number | Tax percentage rate (e.g., 15.5 for 15.5%) | Required, numeric |
Optional Fields
Field | Type | Description | Default | Validation |
---|---|---|---|---|
description | string | Detailed description of the tax | null | Optional string |
active | boolean | Whether the tax is currently active | true | Optional boolean |
appIds | string[] | Array of application IDs to associate with this tax | [] | Optional array of valid UUIDs |
Request Schema
Response
Success Response (201 Created)
Error Responses
Business Logic
Automatic App Association
The current authenticated application is automatically associated with the created tax. Even if
appIds
is provided, the current app ID will be added if not already included. This ensures the creating application always has access to the tax.Multi-Application Support
Application Scoping
Application Scoping
- Taxes can be shared across multiple applications within the same business
- Use the
appIds
array to specify which applications should have access to this tax - Applications not in the array won’t be able to access or use this tax
Business Isolation
Business Isolation
- Taxes are scoped to your business - other businesses cannot access your tax configurations
- All applications in the
appIds
array must belong to the same business - Tax calculations are performed consistently across all associated applications
Example Requests
Use Cases
Single Application Tax
Create a tax for your current application only
Multi-Region Tax Setup
Create taxes for different regions with specific applications
Seasonal Tax Preparation
Create inactive taxes for future use
Compliance Management
Set up tax rates for regulatory compliance
Detailed Use Cases
Create a tax for your current application only:Perfect for businesses operating in a single jurisdiction with one application.
Validation Rules
Name Validation
Name Validation
- Required: Yes
- Type: String
- Length: 1-100 characters
- Description: Must be descriptive (e.g., “VAT”, “Sales Tax”, “GST”)
- Examples: “California Sales Tax”, “UK VAT Standard Rate”, “EU VAT”
Percentage Validation
Percentage Validation
- Required: Yes
- Type: Number
- Range: 0-100%
- Decimal: Supports decimal places for precise rates
- Examples:
8.25
,20.0
,15.5
Description Validation
Description Validation
- Required: No
- Type: String
- Length: Maximum 255 characters
- Purpose: Explain what this tax covers
- Examples: “Standard VAT rate for goods and services”
AppIds Validation
AppIds Validation
- Required: No
- Type: Array of strings
- Format: Valid UUID v4 format
- Constraint: Applications must belong to the same business
- Auto-inclusion: Current application automatically included
Response Fields Explanation
Field | Description |
---|---|
id | Unique identifier for the tax |
name | Tax name as provided |
description | Tax description (if provided) |
business_id | ID of the business this tax belongs to |
percentage | Tax percentage rate |
active | Whether the tax is currently active |
created_at | Timestamp when the tax was created |
updated_at | Timestamp when the tax was last updated |
apps | Array of applications associated with this tax |
Integration Notes
With Invoices
With Invoices
- Created taxes can be associated with invoices using the
taxId
field in invoice creation - Only taxes associated with the invoice’s application can be used
- Tax calculations are performed server-side for accuracy
With Payment Links
With Payment Links
- Taxes can be applied to payment links for automatic tax calculation
- Tax amounts are calculated and displayed to customers
- Supports multiple tax rates per payment link
With Products
With Products
- While products don’t directly reference taxes, taxes are applied at the invoice/payment level
- Consider your tax strategy when organizing products and pricing
- Tax-inclusive vs tax-exclusive pricing strategies
Best Practices
1
Descriptive Naming
Use clear, descriptive names that indicate the tax type and jurisdiction:
2
Precise Percentages
Include decimal places for accurate tax calculations:
3
Regional Organization
Group taxes by region or jurisdiction for easier management:
4
Future Planning
Create inactive taxes for upcoming rate changes:
Security Considerations
Tax rates are sensitive business data and require proper authentication. Only applications within the same business can access shared taxes.
Access Control
Access Control
- Tax configurations are scoped to your business
- Only authenticated applications can create taxes
- Application isolation prevents unauthorized access
Audit Requirements
Audit Requirements
- Tax modifications should be tracked for audit purposes
- Consider implementing approval workflows for tax rate changes in production
- Maintain records of tax rate changes for compliance
Data Integrity
Data Integrity
- Tax calculations are performed server-side to ensure accuracy
- Percentage values are validated to prevent invalid rates
- Business association ensures proper data isolation
Rate Limiting
This endpoint is subject to the standard API rate limits:- Production: 1000 requests per hour per API key
- Development: 100 requests per hour per API key
Related Endpoints
GET /api/v0/taxes
- List all taxesGET /api/v0/taxes/{id}
- Fetch specific tax detailsPATCH /api/v0/taxes/{id}
- Update tax configurationDELETE /api/v0/taxes/{id}
- Delete tax