Identifiers in API Import
How to correctly set product identifiers when creating and updating products via the Omnium API
This guide explains how to use product identifiers correctly when creating and updating products through the Omnium API.
API Overview
The Omnium API provides endpoints for creating and updating products. Understanding how identifiers work is essential for:
- Creating new products and variants
- Updating existing products without data loss
- Properly linking variants to their parent products
- Managing multi-language product catalogs
Creating Products
Single-SKU Product (No Variants)
For products without size/color variations:
Key points:
idmust be unique (convention:{productId}_{language})skuIdis required for purchasable itemsisSku: truemarks this as a stock-keeping unit- No
variantsarray needed
Product With Variants
For products with size, color, or other variations:
Key points:
- Parent product has
isSku: false(not directly purchasable) - Each variant has unique
idandskuId - Variants have
isSku: true variantParentIdis automatically set when saving via API
When you save a product with inline variants via the API, Omnium automatically sets the variantParentId on each variant to the parent product's id. You don't need to set it manually.
Sibling Products (Color Variations)
For products that share a parent but are separate entities (common in fashion):
Key points:
- Both products share the same
parentId - Each product has a unique
productId - Variants inherit the
parentIdfor consistency - The parent (
TSHIRT-SERIES) doesn't need to exist as a product
Multi-Language Products
Creating the same product in multiple languages:
Key points:
- Same
productIdlinks the translations - Different
idwith language suffix for uniqueness languagefield specifies the content language- Products are grouped in UI by shared
productId
Updating Products
Full Update (PUT)
Replaces the entire product document:
Full updates replace the entire document. If you omit variants in a PUT request, they will be removed. Always include all variants when doing full updates.
Partial Update (PATCH)
Updates only specified fields:
Key points:
- Only specified fields are updated
- Variants are not affected if not included
- Cannot change
idfield (immutable)
Adding Variants to Existing Products
Option 1: Full Product Update
Fetch the product, add the variant, save the entire product:
Option 2: Variant-Specific Endpoint
Some implementations provide direct variant management:
Identifier Validation
Automatic Behaviors
When saving products via API, Omnium performs these automatic operations:
| Field | Behavior |
|---|---|
productId | If empty, falls back to id |
language | If empty, uses default market's language |
variantParentId | Automatically set on inline variants |
created | Set to current UTC time if not provided |
modified | Always updated to current UTC time |
Validation Rules
| Rule | Description |
|---|---|
id required | Every product/variant must have a unique id |
id uniqueness | Duplicate id overwrites existing document |
skuId for SKUs | Required when isSku: true |
| Variant association | Variants must be included in product's variants array |
Common Patterns
Pattern 1: ERP Integration
When syncing products from an ERP system:
Use externalIds to maintain references to source systems without affecting the Omnium identifiers.
Pattern 2: E-commerce Platform Sync
When syncing from Shopify, Magento, etc.:
Pattern 3: Bulk Import
When importing many products, use batch endpoints:
Error Handling
Common Errors
| Error | Cause | Solution |
|---|---|---|
Id is required | Missing id field | Provide unique id |
Product not found | Invalid id in update | Verify product exists |
Duplicate SkuId | skuId already exists | Use unique skuId values |
Invalid variant | Variant missing required fields | Ensure variant has id and skuId |
Handling Overwrites
To prevent accidental overwrites, check if product exists first:
Best Practices
-
Use consistent ID patterns - Establish a naming convention and stick to it
-
Include language suffix in
id- Makes multi-language management easier -
Set
productIdexplicitly - Don't rely on fallback behavior -
Keep variants with products - Save products with their variants array intact
-
Use
externalIdsfor integration - Maintain source system references separately -
Validate before import - Check for duplicate IDs before bulk operations
-
Handle updates atomically - Fetch, modify, save as a single operation
See Also
- Product Identifiers Overview - Conceptual overview
- ID Property Reference - Detailed property documentation
- Identifiers in Excel Import - Excel import guidance
