Skip to content

Products — Overview

Products represent items in your catalog. Each product can have multiple variants, and variants are the sellable, SKU-level items that get stored in locations and shipped to customers.


Product/Variant Hierarchy


GraphQL Types

ProductType

The root type for a product.

graphql
type ProductType {
  id: ID!
  title: String!
  description: String
  status: ProductStatusEnum!   # DRAFT | ACTIVE | DISABLED | ARCHIVED
  model: ProductModelEnum!     # PRODUCT | BUNDLE
  vendor: VendorType
  organization: OrganizationType
  variants: [VariantType!]!
  createdAt: DateTime!
  updatedAt: DateTime!
}
FieldTypeDescription
idID!Unique identifier
titleString!Display name of the product
descriptionStringFree-text product description
statusProductStatusEnum!Lifecycle status — see Product Statuses
modelProductModelEnum!PRODUCT or BUNDLE — see Product Models
vendorVendorTypeVendor/supplier associated with this product
organizationOrganizationTypeOwning organization
variants[VariantType!]!All variants belonging to this product
createdAtDateTime!Creation timestamp (ISO 8601)
updatedAtDateTime!Last update timestamp (ISO 8601)

VariantType

The sellable unit within a product. Each variant has a unique SKU within an organization.

graphql
type VariantType {
  id: ID!
  sku: String!
  title: String
  status: ProductStatusEnum!
  model: ProductModelEnum!     # PRODUCT | BUNDLE
  weight: Float
  weightUnit: WeightUnitEnum   # G | KG | LB | OZ
  height: Float
  width: Float
  length: Float
  distanceUnit: DistanceUnitEnum  # CM | IN
  barcode: String
  originCountry: String
  hsCode: String
  source: VariantSourceEnum    # APP | CMS
  product: ProductType
  links: [VariantLinkType!]    # Bundle components
  createdAt: DateTime!
  updatedAt: DateTime!
}
FieldTypeDescription
idID!Unique identifier
skuString!Unique SKU within the organization
titleStringVariant label (e.g. "Small / Blue")
statusProductStatusEnum!Lifecycle status
modelProductModelEnum!PRODUCT or BUNDLE
weightFloatWeight value
weightUnitWeightUnitEnumG, KG, LB, or OZ
heightFloatHeight in distanceUnit
widthFloatWidth in distanceUnit
lengthFloatLength in distanceUnit
distanceUnitDistanceUnitEnumCM or IN
barcodeStringEAN or UPC barcode
originCountryStringISO 3166-1 alpha-2 country code (e.g. FR)
hsCodeStringHS tariff code for customs
sourceVariantSourceEnumCreation source — see Source Management
productProductTypeParent product
links[VariantLinkType!]Component variants if this is a BUNDLE
createdAtDateTime!Creation timestamp (ISO 8601)
updatedAtDateTime!Last update timestamp (ISO 8601)

VariantLinkType

Describes a component variant and how many units are required per bundle.

graphql
type VariantLinkType {
  destination: VariantType!
  quantity: Int!
}
FieldTypeDescription
destinationVariantType!The component variant
quantityInt!Number of units required per bundle unit

Product Models

ModelDescription
PRODUCTStandard product with physical stock tracking
BUNDLEVirtual product composed of other variants; stock is derived from components

Product Statuses

StatusDescription
DRAFTNot yet published; can be modified freely
ACTIVEPublished and visible; can be used in orders
DISABLEDTemporarily hidden; can be re-enabled
ARCHIVEDPermanently archived; cannot be restored

Variant Lifecycle


Bundle Composition

A bundle variant has model: BUNDLE and references one or more component variants through links. Stock availability for a bundle is calculated as the minimum of (componentStock / requiredQuantity) across all links.

Use variantChangeModel to convert a standard variant into a bundle and define its component links.


Variant References

Variants can carry multiple external references (EAN, UPC, GTIN, ASIN, etc.) in addition to their primary SKU. References are managed via the references field in variantCreate and variantUpdate.

FieldTypeDescription
referenceStringThe reference value (e.g. "3614273474818")
typeStringThe reference type (e.g. EAN13, UPC, GTIN, ASIN)

Each (reference, type) pair must be unique within your organization. HappyColis will reject variant creation if a duplicate reference already exists.

HappyColis uses its own internal reference for each variant. Order lines inherit this reference to avoid conflicts when requesting preparation at the fulfillment location.


Source Management

Variants track their creation source to prevent conflicting updates. As multiple systems can work with the same product (e.g. your e-commerce site and your ERP), you can choose which one is the source of truth.

SourceDescription
APPCreated and managed through the HappyColis application
CMSCreated and managed through an external CMS (e.g. Shopify, WooCommerce)

A CMS-sourced variant can only be updated by the same OAuth client that created it. HappyColis will reject updates from a different source.

To change the source of truth for a variant, use the variantChangeSource mutation:

graphql
mutation VariantChangeSource($id: String!, $sourceType: ProductSourceEnum!, $sourceId: String) {
  variantChangeSource(id: $id, sourceType: $sourceType, sourceId: $sourceId) {
    id
    sku
    source
  }
}

Operations

Queries

OperationScopeDescription
productview_productsRetrieve a product by ID
variantview_productsRetrieve a variant by ID or SKU

Product Mutations

OperationScopeDescription
productCreatecreate_productsCreate a new product
productUpdateedit_productsUpdate product fields
productActivateedit_productsTransition product to ACTIVE
productDisableedit_productsTransition product to DISABLED
productArchiveedit_productsPermanently archive a product

Variant Mutations

OperationScopeDescription
variantCreatecreate_productsCreate a new variant
variantUpdateedit_productsUpdate variant fields
variantActivateedit_productsTransition variant to ACTIVE
variantDisableedit_productsTransition variant to DISABLED
variantArchiveedit_productsPermanently archive a variant
variantChangeModeledit_productsConvert variant to BUNDLE and set component links
variantChangeSourceedit_productsChange the source of truth for a variant

Best Practices

  1. Use meaningful SKUs. Create SKUs that are easy to identify and sort (e.g. TSHIRT-S-BLUE).
  2. Complete variant data. Include weight, dimensions, and customs info (originCountry, hsCode) for international shipping.
  3. Start in DRAFT. Create products and variants in DRAFT status, review, then activate.
  4. Bundle requirements. Bundles must have at least one link defined via variantChangeModel.
  5. Unique SKUs per organization. Each variant SKU must be unique within the organization.
  6. Irreversible archiving. Archiving a product or variant cannot be undone — prefer DISABLED for temporary removal.
  7. SKU is immutable. You cannot change a variant's SKU after creation. Archive the variant and create a new one instead.
  8. Stock reallocation requires support. If you need to move stock from one variant to another, contact HappyColis support — this cannot be done via the API.

HappyColis API Documentation