AffiliateRail · Schema

Rule

AffiliatesSoftware-as-a-ServiceMarketingPaymentsAffiliateSoftwareCompany

Properties

Name Type Description
id string Prefixed id (`flw_…`)
object string
program_id string Prefixed id (`prg_…`)
group_id stringnull Prefixed id (`grp_…`)
partner_id stringnull Prefixed id (`part_…`)
name string
description stringnull
trigger string
action string
rate_type string
rate_value integer Basis points for percent, minor units for fixed. The fallback when no branch matches.
approval_mode string
approval_delay_days integernull
priority integer Lower runs first
status string
switch_to_group_id stringnull Prefixed id (`grp_…`)
metadata objectnull Your own key/value data, stored as given
branches array
created_at string ISO-8601, UTC
updated_at string ISO-8601, UTC
View JSON Schema on GitHub

JSON Schema

affiliaterail-com-rule-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/affiliaterail-com/json-schema/affiliaterail-com-rule-schema.json",
  "title": "Rule",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/affiliaterail-com-commission-rules-api-openapi.yml#/components/schemas/Rule",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^(sample_)?flw_",
      "description": "Prefixed id (`flw_…`)"
    },
    "object": {
      "type": "string",
      "enum": [
        "rule"
      ]
    },
    "program_id": {
      "type": "string",
      "pattern": "^(sample_)?prg_",
      "description": "Prefixed id (`prg_…`)"
    },
    "group_id": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^(sample_)?grp_",
      "description": "Prefixed id (`grp_…`)"
    },
    "partner_id": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^(sample_)?part_",
      "description": "Prefixed id (`part_…`)"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "trigger": {
      "type": "string",
      "enum": [
        "new_payment",
        "new_signup"
      ]
    },
    "action": {
      "type": "string",
      "enum": [
        "generate_commission",
        "switch_group"
      ]
    },
    "rate_type": {
      "type": "string",
      "enum": [
        "percent",
        "fixed"
      ]
    },
    "rate_value": {
      "type": "integer",
      "description": "Basis points for percent, minor units for fixed. The fallback when no branch matches."
    },
    "approval_mode": {
      "type": "string",
      "enum": [
        "immediate",
        "after_days",
        "manual"
      ]
    },
    "approval_delay_days": {
      "type": [
        "integer",
        "null"
      ]
    },
    "priority": {
      "type": "integer",
      "description": "Lower runs first"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "inactive"
      ]
    },
    "switch_to_group_id": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^(sample_)?grp_",
      "description": "Prefixed id (`grp_…`)"
    },
    "metadata": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {},
      "description": "Your own key/value data, stored as given"
    },
    "branches": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/RuleBranch"
      }
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "ISO-8601, UTC"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "ISO-8601, UTC"
    }
  },
  "required": [
    "id",
    "object",
    "program_id",
    "group_id",
    "partner_id",
    "name",
    "description",
    "trigger",
    "action",
    "rate_type",
    "rate_value",
    "approval_mode",
    "approval_delay_days",
    "priority",
    "status",
    "switch_to_group_id",
    "metadata",
    "branches",
    "created_at",
    "updated_at"
  ],
  "$defs": {
    "Condition": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "field": {
              "type": "string"
            },
            "op": {
              "type": "string",
              "enum": [
                "eq",
                "neq",
                "gt",
                "gte",
                "lt",
                "lte",
                "between",
                "in",
                "not_in",
                "contains",
                "starts_with",
                "is_true",
                "is_false"
              ]
            },
            "value": {}
          },
          "required": [
            "field",
            "op"
          ]
        },
        {
          "type": "object",
          "properties": {
            "all": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/Condition"
              }
            }
          },
          "required": [
            "all"
          ]
        },
        {
          "type": "object",
          "properties": {
            "any": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/Condition"
              }
            }
          },
          "required": [
            "any"
          ]
        },
        {
          "type": "object",
          "properties": {
            "not": {
              "$ref": "#/$defs/Condition"
            }
          },
          "required": [
            "not"
          ]
        }
      ],
      "description": "A comparison `{ field, op, value }` or a group `{ all: [...] }`, `{ any: [...] }`, `{ not: ... }`. Numeric ranges are inclusive."
    },
    "RuleBranch": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^(sample_)?flb_",
          "description": "Prefixed id (`flb_…`)"
        },
        "object": {
          "type": "string",
          "enum": [
            "rule_branch"
          ]
        },
        "rule_id": {
          "type": "string",
          "pattern": "^(sample_)?flw_",
          "description": "Prefixed id (`flw_…`)"
        },
        "position": {
          "type": "integer"
        },
        "label": {
          "type": [
            "string",
            "null"
          ]
        },
        "conditions": {
          "$ref": "#/$defs/Condition"
        },
        "rate_type": {
          "type": "string",
          "enum": [
            "percent",
            "fixed"
          ]
        },
        "rate_value": {
          "type": "integer"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "ISO-8601, UTC"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "description": "ISO-8601, UTC"
        }
      },
      "required": [
        "id",
        "object",
        "rule_id",
        "position",
        "label",
        "conditions",
        "rate_type",
        "rate_value",
        "created_at",
        "updated_at"
      ]
    }
  }
}

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/affiliaterail-com-rule"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.