Zum Inhalt springen
Leadtime
Deutsch
Esc
↑↓navigieren↵öffnen⌘Jvorschau

Create product category

Creates a new product category for organizing products in the catalog.

What are Product Categories? Product categories organize your product catalog into logical groups (e.g., Hardware, Software, Services, Subscriptions). They help structure products and make it easier to assign products in quotes, invoices, and projects.

How to create a product category:

  1. Provide a name (e.g., “Hardware”, “Software”, “Consulting”)
  2. Choose an icon in format :icon_name: (e.g., :computer:, :package:, :office_worker:)
  3. Optionally add a description
  4. Provide translations for multilingual support (name and description in different languages)

Icon format:

  • Use emoji-style format: :icon_name:
  • Examples: :computer:, :desktop_computer:, :money_with_wings:, :office_worker:
  • Default icon is :rocket: if not specified

Multilingual support:

  • Provide translations array with language codes (e.g., “en”, “de”)
  • Each translation can have a translated name and description
  • Translations appear automatically in multilingual user interfaces and documents

Note: This endpoint requires the manageSettings permission. Once created, the category can be used when creating or editing products in the catalog.

POST/administration/product-categories
Authorization
AuthorizationOAuth2 access token · headerrequired
Scopes:api:write
or
AuthorizationBearer token (JWT) · headerrequired
Request body
requiredapplication/json
descriptionobject

Optional description explaining what products or services belong to this category. Helps users understand the category purpose when creating or assigning products.

iconstringrequired

Icon identifier for the product category in emoji-style format :icon_name:. Icons help visually distinguish categories in lists and dropdowns. Examples: :computer:, :desktop_computer:, :money_with_wings:, :office_worker:, :package:. Default is :rocket: if not specified.

namestringrequired

Display name of the product category. This is the primary name used to identify and organize products. Examples: "Hardware", "Software", "Consulting", "Subscriptions".

translationsProductCategoryTranslationDto[]required

Array of translations for multilingual support. Each translation provides the category name and description in a specific language. Translations are automatically used in multilingual user interfaces and documents based on the user language preference. Common languages: "en" (English), "de" (German).

Show properties
Array of ProductCategoryTranslationDto
descriptionobject

Translated description of the product category in the specified language. This description appears in multilingual user interfaces and documents when the user language matches.

languagestringrequired

ISO 639-1 language code for the translation (e.g., "en" for English, "de" for German). This determines which language interface will display this translation.

nameobject

Translated name of the product category in the specified language. This name appears in multilingual user interfaces and documents when the user language matches.

Responses
201

Product category created successfully

createdAtstring<date-time>required

ISO 8601 timestamp indicating when the product category was created. Format: YYYY-MM-DDTHH:mm:ss.sssZ

defaultKeyobject

Default key identifier for system-defined categories (e.g., "software", "hardware", "consulting", "external_costs"). Only present for categories that were created from system defaults. Custom categories created by users do not have a defaultKey. This key is used when restoring default categories.

deletedAtobject

ISO 8601 timestamp indicating when the product category was soft-deleted, or null if not deleted. Format: YYYY-MM-DDTHH:mm:ss.sssZ. Soft-deleted categories are marked as deleted but not permanently removed.

descriptionobject

Optional description explaining what products or services belong to this category. Helps users understand the category purpose when creating or assigning products.

iconstringrequired

Icon identifier for the product category in emoji-style format :icon_name:. Icons help visually distinguish categories in lists and dropdowns.

idstringrequired

Unique identifier (UUID) of the product category. Use this ID to reference the category in other API calls.

namestringrequired

Display name of the product category. This is the primary name used to identify and organize products.

sortnumber

Numeric sort order for displaying categories. Lower numbers appear first. Used to control the order in which categories appear in dropdowns and lists.

translationsProductCategoryTranslationDto[]required

Array of translations for multilingual support. Each translation provides the category name and description in a specific language. Translations are automatically used in multilingual user interfaces and documents based on the user language preference.

Show properties
Array of ProductCategoryTranslationDto
descriptionobject

Translated description of the product category in the specified language. This description appears in multilingual user interfaces and documents when the user language matches.

languagestringrequired

ISO 639-1 language code for the translation (e.g., "en" for English, "de" for German). This determines which language interface will display this translation.

nameobject

Translated name of the product category in the specified language. This name appears in multilingual user interfaces and documents when the user language matches.

401

Unauthorized - Invalid or missing authentication token

403

Forbidden - Insufficient API scopes or permissions

Try it
Server
Authorization
Bodyapplication/json
Request
curl -X POST "https://leadtime.app/api/public/administration/product-categories" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "description": "Software products and licenses",
  "icon": ":package:",
  "name": "Software",
  "translations": [
    {
      "description": "Software products and licenses",
      "language": "en",
      "name": "Software"
    },
    {
      "description": "Softwareprodukte und Lizenzen",
      "language": "de",
      "name": "Software"
    }
  ]
}'
Response
{
  "createdAt": "2024-01-01T00:00:00.000Z",
  "defaultKey": "software",
  "deletedAt": null,
  "description": "Software products and licenses",
  "icon": ":package:",
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "Software",
  "sort": 1,
  "translations": [
    {
      "description": "Software products and licenses",
      "language": "en",
      "name": "Software"
    },
    {
      "description": "Softwareprodukte und Lizenzen",
      "language": "de",
      "name": "Software"
    }
  ]
}