Skip to main content

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 codeLanguageExample Accept-Language
enEnglish (default)Accept-Language: en
zhChinese (Simplified)Accept-Language: zh
jaJapaneseAccept-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:
Content-Language: zh

Translatable Endpoints

The following endpoints support localized responses:

Categories

EndpointTranslated fields
GET /api/v2/categoriesname
GET /api/v2/categories/:uuidname
GET /api/v2/categories/:uuid/typesname (types)
GET /api/v2/categories/treename (categories and types)

Types

EndpointTranslated fields
GET /api/v2/typesname
GET /api/v2/types/:uuidname

Sides (photo requirements)

EndpointTranslated fields
GET /api/v2/sidesname, description
GET /api/v2/sides/:uuidname, description
GET /api/v2/sr/:uuid/side-groupsname, 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)

EndpointTranslated fields
GET /api/v2/reasonsname, description
GET /api/v2/reasons/:uuidname, description
GET /api/v2/reasons/groupedname, description

Services

EndpointTranslated fields
GET /api/services/:uuidname, description

Stages

EndpointTranslated fields
Stage endpointstitle, description

Service Requests (V2)

EndpointTranslated fields
GET /api/v2/sr/:uuidEmbedded 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

  1. Review Taxonomy to understand the classification system
  2. Implement Workflow for the full service request lifecycle
  3. Set up Webhooks for real-time status updates