DASENTER Connections
All connectors

Webhooks

Lets your backend tell Dasenter the moment something real happens — a new order, a stock change, a product edit — instead of Dasenter having to keep asking.

What you need

  • A Dasenter account with at least one store already created
  • Access to your own backend's code (webhooks are signed, so this can't be done from a plain browser page)
  • Ten minutes

Steps

  1. 1Log in to your Dasenter dashboard and, if you have more than one store, pick the right one with the store switcher.
  2. 2Click Integrations in the left-hand menu.
  3. 3Find the card labeled "Dasenter Webhooks" and click Set Up Webhooks.
  4. 4Dasenter creates a real signing secret and shows it once, right there on the screen. Copy the entire value immediately — you cannot see it again afterward.
  5. 5Open your own backend's code and save that secret in its .env file, e.g. WEBHOOK_SECRET=whsec_<the secret you copied>.
  6. 6Save the file, then actually start (or restart) your backend so the new value is loaded.
  7. 7Every time something happens worth telling Dasenter about, your backend needs to "sign" the message before sending it — this just means running the exact message text through a locking formula (HMAC-SHA256) together with your secret, which produces a code nobody else could produce without knowing the same secret. The examples below do this exact step for you in two languages.
  8. 8Send the signed event with a POST request to the matching endpoint, for example POST /api/webhooks/inventory for a stock change.
  9. 9Check the reply: {"status":"processed"} means Dasenter accepted it for real.

Real examples

Using Node.js — signs and sends a real stock-change event

JavaScript

const crypto = require('crypto');

const secret = 'whsec_<your-generated-secret>';
const timestamp = Math.floor(Date.now() / 1000); // must be the current time, in seconds
const body = JSON.stringify({
  event: 'inventory.updated',
  store_id: 'your_store_id',
  event_id: 'evt_unique_id_123', // any value YOU choose, unique per event
  data: { sku: 'SHOE-001', quantity: 8, low_stock_threshold: 5 },
});

// The "lock" Dasenter checks against — it re-computes this same formula on
// its end using your secret, and only accepts the request if the two match.
const signature = 'sha256=' + crypto.createHmac('sha256', secret).update(`${timestamp}.${body}`).digest('hex');

await fetch('http://localhost:3001/api/webhooks/inventory', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-nexora-signature': signature,
    'x-nexora-timestamp': String(timestamp),
  },
  body, // send this exact same string you just signed — do not rebuild it
});

Using Python — the same signed event, step for step

Python

import hmac, hashlib, time, json, requests

secret = "whsec_<your-generated-secret>"
timestamp = str(int(time.time()))  # current time, in whole seconds, as text
body = json.dumps({
    "event": "inventory.updated",
    "store_id": "your_store_id",
    "event_id": "evt_unique_id_123",
    "data": {"sku": "SHOE-001", "quantity": 8, "low_stock_threshold": 5},
})

signature = "sha256=" + hmac.new(
    secret.encode(), f"{timestamp}.{body}".encode(), hashlib.sha256
).hexdigest()

requests.post(
    "http://localhost:3001/api/webhooks/inventory",
    data=body,  # send the exact same text you just signed, not requests' own json= re-encoding
    headers={
        "Content-Type": "application/json",
        "x-nexora-signature": signature,
        "x-nexora-timestamp": timestamp,
    },
)

What success looks like

Dasenter replies 200 with {"status":"processed"} (or "duplicate" if you safely retried the same event_id) — and on the dashboard, the product's stock number or order actually updates.

Common mistake

The single most common mistake: signing one version of the message text and then sending a slightly different one (extra spaces, different key order, re-encoded by a library). The signature only matches if the exact same text is signed and sent — always sign the final string first, then send that literal string, never rebuild it afterward. Separately: saving the secret in .env does not verify the integration by itself — your backend actually has to send one correctly signed request before it moves from Pending to Connected.

Making Product Push/Pull supported

This is the one native connector where Push/Pull genuinely exist — but Push specifically stays "not supported" on the Products page until you also set a destination URL on this integration's own setup page (Outbound product push destination). Inbound events (orders, inventory, products) work as soon as your backend sends its first correctly-signed request; outbound Push needs that one extra step first. Setting the URL alone isn't enough, though — your side also has to genuinely receive and correctly respond to what Dasenter sends there. That's the real, exact contract below.

