AffiliateRail Balances API
The Balances API from AffiliateRail — 2 operation(s) for balances.
The Balances API from AffiliateRail — 2 operation(s) for balances.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.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.curl "https://apis.io/api/v1/apis/affiliaterail-com:affiliaterail-com-balances-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a 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.
openapi: 3.2.0
info:
title: Affiliaterail Com Balances API
version: '2026-08-21'
description: 'Operations tagged Balances across 2 of this provider''s published API definitions: affiliaterail-com-docs-openapi.json, affiliaterail-com-openapi.json. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.affiliaterail.com
description: Production
tags:
- name: Balances
paths:
/v1/balances:
get:
tags:
- Balances
summary: List balances
description: 'One row per partner per currency: `pending_minor` (earned, inside the hold), `due_minor` (payable now), `paid_minor` (sent). Ordered by partner then currency; the cursor is a balance id.
**Scope:** `read`'
security:
- bearerAuth: []
parameters:
- schema:
type: string
example: prg_7uSyy9FqVLCFWrdPeZaK
description: Required on every list
required: true
description: Required on every list
name: program_id
in: query
- schema:
type: string
example: '25'
description: 1 to 100, default 25
required: false
description: 1 to 100, default 25
name: limit
in: query
- schema:
type: string
description: Object id; returns the page after it (older)
required: false
description: Object id; returns the page after it (older)
name: starting_after
in: query
- schema:
type: string
description: Object id; returns the page before it (newer)
required: false
description: Object id; returns the page before it (newer)
name: ending_before
in: query
- schema:
anyOf:
- type: string
- type: array
items:
type: string
description: 'Relations to embed: partner'
required: false
description: 'Relations to embed: partner'
name: expand[]
in: query
- schema:
anyOf:
- type: string
- type: array
items:
type: string
description: Nothing to include on this resource
required: false
description: Nothing to include on this resource
name: include[]
in: query
- schema:
type: string
required: false
name: partner_id
in: query
- schema:
type: string
required: false
name: currency
in: query
responses:
'200':
description: Balances
content:
application/json:
schema:
$ref: '#/components/schemas/BalanceList'
'400':
description: Invalid request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Missing or unknown API key
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Key lacks the required scope
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: No such object in your organization
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'422':
description: The request was understood and refused
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'429':
description: 'Rate limited: see Retry-After'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
operationId: getV1Balances
x-operation-id-source: derived
servers:
- url: https://api.affiliaterail.com
description: Production
/v1/balances/{id}:
get:
tags:
- Balances
summary: Retrieve a balance
description: '**Scope:** `read`'
security:
- bearerAuth: []
parameters:
- schema:
type: string
example: bal_part_7uSyy9FqVLCFWrdPeZaK_USD
required: true
name: id
in: path
- schema:
anyOf:
- type: string
- type: array
items:
type: string
description: 'Relations to embed: partner'
required: false
description: 'Relations to embed: partner'
name: expand[]
in: query
- schema:
anyOf:
- type: string
- type: array
items:
type: string
description: Nothing to include on this resource
required: false
description: Nothing to include on this resource
name: include[]
in: query
responses:
'200':
description: The balance
content:
application/json:
schema:
$ref: '#/components/schemas/Balance'
'400':
description: Invalid request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Missing or unknown API key
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Key lacks the required scope
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: No such object in your organization
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'422':
description: The request was understood and refused
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'429':
description: 'Rate limited: see Retry-After'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
operationId: getV1BalancesById
x-operation-id-source: derived
servers:
- url: https://api.affiliaterail.com
description: Production
components:
schemas:
Error:
type: object
properties:
error:
type: object
properties:
type:
type: string
enum:
- authentication_error
- permission_error
- invalid_request_error
- not_found_error
- conflict_error
- rate_limit_error
- plan_error
- not_implemented_error
- api_error
code:
type: string
message:
type: string
param:
type: string
required:
- type
- code
- message
required:
- error
Balance:
type: object
properties:
id:
type: string
example: bal_part_7uSyy9FqVLCFWrdPeZaK_USD
description: '`bal_<partner_id>_<currency>`'
object:
type: string
enum:
- balance
partner_id:
type: string
pattern: ^(sample_)?part_
example: part_7uSyy9FqVLCFWrdPeZaK
description: Prefixed id (`part_…`)
currency:
type: string
minLength: 3
maxLength: 3
example: USD
description: ISO-4217
pending_minor:
type: integer
example: 2500
description: Integer minor units (cents, pence). Never a float, never a string.
due_minor:
type: integer
example: 2500
description: Integer minor units (cents, pence). Never a float, never a string.
paid_minor:
type: integer
example: 2500
description: Integer minor units (cents, pence). Never a float, never a string.
updated_at:
type: string
format: date-time
example: '2026-08-21T10:15:30.000Z'
description: ISO-8601, UTC
required:
- id
- object
- partner_id
- currency
- pending_minor
- due_minor
- paid_minor
- updated_at
BalanceList:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Balance'
has_more:
type: boolean
description: Pass the last object's id as `starting_after` to fetch the next page
total_count:
type: integer
description: Count of every object matching the filters, ignoring the cursor
required:
- data
- has_more
- total_count
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: rail_live_… or rail_test_…
description: Create keys in Settings → API keys. Each key carries scopes; the docs name the scope every route needs.
x-refined-from:
- affiliaterail-com-docs-openapi.json
- affiliaterail-com-openapi.json