To try sample data, create a free workspace and choose the SaaS Affiliate sample during setup.
On This Page
Details
What to know
Rule object
A rule controls which revenue records match and how allocation percentages or tiers are applied.
Use external_id to connect Allocora rules to your source system.
Use priority to control which matching rules win when several could apply.
Use allocation_type flat for percentage splits and tiered for tier-based logic.
Use the versions endpoint when you need to review saved rule history.
Tiered allocation contract
A tiered allocation contains one payee, contiguous tier bands, and an optional tier_policy. Omitting tier_policy preserves the original per-revenue-record marginal calculation. Grouped policies are an additive opt-in capability.
attainment_window accepts revenue_record, calculation_run, quarter, or year.
application_method accepts marginal; current_period_rate for calculation-run/quarter/year windows; or retroactive_true_up for quarter/year windows.
current_period_rate and retroactive_true_up require threshold_trigger: at_threshold or above_threshold.
Quarter/year policies require cycle_start_month, an IANA timezone, and refund_treatment.
Omit tier_program_id for a new grouped allocation. The server creates it and returns/preserves that stable rule/payee identity across compatible updates.
Retail price allocations
Every flat allocation in a rule response states its royalty_basis. receipts pays the percentage on the actual revenue amount; rrp pays it on units × retail price before tax, and rrp_source says where the price comes from.
Set up retail price allocations in Allocora under Rules. Through the API you can rename a retail price rule, change its other fields, and change its status; its allocations keep their retail price basis.
A create, update, upsert, or batch request that sends royalty_basis rrp or an rrp_source returns 422 with a link to the rule in Allocora.
An update or upsert that sends allocations or allocation_type for a retail price rule returns 422 and leaves the rule unchanged.
Sending royalty_basis receipts, or leaving it out, creates a receipts allocation as before.
Grouped-tier safety constraints
Grouped tier commissions are available across account and API workflows, while monthly quarter/year runs remain protected by locked predecessor state.
An open effective attainment window prevents policy or rate changes that would make locked history ambiguous.
reverse_original_commission_only is accepted for grouped refunds and reverses the canonical locked original commission without changing attainment.
restate_original_attainment_window is accepted for quarter/year policies. Authorized account users reconcile a linked negative refund through chronological, delta-only replacement runs that must be reviewed and locked in order.
Endpoint Examples
Requests and responses
Each example shows the request shape and a shortened successful response. Replace placeholder IDs with values from your workspace.
These fields appear in rule create, update, and response examples.
Field
Type
Notes
id
string
Allocora rule ID returned by the API.
external_id
string or null
Your stable rule identifier.
name
string
Display name for the rule.
status
string
active or inactive.
priority
integer
Higher-priority matching control.
store
string or null
Limits the rule to revenue from one store, matched without regard to capital letters or surrounding spaces. Null applies the rule to every store; revenue without a store matches no store rule.
allocation_type
string
flat or tiered.
allocations
array
Payee allocation definitions.
allocations[].tiers
array
Tiered rules: contiguous min/max/percentage bands starting at zero; only the final max can be null.
allocations[].tier_policy
object or omitted
Tiered rules: attainment window and application semantics. Omitted means revenue_record + marginal.
tier_policy.threshold_trigger
string when required
at_threshold uses the higher tier at equality; above_threshold waits until attainment is greater than the tier minimum.
tier_policy.cycle_start_month / timezone
integer / IANA string
Required for quarter/year window boundaries.
tier_policy.refund_treatment
string
Required for quarter/year. Use reverse_original_commission_only to preserve attainment or restate_original_attainment_window for controlled chronological reconciliation.
allocations[].tier_program_id
server-owned string
Stable grouped rule/payee identity. Omit it when creating a new grouped allocation.
allocations[].royalty_basis
string in responses
Flat allocations: receipts or rrp (units × retail price before tax). Writes accept only receipts.
allocations[].rrp_source
string or null in responses
Retail price allocations: file (price from the revenue row) or product_history (dated product price). null for receipts.
valid_from / valid_to
date or null
Optional effective window.
Related
Continue through the docs
Move from concepts to setup, then to statement output and audit review.