POST
Your webhook URLThe commission.created event is triggered when a referred customer makes a payment and a commission is generated for the affiliate. This event fires alongside affiliate.payment but focuses specifically on the commission record.
Payload
json
{
"id": "evt_cm1xyz9876",
"event": "commission.created",
"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
| Parameter | Type | Description |
|---|---|---|
idrequired | string | Unique event ID (prefixed with evt_). |
eventrequired | string | Always "commission.created" for this event. |
created_atrequired | string | ISO 8601 timestamp of when the event occurred. |
data.customer_email | string | Email of the paying customer (may be null). |
data.affiliate.emailrequired | string | Email of the referring affiliate. |
data.affiliate.name | string | Name of the referring affiliate (may be null). |
data.affiliate.referral_coderequired | string | The referral code used for this customer. |
data.product.idrequired | string | Your Anderro product ID. |
data.product.namerequired | string | Your product name in Anderro. |
data.amount_centsrequired | integer | Payment amount in cents (e.g. 4900 = $49.00). |
data.commission_centsrequired | integer | Commission amount in cents earned by the affiliate. |
Example handler
javascript
app.post("/webhooks/anderro", (req, res) => {
const { event, data } = req.body;
if (event === "commission.created") {
const commission = (data.commission_cents / 100).toFixed(2);
console.log(
`New commission: $${commission} for ${data.affiliate.email}`
);
// Update your accounting system
// Track commission costs
}
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.