Overview
Legitmark supports localized API responses for taxonomy data — categories, types, sides, services, stages, and reasons. When you set the Accept-Language header, translatable fields are returned in the requested language instead of English.
This is useful for displaying category names, photo instructions, and rejection reasons in your users’ preferred language.
Supported Locales
| Locale code | Language | Example Accept-Language |
|---|
en | English (default) | Accept-Language: en |
zh | Chinese (Simplified) | Accept-Language: zh |
ja | Japanese | Accept-Language: ja |
If the header is omitted or contains an unsupported locale, the API defaults to English.
How It Works
Add the Accept-Language header to any request that returns translatable data:
const response = await fetch('https://api.legitmark.com/api/v2/categories?active_only=true', {
headers: {
'Authorization': 'Bearer leo_xxxxxxxxx',
'Accept-Language': 'zh'
}
});
const { data } = await response.json();
// data[0].name → "箱包" (instead of "Bags")
The response includes a Content-Language header confirming the locale used:
Translatable Endpoints
The following endpoints support localized responses:
Categories
| Endpoint | Translated fields |
|---|
GET /api/v2/categories | name |
GET /api/v2/categories/:uuid | name |
GET /api/v2/categories/:uuid/types | name (types) |
GET /api/v2/categories/tree | name (categories and types) |
Types
| Endpoint | Translated fields |
|---|
GET /api/v2/types | name |
GET /api/v2/types/:uuid | name |
Sides (photo requirements)
| Endpoint | Translated fields |
|---|
GET /api/v2/sides | name, description |
GET /api/v2/sides/:uuid | name, description |
GET /api/v2/sr/:uuid/side-groups | name, description (nested sides) |
Side translations are especially useful for displaying photo instructions to your users. For example, the side “Front” with description “Take a clear photo of the front of the item” can be shown in the user’s language.
Reasons (rejection reasons)
| Endpoint | Translated fields |
|---|
GET /api/v2/reasons | name, description |
GET /api/v2/reasons/:uuid | name, description |
GET /api/v2/reasons/grouped | name, description |
Services
| Endpoint | Translated fields |
|---|
GET /api/services/:uuid | name, description |
Stages
| Endpoint | Translated fields |
|---|
| Stage endpoints | title, description |
Service Requests (V2)
| Endpoint | Translated fields |
|---|
GET /api/v2/sr/:uuid | Embedded categories, types, sides, and reasons are translated |
Example: Localized Taxonomy Flow
A typical integration that presents taxonomy selection in the user’s language:
const userLocale = 'ja'; // from user preference
const headers = {
'Authorization': 'Bearer leo_xxxxxxxxx',
'Accept-Language': userLocale
};
// Step 1: Get categories in Japanese
const categoriesRes = await fetch(
'https://api.legitmark.com/api/v2/categories?active_only=true',
{ headers }
);
const { data: categories } = await categoriesRes.json();
// → [{name: "バッグ", uuid: "..."}, {name: "時計", uuid: "..."}, ...]
// Step 2: Get types for selected category (also in Japanese)
const typesRes = await fetch(
`https://api.legitmark.com/api/v2/categories/${selectedCategoryUuid}/types`,
{ headers }
);
const { data: types } = await typesRes.json();
// → [{name: "トートバッグ", uuid: "..."}, ...]
// Step 3: After SR creation, get side groups with localized instructions
const sidesRes = await fetch(
`https://api.legitmark.com/api/v2/sr/${srUuid}/side-groups`,
{ headers }
);
const { data: sideGroups } = await sidesRes.json();
// Sides have translated name and description for photo guidance
Fallback Behavior
- If a translation is not available for a specific field, the English value is returned
- If the locale header is malformed or unsupported, English is used
- Brands and models are not translated — they use their original names globally
Next Steps
- Review Taxonomy to understand the classification system
- Implement Workflow for the full service request lifecycle
- Set up Webhooks for real-time status updates