Receiving Push — Dasenter POSTs a signed product to your destination URL; every field below is real, so map each one, not just sku/name/price

JavaScript

const crypto = require('crypto');
const express = require('express');
const app = express();
app.use(express.text({ type: '*/*' })); // raw text body — required to verify the signature exactly as sent

const OUTBOUND_SECRET = process.env.DASENTER_OUTBOUND_SECRET; // shown once on the Webhooks setup page

app.post('/dasenter/products', (req, res) => {
  const timestamp = req.header('x-nexora-timestamp');
  const signature = req.header('x-nexora-signature');

  const expected = 'sha256=' + crypto
    .createHmac('sha256', OUTBOUND_SECRET)
    .update(`${timestamp}.${req.body}`)
    .digest('hex');

  if (signature !== expected) {
    return res.status(401).json({ error: 'invalid signature' });
  }

  const { event, data: product } = JSON.parse(req.body); // event === "product.push"

  // This is the full, real shape of every product Dasenter ever sends —
  // support all of it, or a shopper on your own site sees stale or missing
  // data even though Dasenter thinks it already told you.
  const {
    sku,                // your own stable identifier — always present, never changes
    name,
    description,        // optional — may be absent, don't overwrite yours with blank
    price,               // integer, smallest currency unit (e.g. kobo, cents)
    currency,            // e.g. "NGN", "USD" — resend for EVERY product when a merchant changes their store's currency, not just new ones
    images = [],         // images[0] is the cover image; may be an empty array
    quantity,            // stock count — see the caveat below, this is not always fresh
    categories = [],     // plain strings, e.g. ["Groceries", "Snacks"]
    status,              // "active" | "draft" | "archived"
    variants = [],       // [{ name, sku, price, quantity }]
    attributes = {},     // developer-defined custom fields, e.g. { color: "Red", weight_kg: 1.2 }
  } = product;

  const existing = findProductBySku(sku); // your own lookup — decides created vs. updated below

  saveProduct({
    sku,
    name,
    description: description ?? existing?.description ?? '',
    price,
    currency,
    coverImage: images[0] ?? existing?.coverImage ?? null,
    gallery: images,
    // Quantity IS always included here, but changing stock alone (a
    // dashboard inventory edit, or an order automatically decrementing it)
    // does NOT by itself trigger a new push today — you'll only get a
    // fresher number the next time some other edit happens to push this
    // product again. Don't build a live "in stock" badge on this alone.
    quantity: quantity ?? existing?.quantity,
    categories,
    // Dasenter only distinguishes "active" from "not active" — draft and
    // archived both mean the same thing to you: don't show it to shoppers.
    visible: status === 'active',
    variants: variants.map((v) => ({ name: v.name, sku: v.sku, price: v.price, quantity: v.quantity })),
    customFields: attributes,
  });

  // This exact shape is what makes Dasenter count the push as genuinely
  // confirmed, not just "sent" — anything else (a different status field,
  // a non-2xx, no body at all) reports as failed or unverifiable instead.
  res.json({ status: 'ok', action: existing ? 'updated' : 'created', productRef: sku });
});

app.listen(3000);

Receiving Pull — Dasenter GETs the same destination URL (also signed) when you click "Pull from website"

JavaScript

app.get('/dasenter/products', (req, res) => {
  const timestamp = req.header('x-nexora-timestamp');
  const signature = req.header('x-nexora-signature');

  // Same signature check as Push, but signed over an empty body (a GET
  // carries none) — sign("") instead of sign(req.body).
  const expected = 'sha256=' + crypto
    .createHmac('sha256', OUTBOUND_SECRET)
    .update(`${timestamp}.`)
    .digest('hex');

  if (signature !== expected) {
    return res.status(401).json({ error: 'invalid signature' });
  }

  const products = /* your own real product list, mapped to Dasenter's shape */ [
    { sku: 'SHOE-001', name: 'Running Shoe', price: 15000, currency: 'NGN' },
  ];

  // Dasenter only accepts this exact shape — a bare array, or a
  // differently-named field, is reported as an unparseable response.
  res.json({ products });
});

What data actually comes through

Just as complete as the Dasenter API: any currency, full images/variants/categories/custom attributes on products. Order status is genuinely two-way here — an order.updated or order.cancelled event from your backend changes the real status in Dasenter at any point after creation, not just at the start.