Review queue
Risk flags, partner-submitted leads, commission edits, missed sales and rule order, over the API.
This page covers what you'd otherwise do by hand on the Risk and Leads screens, and on Commissions and Attribution too. Each call runs the same code as the dashboard button. The same plan limits apply, the same refusals come back, and every change lands in the audit log under the name of your API key.
Amounts are integer minor units with a currency, as everywhere. None of these calls pays anyone. A commission you create or edit here is paid in your next payout run, from the dashboard.
Risk
The risk checks look for fraud signals, such as a partner referring themselves. They run on plans with fraud monitoring. You can read the settings and the flags on every plan.
# What the checks run on
curl "https://api.affiliaterail.com/v1/risk_settings?program_id=prg_123" \
-H "Authorization: Bearer $KEY"
# What new numbers would have flagged over the last 30 days. Saves nothing.
curl -X POST https://api.affiliaterail.com/v1/risk_settings/preview \
-H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
-d '{"program_id":"prg_123","thresholds":{"velocity_per_hour":10}}'POST /v1/risk_settings saves the whole panel. A number you leave out goes back to its default. A number outside its range is refused with the range, and nothing is saved. POST /v1/risk_checks runs the sweep now instead of waiting for the hourly one.
Once a flag is open you have four moves:
| Call | What it does |
|---|---|
POST /v1/risk_flags/{id}/status | Marks it reviewing, or reopens it as open |
POST /v1/risk_flags/{id}/resolve | Closes it as resolved or dismissed, with a note |
POST /v1/risk_flags/{id}/suspend | Suspends the partner and closes the flag |
POST /v1/risk_flags/{id}/reject_commissions | Rejects the unpaid commissions the flag points at and closes it |
suspend and reject_commissions are separate on purpose. Suspending stops future earnings and leaves what the partner already holds. Rejecting takes back what they hold and leaves them able to earn again. Do one, the other, or both. Commissions already paid or inside a payout are skipped, each with its reason.
Leads
A lead is someone a partner says they referred outside the link. GET /v1/leads lists them, with the count in each state. POST /v1/leads/{id}/approve turns one into a customer credited to the partner, so their first payment earns a commission through your rules. If another partner already has that customer, the call is refused and names them. POST /v1/leads/{id}/decline takes a note, which the partner reads.
Commissions
POST /v1/commissions/{id} changes an unpaid commission's amount. A reason is required. The partner's balance moves by the difference. A paid commission, one inside a payout, and a clawback are refused.
curl -X POST https://api.affiliaterail.com/v1/commissions/com_123 \
-H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
-d '{"amount_minor":750,"reason":"Agreed a lower rate"}'POST /v1/commissions/retry judges sales again by your rules. It creates the commissions that are missing and updates unpaid ones whose amount differs. It's a dry run unless you send "dry_run": false, so you can read what it would do first. Running it twice changes nothing more.
Missed sales
When we see a paid invoice but can't tell which partner sent the customer, it shows up in GET /v1/unattributed_sales with the reason. POST /v1/unattributed_sales/{id}/attribute credits it to a partner you name. The commission is created through your rules as if it had been credited on the day.
Rules and the shelf
POST /v1/rules/reorder sets the order rules are tried in. Send every rule id once. The first rule that matches a sale pays it. POST /v1/rules/preview shows what a rule would have paid on the last 90 days of sales, next to your other rules, and saves nothing. POST /v1/resources/reorder and POST /v1/resources/rename_folder do the same job for the partners' resources shelf. POST /v1/sample_data turns the demo data on or off.
The API reference has every field. Over MCP, the same jobs are tools with a confirmation card first. See the tool reference.
Was this page helpful?