Update your program’s fraud detection rules. All fields are optional. If no fraud rules exist yet, they will be created with defaults.
Each rule mode accepts one of three values:
off — Rule is disabled
detect — Flag suspicious activity but allow the action
block — Prevent the action entirely
Body Parameters
Self-referral detection mode. Valid values: off, detect, block.
Cross-program ban detection mode. Valid values: off, detect, block.
Duplicate payout detection mode. Valid values: off, detect, block.
Suspicious email detection mode. Valid values: off, detect, block.
Banned referral detection mode. Valid values: off, detect, block.
Paid traffic detection mode. Valid values: off, detect, block.
Blocked country detection mode. Valid values: off, detect, block.
Configuration for banned referral detection. Set to null to clear.
Configuration for blocked country detection (e.g. {"countries": ["CN", "RU"]}). Set to null to clear.
Configuration for paid traffic detection. Set to null to clear.
Response
Returns the updated fraud rules object. Same structure as the Get Fraud Rules response.
curl -X PATCH "https://api.affonso.io/v1/program/fraud-rules" \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"self_referral_mode": "block",
"duplicate_payout_mode": "block",
"blocked_country_mode": "block",
"blocked_country_config": {
"countries": ["CN", "RU", "NG"]
}
}'
{
"success": true,
"data": {
"self_referral_mode": "block",
"cross_program_ban_mode": "off",
"duplicate_payout_mode": "block",
"suspicious_email_mode": "detect",
"banned_referral_mode": "off",
"paid_traffic_mode": "off",
"blocked_country_mode": "block",
"banned_referral_config": null,
"blocked_country_config": {
"countries": ["CN", "RU", "NG"]
},
"paid_traffic_config": null
}
}