OIC - How to implement the "Product Update Webhook"

Whenever a product is created or updated in your system, you must notify OmniChat by sending a POST request to the product update endpoint.

The request must be authenticated using the authorization token. Check how to create your token here


Request

Method: POST
Content-Type: application/json
Authorization: Generated bearer token

The request body must contain a single product following the structure below.


⚠️

Send one product per request. For bulk synchronization, use the full sync integration — contact OmniChat support to configure it.


Example

curl --location 'https://oic-service.omni.chat/products' \
--header 'Content-Type: application/json' \
--header 'Authorization: your_token' \
--data '{
    "blocked": false,
    "objectId": "12345",
    "name": "iPhone 14 Pro",
    "productDescription": "Smartphone Apple iPhone 14 Pro",
    "externalUrl": "https://www.yourstore.com/iphone-14-pro",
    "sellOutOfStock": false,
    "trackInventory": true,
    "service": false,
    "categories": [
        "iphone14",
        "novo"
    ],
    "specifications": [
        {
            "key": "tela",
            "value": "OLED, HDR, Super Retina"
        },
        {
            "key": "chip",
            "value": "a19-pro"
        }
    ],
    "variants": [
        {
            "objectId": "12345-1",
            "erpId": "54321-1",
            "name": "iPhone 14 Pro 128gb Purple",
            "visible": true,
            "price": 9499.99,
            "salePrice": 9400,
            "quantity": 30,
            "refCode": "ABC-123",
            "unlimitedQuantity": false,
            "images": [
                "https://www.yourstore.com/images/iphone-14-pro-purple.jpg",
                "https://www.yourstore.com/images/iphone-14-pro-purple-2.jpg"
            ],
            "sellerId": "1",
            "sellerName": "Your Store",
            "width": 7.15,
            "height": 14.8,
            "variantLength": 1,
            "weight": 206,
            "variations": [
                {
                    "key": "Color",
                    "value": "Purple"
                },
                {
                    "key": "Storage",
                    "value": "128gb"
                }
            ]
        },
        {
            "objectId": "12345-2",
            "images": [
                "https://www.yourstore.com/images/iphone-14-pro-gold.jpg"
            ],
            "erpId": "54321-2",
            "name": "iPhone 14 Pro 128gb Gold",
            "visible": true,
            "price": 9399.99,
            "salePrice": 9200,
            "quantity": 28,
            "sellerId": "1",
            "sellerName": "Your Store",
            "width": 7.15,
            "height": 14.8,
            "variantLength": 1,
            "weight": 206,
            "variations": [
                {
                    "key": "Color",
                    "value": "Gold"
                },
                {
                    "key": "Storage",
                    "value": "128gb"
                }
            ]
        }
    ]
}'

References

Product

FieldTypeRequiredDefaultDescription
blockedbooleanNoFalseWhether the product is blocked from being displayed. Default: false
objectIdstringYesUnique product identifier in your system
namestringYesProduct name
productDescriptionstringNoProduct description
externalUrlstringNoURL to the product page on your website
variantsVariant[]YesAll available variants (including the main variant)
sellOutOfStockbooleanNoFalseWhether the product can be sold when out of stock
trackInventorybooleanNoTrueWhether inventory should be tracked for this product
specificationsSpecification[]No

Variant

FieldTypeRequiredDefaultDescription
objectIdstringYesUnique variant identifier
externalImageURLstringNoURL to the variant image
erpIdstringNoVariant identifier in your ERP system
namestringYesVariant display name
visiblebooleanNoTrueWhether this variant is visible to end users
pricenumberYesOriginal price
salePricenumberNoPromotional/sale price
quantitynumberNoAvailable stock quantity
sellerIdstringNoSeller identifier (for marketplace scenarios)
sellerNamestringNoSeller display name
widthnumberNoWidth in cm
heightnumberNoHeight in cm
variantLengthnumberNoLength in cm
weightnumberNoWeight in grams
variationsVariation[]NoList of variation attributes (e.g., color, size)

Specification

FieldTypeRequiredDescription
keystringYesSpecification name (e.g., "Color", "Size")
valuestringYesSpecification attribute value (e.g., "Purple", "128gb")

Variation

FieldTypeRequiredDescription
keystringYesVariation attribute name (e.g., "Color", "Size")
valuestringYesVariation attribute value (e.g., "Purple", "128gb")

Did this page help you?