Commission rules

Update a commission rule

Send the whole rule. branches replaces the list: branches with an id are kept (and the commissions citing them keep pointing at them), the rest are created, omitted ones are deleted.

Scope: commissions:write (or write)

post/v1/rules/{id}

Request

  • Base URL: https://api.affiliaterail.com
  • URL: https://api.affiliaterail.com/v1/rules/{id}
  • Auth: HTTP bearer

Path parameters

idstring required

Prefixed id (flw_…)

Example:flw_7uSyy9FqVLCFWrdPeZaK

Request body

namestring
descriptionstring nullable
group_idstring nullable

Prefixed id (grp_…)

partner_idstring nullable

Prefixed id (part_…)

trigger'new_payment' | 'new_signup'
action'generate_commission' | 'switch_group'
rate_type'percent' | 'fixed'
rate_valueinteger
approval_mode'immediate' | 'after_days' | 'manual'
approval_delay_daysinteger nullable
priorityinteger
status'active' | 'inactive'

Example request

{
  "group_id": "grp_7uSyy9FqVLCFWrdPeZaK",
  "partner_id": "part_7uSyy9FqVLCFWrdPeZaK",
  "branches": [
    {
      "id": "flb_7uSyy9FqVLCFWrdPeZaK"
    }
  ]
}

Response

The updated rule

idstring required

Prefixed id (flw_…)

object'rule' required
program_idstring required

Prefixed id (prg_…)

group_idstring nullable required

Prefixed id (grp_…)

partner_idstring nullable required

Prefixed id (part_…)

namestring required
descriptionstring nullable required
trigger'new_payment' | 'new_signup' required
action'generate_commission' | 'switch_group' required
rate_type'percent' | 'fixed' required
rate_valueinteger required

Basis points for percent, minor units for fixed. The fallback when no branch matches.

approval_mode'immediate' | 'after_days' | 'manual' required
approval_delay_daysinteger nullable required
priorityinteger required

Lower runs first

status'active' | 'inactive' required
switch_to_group_idstring nullable required

Prefixed id (grp_…)

metadataobject nullable required

Your own key/value data, stored as given

created_atstring date-time required

ISO-8601, UTC

updated_atstring date-time required

ISO-8601, UTC

Example response

{
  "id": "flw_7uSyy9FqVLCFWrdPeZaK",
  "program_id": "prg_7uSyy9FqVLCFWrdPeZaK",
  "group_id": "grp_7uSyy9FqVLCFWrdPeZaK",
  "partner_id": "part_7uSyy9FqVLCFWrdPeZaK",
  "switch_to_group_id": "grp_7uSyy9FqVLCFWrdPeZaK",
  "branches": [
    {
      "id": "flb_7uSyy9FqVLCFWrdPeZaK",
      "rule_id": "flw_7uSyy9FqVLCFWrdPeZaK",
      "created_at": "2026-08-21T10:15:30.000Z",
      "updated_at": "2026-08-21T10:15:30.000Z"
    }
  ],
  "created_at": "2026-08-21T10:15:30.000Z",
  "updated_at": "2026-08-21T10:15:30.000Z"
}

Changes

No recorded changes to this operation across all 1 revision of this API.