affiliate.payment

Fired when a referred customer makes a payment and a commission is generated.

POSTYour webhook URL

The affiliate.payment event is triggered when a customer who was referred by an affiliate makes a payment. This event includes the payment amount and the commission generated for the affiliate.

Payload

json
{
  "id": "evt_cm1xyz9876",
  "event": "affiliate.payment",
  "created_at": "2026-04-08T14:30:00.000Z",
  "data": {
    "customer_email": "[email protected]",
    "affiliate": {
      "email": "[email protected]",
      "name": "Jane Smith",
      "referral_code": "jane-smith"
    },
    "product": {
      "id": "cuid_abc123",
      "name": "My SaaS"
    },
    "amount_cents": 4900,
    "commission_cents": 980
  }
}

Payload fields

ParameterTypeDescription
idrequired
stringUnique event ID (prefixed with evt_).
eventrequired
stringAlways "affiliate.payment" for this event.
created_atrequired
stringISO 8601 timestamp of when the event occurred.
data.customer_email
stringEmail of the paying customer (may be null).
data.affiliate.emailrequired
stringEmail of the referring affiliate.
data.affiliate.name
stringName of the referring affiliate (may be null).
data.affiliate.referral_coderequired
stringThe referral code used for this customer.
data.product.idrequired
stringYour Anderro product ID.
data.product.namerequired
stringYour product name in Anderro.
data.amount_centsrequired
integerPayment amount in cents (e.g. 4900 = $49.00).
data.commission_centsrequired
integerCommission amount in cents earned by the affiliate.

Example handler

javascript
app.post("/webhooks/anderro", (req, res) => {
  const { event, data } = req.body;

  if (event === "affiliate.payment") {
    const amount = (data.amount_cents / 100).toFixed(2);
    const commission = (data.commission_cents / 100).toFixed(2);

    console.log(
      `Payment: $${amount} from ${data.customer_email}, ` +
      `commission: $${commission} to ${data.affiliate.email}`
    );

    // Update your revenue tracking
    // Sync commission data to your accounting system
  }

  res.status(200).send("OK");
});

Amounts are in cents

All monetary values (amount_cents, commission_cents) are integers in cents. Divide by 100 to get the dollar amount.