Skip to content

Platforms

Server API

Send events from your own backend: orders, refunds, subscription renewals, leads from a CRM. Server events are trusted, so they are the only way to record purchase and refund outside Shopify and WooCommerce.

Endpoint

POST https://t.yourstore.com/s/e

Use your tracking domain once it is live. Before that, use the shared endpoint with your store key:

POST https://edge.waiso.app/s/e?k=YOUR_STORE_KEY

Authentication

Each request is signed with the store's server secret (it starts with ss_). You see it once when you create the store; issue a new one under Settings, Stores. Keep it on your server only.

The X-Waiso-Signature header carries a Unix timestamp in seconds and an HMAC-SHA256 of "<timestamp>.<raw body>", hex-encoded:

X-Waiso-Signature: t=1762700000,v1=5f2b0c...e91a

Requests whose timestamp is more than 5 minutes off are rejected, so keep your server clock in sync. Sign the exact bytes you send.

Node.js

import { createHmac } from "node:crypto";

export function sign(secret: string, body: string, now = Date.now()) {
  const t = Math.floor(now / 1000);
  const v1 = createHmac("sha256", secret).update(`${t}.${body}`).digest("hex");
  return `t=${t},v1=${v1}`;
}

If you use TypeScript, signBody(secret, body) from @waiso/contracts does the same with Web Crypto.

PHP

function waiso_sign(string $secret, string $body): string {
    $t = time();
    return 't=' . $t . ',v1=' . hash_hmac('sha256', $t . '.' . $body, $secret);
}

Python

import hashlib, hmac, time

def sign(secret: str, body: bytes) -> str:
    t = int(time.time())
    mac = hmac.new(secret.encode(), f"{t}.".encode() + body, hashlib.sha256).hexdigest()
    return f"t={t},v1={mac}"

Request body

A batch of up to 100 events, at most 2 MB:

{
  "sent_at": 1762700000000,
  "source": "server_api",
  "anon_id": "0193f8a2-7c1e-7b3a-9d4f-2a6b8c0e1f35",
  "consent": { "analytics": true, "marketing": true, "sale_of_data": null, "gpc": false, "source": "none" },
  "click_ids": { "fbclid": "IwAR..." },
  "utm": { "utm_source": "facebook", "utm_medium": "paid", "utm_campaign": "autumn" },
  "events": [
    {
      "event_id": "0193f8a2-8d20-7f00-b1c2-5e6f7a8b9c0d",
      "type": "track",
      "event": "purchase",
      "ts": 1762700000000,
      "context": { "url": "https://yourstore.com/checkout/thank-you", "referrer": "" },
      "value": 129.9,
      "currency": "EUR",
      "order_id": "10045",
      "items": [{ "id": "tent-2p", "name": "Two-person tent", "quantity": 1, "price": 129.9 }],
      "user": { "email": "buyer@example.org", "phone": "+49 30 1234567", "country": "DE", "customer_id": "c_812" }
    }
  ]
}
FieldNotes
sourceAlways server_api for your own backend.
anon_idOptional. The visitor's Waiso ID, if you captured it in the browser, links the order to the visit.
consentThe visitor's consent as your store recorded it. Use "source": "none" if it did not come from a supported banner.
click_ids, utmOptional. Values from the landing URL, if you stored them with the order.
event_idA UUID, unique per event. Reuse it if you retry, and pass the same ID to a browser pixel so platforms deduplicate.
tsMilliseconds since the Unix epoch.
userRaw contact details. They are hashed at the edge and the raw values are discarded.

Optional headers

When you send the buyer's browser details, ad platforms match more conversions. They are only used if consent allows marketing.

HeaderValue
X-Waiso-Client-IpThe buyer's IP address
X-Waiso-Client-UaThe buyer's browser user agent
X-Waiso-Client-CountryTwo-letter country code, used to apply regional consent rules

Example

BODY='{"sent_at":1762700000000,"source":"server_api","consent":{"analytics":true,"marketing":true,"sale_of_data":null,"gpc":false,"source":"none"},"events":[{"event_id":"0193f8a2-8d20-7f00-b1c2-5e6f7a8b9c0d","type":"track","event":"purchase","ts":1762700000000,"context":{"url":"https://yourstore.com/thanks","referrer":""},"value":129.9,"currency":"EUR","order_id":"10045"}]}'
T=$(date +%s)
SIG=$(printf '%s' "$T.$BODY" | openssl dgst -sha256 -hmac "$WAISO_SERVER_SECRET" | sed 's/^.* //')
curl -X POST "https://t.yourstore.com/s/e" \
  -H "content-type: application/json" \
  -H "x-waiso-signature: t=$T,v1=$SIG" \
  --data "$BODY"

Responses

StatusMeaning
202Accepted. The body is { "accepted": n }, the number of events kept after consent and validation.
400The body is not valid JSON, fails validation (the first issues are listed), or uses a source other than server_api.
401The signature is missing, wrong or too old.
404The store key or tracking domain is unknown.
413The body is larger than 2 MB.

Retry 5xx responses and network errors with backoff, reusing the same event_id values. Waiso deduplicates by event ID, so a retried order is counted once.