Skip to content

variant/created

Overview

PropertyValue
Webhook typevariant/created
Kafka topicvariant.created
DirectionPlatform → Your endpoint

Description

Fired when a new product variant is created. A variant represents a specific SKU under a product — for example, a t-shirt in size M.

Trigger Conditions

  • A variant is created via the GraphQL API
  • A product import creates variants automatically
  • model will be PRODUCT for standard variants or BUNDLE for bundle variants

Message Envelope

json
{
  "header": {
    "organizationId": "org_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "messageId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "webhookId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "type": "variant/created",
    "date": "2024-03-15T10:23:45.000Z"
  },
  "body": { ... }
}

The body field contains the full variant object.

Body — Property Table

Variant Object

FieldTypeNullableDescription
idstring (uuid)NoUnique variant identifier
organizationIdstring (uuid)NoOrganization that owns this variant
productIdstring (uuid)NoParent product identifier
titlestringYesVariant display name
descriptionstringYesVariant description
referencestringNoInternal reference code (unique per organization)
skustringNoStock keeping unit (unique per organization)
barcodestringYesEAN/UPC barcode
modelenumNoPRODUCT or BUNDLE
statusenumYesDRAFT, ACTIVE, ARCHIVED, DISABLED, HOLD
sourceTypeenumNoOrigin source: CMS or APP
sourceIdstring (uuid)YesExternal source identifier
positionintegerYesDisplay sort order within the product
virtualProductbooleanNoWhether this is a virtual (non-physical) product
pricefloatYesVariant price (overrides product price)
vatRatefloatYesVAT rate as decimal
currencystringYesISO 4217 currency code
heightfloatYesHeight
widthfloatYesWidth
lengthfloatYesLength
distanceUnitenumYesUnit for dimensions: CM, IN, etc.
weightfloatYesWeight
weightUnitenumYesUnit for weight: KG, LB, etc.
volumefloatYesVolume
volumeUnitenumYesUnit for volume
alcoholRatefloatYesAlcohol percentage
originCountrystringYesISO 3166-1 alpha-2 country of origin
hsCodestringYesHarmonized System customs code
customsValuestringYesDeclared customs value
customsDescriptionstringYesCustoms description text
publishedAtstring (ISO 8601)YesTimestamp when the variant was published
createdAtstring (ISO 8601)NoCreation timestamp
updatedAtstring (ISO 8601)NoLast update timestamp

Full JSON Payload Sample

json
{
  "header": {
    "organizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "messageId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
    "webhookId": "c3d4e5f6-a7b8-9012-cdef-123456789012",
    "type": "variant/created",
    "date": "2024-03-15T10:23:45.000Z"
  },
  "body": {
    "id": "d4e5f6a7-b8c9-0123-defa-234567890123",
    "organizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "productId": "e5f6a7b8-c9d0-1234-efab-345678901234",
    "title": "Classic White T-Shirt — Size M",
    "description": null,
    "reference": "REF-TSHIRT-WHITE-M",
    "sku": "TSHIRT-WHITE-M",
    "barcode": "3760000000001",
    "model": "PRODUCT",
    "status": "DRAFT",
    "sourceType": "CMS",
    "sourceId": null,
    "position": 1,
    "virtualProduct": false,
    "price": 25.00,
    "vatRate": 0.20,
    "currency": "EUR",
    "height": 2.0,
    "width": 20.0,
    "length": 30.0,
    "distanceUnit": "CM",
    "weight": 0.25,
    "weightUnit": "KG",
    "volume": null,
    "volumeUnit": null,
    "alcoholRate": null,
    "originCountry": "FR",
    "hsCode": "6109100010",
    "customsValue": "12.00",
    "customsDescription": "Cotton T-shirt",
    "publishedAt": null,
    "createdAt": "2024-03-15T10:23:45.000Z",
    "updatedAt": "2024-03-15T10:23:45.000Z"
  }
}

Notes

  • The organizationId is read directly from data.organizationId.
  • sku and reference are unique per organization and are the primary keys used in order lines and stock references.
  • A newly created variant always has status: DRAFT until explicitly published.

HappyColis API Documentation