---
title: "List commission rules"
method: GET
path: "/v1/rules"
tags: ["Commission rules"]
---

# List commission rules

`GET /v1/rules`

## Request

- Base URL: `https://api.affiliaterail.com`
- URL: `https://api.affiliaterail.com/v1/rules`
- Auth: HTTP bearer

Ordered by `priority` then specificity (partner beats group beats program-wide). Each rule carries its ordered `branches`; the first matching branch wins, falling back to the rule's own rate.

**Scope:** `read`

## Query parameters

- `program_id` string, required: Required on every list
- `limit` string: 1 to 100, default 25
- `starting_after` string: Object id; returns the page after it (older)
- `ending_before` string: Object id; returns the page before it (newer)
- `expand[]` union: Relations to embed: group, partner
  - string
  - string[]
- `include[]` union: Nothing to include on this resource
  - string
  - string[]
- `status` 'active' | 'inactive'
- `group_id` string
- `partner_id` string

## Response `200`

Commission rules

- RuleList
  - `data` Rule[], required
    - `id` string, required: Prefixed id (`flw_…`)
    - `object` 'rule', required
    - `program_id` string, required: Prefixed id (`prg_…`)
    - `group_id` string, nullable, required: Prefixed id (`grp_…`)
    - `partner_id` string, nullable, required: Prefixed id (`part_…`)
    - `name` string, required
    - `description` string, nullable, required
    - `trigger` 'new_payment' | 'new_signup', required
    - `action` 'generate_commission' | 'switch_group', required
    - `rate_type` 'percent' | 'fixed', required
    - `rate_value` integer, required: Basis points for percent, minor units for fixed. The fallback when no branch matches.
    - `approval_mode` 'immediate' | 'after_days' | 'manual', required
    - `approval_delay_days` integer, nullable, required
    - `priority` integer, required: Lower runs first
    - `status` 'active' | 'inactive', required
    - `switch_to_group_id` string, nullable, required: Prefixed id (`grp_…`)
    - `metadata` object, nullable, required: Your own key/value data, stored as given
    - `branches` RuleBranch[], required
      - `id` string, required: Prefixed id (`flb_…`)
      - `object` 'rule_branch', required
      - `rule_id` string, required: Prefixed id (`flw_…`)
      - `position` integer, required
      - `label` string, nullable, required
      - `conditions` union, required: A comparison `{ field, op, value }` or a group `{ all: [...] }`, `{ any: [...] }`, `{ not: ... }`. Numeric ranges are inclusive.
        - object
          - `field` string, required
          - `op` 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'between' | 'in' | 'not_in' | 'contains' | 'starts_with' | 'is_true' | 'is_false', required
          - `value` unknown
        - object
          - `all` Condition[], required
        - object
          - `any` Condition[], required
        - object
          - `not` Condition, required (recursive)
      - `rate_type` 'percent' | 'fixed', required
      - `rate_value` integer, required
      - `created_at` string, date-time, required: ISO-8601, UTC
      - `updated_at` string, date-time, required: ISO-8601, UTC
    - `created_at` string, date-time, required: ISO-8601, UTC
    - `updated_at` string, date-time, required: ISO-8601, UTC
  - `has_more` boolean, required: Pass the last object's id as `starting_after` to fetch the next page
  - `total_count` integer, required: Count of every object matching the filters, ignoring the cursor

## Other responses

- `400`: Invalid request
- `401`: Missing or unknown API key
- `403`: Key lacks the required scope
- `404`: No such object in your organization
- `422`: The request was understood and refused
- `429`: Rate limited: see Retry-After

---

[API](https://skmtc.dev/affiliaterail/apis/affiliaterail-api.md) · [All operations](https://skmtc.dev/affiliaterail/apis/affiliaterail-api/llms.txt) · [OpenAPI document](https://skmtc.dev/affiliaterail/apis/affiliaterail-api/revisions/ea41f345c092?raw)
