Overview
The Smartbills API supports multiple languages and locales, allowing you to receive localized responses for your users. Use theAccept-Language header to specify the desired locale for each request.
Supported Locales
Default locale: If no
Accept-Language header is provided, the API defaults to en-CA.Setting the Locale
Include theAccept-Language header in your API requests to receive localized responses:
Code Examples
Localized Response Fields
When you specify a locale, the following elements are localized in API responses:Error Messages
Error messages are returned in the requested language:Category Names
Expense categories are automatically localized:Status Labels
Status labels are localized based on theAccept-Language header:
Validation Messages
Field-level validation messages are returned in the requested language:Fields That Are NOT Localized
The following fields are always returned as-is regardless of locale:- Identifiers:
id,code,status(machine-readable values) - Amounts:
amount,totalAmount(numeric values) - Dates:
date,createdAt,updatedAt(ISO 8601 format) - Currencies:
currency(ISO 4217 codes) - User-entered data:
merchant,notes,description(stored as entered) - Error codes:
codefield in error responses (machine-readable)
Fallback Behavior
If a translation is not available for a specific locale, the API falls back to English (en-CA):
de-DE is not currently supported, responses will fall back to English.
Currency and Number Formatting
The API returns raw numeric values. Locale-specific formatting should be handled client-side:Best Practices
Always Specify Accept-Language
Always Specify Accept-Language
Always include the
Accept-Language header to ensure consistent localization. Do not rely on default behavior.Store User Preferences
Store User Preferences
Store the user’s language preference in your application and include it in all API requests automatically.
Handle Missing Translations
Handle Missing Translations
Be aware that unsupported locales fall back to English. Design your UI to handle this gracefully.
Format Numbers and Dates Client-Side
Format Numbers and Dates Client-Side
The API returns raw values for amounts and dates. Use locale-aware formatting libraries on the client side for display.
Requesting New Languages
If you need support for additional languages, contact us at [email protected] with:- The language and locale you need
- Your use case
- Expected volume of requests
Related Resources
API Introduction
API overview and headers
Error Handling
Localized error messages
Authentication
Authentication and headers
Environments
Sandbox and production