Component API Reference
API reference for working with product components, packages, and bundles in Omnium.
This page documents the API endpoints and patterns for working with product components.
Product Endpoints with Components
Get Product
Retrieve a product including its components.
Response with Components
componentId is only populated if it was explicitly set when the product was created or updated. If not set, it will be null in the response. The system auto-generates a componentId only when the package is added to a cart or order — this generated ID is not written back to the product.
Get Raw Product
Retrieve raw product data as stored.
Returns product with all component data exactly as stored.
Creating Package Products
Create Package
Create Bundle
Component Fields
Required Fields
| Field | Type | Description |
|---|---|---|
productId | string | Product ID of the component |
quantity | decimal | Quantity in the package |
Optional Fields
| Field | Type | Description |
|---|---|---|
componentId | string | Identifier for this component. Optional on the product — auto-generated at cart-time if not set. Set this if you need to reference components by ID. |
skuId | string | Specific variant SKU |
options | array | Selectable variants |
isRequired | bool | Component is required |
componentName | string | Display name for selection UI |
Component Options
Option with Price Offset
Option with ProductId Only
Allows customer to select any variant of the specified product.
Updating Components
Replace All Components
Add Component to Existing Package
Fetch product, modify components array, and update:
Searching for Packages
Find Packages Containing Product
Find all packages that include a specific component product.
Search by Component SKU
Order Endpoints with Components
Add Package to Order
With auto-breakdown enabled, this creates:
- Package line item
- Component line items linked to package
Add Package to Cart
Response Models
OmniumProductComponent
The API returns components using the public model:
OrderLine with Package Info
Common Patterns
Create Package with All Features
Variant Package
Create a variant that is a package:
Error Handling
Common Errors
| Error | Cause | Solution |
|---|---|---|
| Component product not found | Invalid productId | Verify component product exists |
| Invalid component SKU | SKU doesn't exist on product | Check variant SKUs |
| Circular reference | Package contains itself | Remove self-reference |
Validation
The API validates:
- Component products exist
- SKUs belong to the specified products
- No circular references in nested packages
- Required fields are present
