Skip to main content

API Reference

Events & Webhooks

Subscribe to real-time events to keep your internal systems synchronized with Cobra Connect Distribution. Webhooks allow you to receive HTTP callbacks when data changes in your account.

Supported Events

TopicDescriptionPayload
order.createdFired when a new order is placed successfully.Order Object
order.updatedFired when an order status changes (e.g. to 'completed').Order Object
product.inventory_changedFired when stock levels change for a product.{ sku: string, new_stock: int }
shipment.tracking_updatedFired when new tracking info is available from the courier.Tracking Object

Verifying Webhooks

To ensure the webhook is coming from Cobra Connect Distribution, we sign each request with a shared secret. The signature is sent in the X-WC-Webhook-Signature header.

Node.js Example
const crypto = require('crypto');

function verifyWebhook(payload, signature, secret) {
const hash = crypto
.createHmac('sha256', secret)
.update(payload)
.digest('base64');

return hash === signature;
}