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

Import product from catalog

Imports a standardized product from the product catalog into a project. The product is copied into the project, allowing project-specific configuration without affecting the original catalog entry.

How it works:

  1. Select a product from the catalog by providing its productId
  2. Set the quantity for this product in the project
  3. Optionally select an active variant (e.g., Standard, Pro, Enterprise)
  4. Select any required options and optional add-ons

Product Isolation: When imported, the product becomes a copy within the project. Any subsequent changes to the product in this project do not affect the original catalog entry. This ensures historical accuracy for quotes and invoices.

Pricing: The final price is calculated based on:

  • Base product pricing (fixed, subscription, or per-unit)
  • Selected variant pricing adjustments
  • Selected option value extra pricing
  • Quantity multiplier

Required fields:

  • productId: UUID of the catalog product to import
  • quantity: Minimum 1
  • options: Array of option selections (can be empty array)

Optional fields:

  • activeVariantId: UUID of the variant to activate

Returns the ID of the newly created product in the project.

POST/projects/{projectId}/products
Authorization
AuthorizationOAuth2 access token · headerrequired
Scopes:api:write
or
AuthorizationBearer token (JWT) · headerrequired
Path parameters
projectIdstring<uuid>required

Project ID

Query parameters
fieldsToReturnstring

Comma-separated list of top-level response fields to return. Overrides the endpoint compact default unless responseShape=full is used.

responseShapestring

Advanced override. Omit for the endpoint compact default. Use full only when you need the complete endpoint response, including nested fields that are not selectable with fieldsToReturn.

Allowed:compactfull
Header parameters
LT-Response-Shapestring

Advanced override. Set to full only when you need the complete endpoint response, including nested fields that are not selectable with fieldsToReturn.

Allowed:full
Request body
requiredapplication/json
activeFromFixedDatestring<date> | null

Fixed start date when activeFromType is FixedDate. Format: ISO 8601 date (YYYY-MM-DD). Required when activeFromType is FixedDate.

activeFromTypestring

Type of activation start for the product. Immediately means it starts right away, ProjectBilling means it starts with project billing, FixedDate means it starts on a specific date.

Allowed:ImmediatelyProjectBillingFixedDate
activeVariantIdobject | null

UUID of the variant to activate for this product instance. Variants represent different configurations or tiers of a product (e.g., Standard, Pro, Enterprise). If not provided, no variant is active. The variant must belong to the product being imported.

contractPeriodMonthsnumber

Contract period in months. Defaults to 12 months if not specified.

customPricesobjectrequired

Custom price overrides for base product, variants, and options. Keys can be "base", "variant_<variantId>", or "option_<optionValueId>". Each value contains priceFixed, priceSubscription, and pricePerUnit overrides. These prices are applied to the product when saving.

optionsProductSettingOptionDto[]required

Array of option selections for this product. Options are add-ons or configuration choices that customers can select. Each option selection specifies which option is being configured and which values are selected. Required options must be included. Can be an empty array if no options are needed.

Show properties
Array of ProductSettingOptionDto
idstringrequired

UUID of the product option. This identifies which option (e.g., "Color", "Size", "Support Level") is being configured.

valuestring[]required

Array of UUIDs representing the selected option values. For example, if the option is "Color", this array might contain IDs for "Blue" and "Red" if multiple selections are allowed. Each value ID must be a valid UUID.

priceFrequencynumber

Billing frequency in months for subscription or per-unit pricing. Valid values: 1 (monthly), 3 (quarterly), 6 (semi-annually), 12 (annually).

productIdstringrequired

UUID of the catalog product to import into the project. The product must exist in the product catalog. When imported, a copy is created in the project that can be configured independently.

quantitynumberrequired

Number of units of this product to add to the project. Must be at least 1. The quantity affects the final price calculation when using per-unit pricing.

min 1
renewalModestring

Renewal mode for the product subscription. Automatic means the subscription will automatically renew, Stops means it will stop at the end of the contract period.

Allowed:AutomaticStops
Responses
201

Product imported successfully

successbooleanrequired

Operation success flag

400

Bad Request - Invalid input or validation error

401

Unauthorized - Invalid or missing authentication token

403

Forbidden - Insufficient permissions or no project access

404

Not Found - Catalog product or project does not exist

Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST "https://leadtime.app/api/public/projects/497f6eca-6276-4993-bfeb-53cbbbba6f08/products" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "activeFromFixedDate": "2024-01-01",
  "activeFromType": "Immediately",
  "activeVariantId": "550e8400-e29b-41d4-a716-446655440003",
  "contractPeriodMonths": 12,
  "customPrices": {
    "base": {
      "priceFixed": 100.5,
      "pricePerUnit": 10,
      "priceSubscription": 50.25
    },
    "variant_550e8400": {
      "priceFixed": 150,
      "pricePerUnit": 15,
      "priceSubscription": 75
    }
  },
  "options": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440004",
      "value": [
        "550e8400-e29b-41d4-a716-446655440005"
      ]
    }
  ],
  "priceFrequency": 1,
  "productId": "550e8400-e29b-41d4-a716-446655440002",
  "quantity": 2,
  "renewalMode": "Automatic"
}'
Response
{
  "success": true
}