Zarstat

Docs

Server collect

Fire purchase or goal from your backend after the processor confirms. Same POST as the snippet. visitor_id is required. This is the Payment API stand-in. There is no Stripe or Paystack OAuth.

Markdown · same page for crawlers. index, follow.

Endpoint

POST https://www.zarstat.co.za/api/collect
Content-Type: application/json

CORS is open. Node fetch does not need a browser origin. Amount is rand, not cents. site_id is the same id as the dashboard. It is not a secret in this product. Do not put Paystack, Google, or database secrets on this call.

Purchase from a webhook

Pass the visitor_id you stored on initialize metadata. If you omit session_id, collect stores srv-{visitor_id}. That is not the browser tab session.

const res = await fetch("https://www.zarstat.co.za/api/collect", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    type: "purchase",
    site_id: "YOUR_SITE",
    visitor_id: order.visitor_id,
    amount: 199,
    currency: "ZAR",
    reference: order.reference,
  }),
});
const data = await res.json();
if (!data.ok) throw new Error(data.error || "collect failed");

Optional goal

await fetch("https://www.zarstat.co.za/api/collect", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    type: "goal",
    site_id: "YOUR_SITE",
    visitor_id,
    name: "signup",
  }),
});

Browser pageviews still use the snippet. Server collect does not invent a visitor. Without a real visitor_id the purchase will not join a journey. Paystack notes: visitor_id on initialize.