AffiliateBase Payout Runs API
Session auth requires the `owner` or `admin` role.
Session auth requires the `owner` or `admin` role.
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/affiliatebase-io:affiliatebase-io-payout-runs-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: AffiliateBase API v1 Payout Runs API
version: 1.0.0
description: 'Source-aligned OpenAPI contract for AffiliateBase `/api/v1` endpoints.
Authentication: one of Bearer token, Basic API key auth, or `X-Api-Key`.
Account context: required via `account_id` query param or `X-Account-Id` header.
Write endpoints accept JSON request bodies and Rails-style form-encoded parameters;
responses are JSON encoded. List endpoints use consistent `data` and
`pagination` envelopes.
Rate limits: 45 requests per 30 seconds per credential and 180 per 30 seconds per
IP address, applied before authentication. A throttled request returns HTTP `429`
with error code `TOO_MANY_REQUESTS` and `RateLimit-Limit`, `RateLimit-Remaining`,
`RateLimit-Reset`, and `Retry-After` headers (sent on `429` responses only).
Error codes: `MISSING_ACCOUNT_ID` (400), `INVALID_PARAMETER` (400), `UNAUTHORIZED` (401),
`FORBIDDEN` (403), `NOT_FOUND` (404), `VALIDATION_ERROR` (422), `TOO_MANY_REQUESTS` (429).
Payout endpoints also return operation-specific `422` codes: `PAYOUT_EXECUTION_FAILED`,
`PAYOUT_RUN_CREATE_FAILED`, `PAYOUT_RUN_EXECUTION_FAILED`, `PAYOUT_RUN_REMEDIATION_FAILED`,
`PAYOUT_EXPORT_CREATE_FAILED`, `PAYOUT_EXPORT_DOWNLOAD_FAILED`, `PAYOUT_EXPORT_DELETE_FAILED`,
and `PAYOUT_EXPORT_SETTLEMENT_FAILED`.'
servers:
- url: https://app.affiliatebase.io
security:
- bearerAuth: []
- basicAuth: []
- apiKeyAuth: []
tags:
- name: Payout Runs
description: Session auth requires the `owner` or `admin` role.
paths:
/api/v1/payout_runs:
post:
tags:
- Payout Runs
operationId: createPayoutRun
summary: Create payout run
parameters:
- $ref: '#/components/parameters/AccountIdQuery'
- $ref: '#/components/parameters/AccountIdHeader'
requestBody:
required: false
content:
application/json:
schema:
type: object
properties:
idempotency_key:
type: string
execute_now:
type: boolean
affiliate_ids:
type: array
items:
type: string
format: uuid
payment_reference:
type: string
responses:
'200':
description: Payout run payload
content:
application/json:
schema:
$ref: '#/components/schemas/PayoutRun'
'400':
$ref: '#/components/responses/MissingAccountId'
'401':
$ref: '#/components/responses/Unauthorized'
'429':
$ref: '#/components/responses/TooManyRequests'
'403':
$ref: '#/components/responses/Forbidden'
'422':
$ref: '#/components/responses/ValidationError'
/api/v1/payout_runs/{id}/execute:
put:
tags:
- Payout Runs
operationId: executePayoutRun
summary: Execute payout run
parameters:
- $ref: '#/components/parameters/AccountIdQuery'
- $ref: '#/components/parameters/AccountIdHeader'
- $ref: '#/components/parameters/Id'
- $ref: '#/components/parameters/IdempotencyKeyHeader'
requestBody:
required: false
content:
application/json:
schema:
type: object
properties:
async:
type: boolean
default: true
payment_reference:
type: string
dry_run:
type: boolean
default: false
idempotency_key:
type: string
responses:
'200':
description: 'Execution result, a preview when `dry_run` is true, or `replayed: true` for a repeated idempotency key'
content:
application/json:
schema:
$ref: '#/components/schemas/JsonObject'
'400':
$ref: '#/components/responses/MissingAccountId'
'401':
$ref: '#/components/responses/Unauthorized'
'429':
$ref: '#/components/responses/TooManyRequests'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'422':
$ref: '#/components/responses/ValidationError'
/api/v1/payout_runs/{id}/remediate:
put:
tags:
- Payout Runs
operationId: remediatePayoutRun
summary: Apply payout run remediation action
parameters:
- $ref: '#/components/parameters/AccountIdQuery'
- $ref: '#/components/parameters/AccountIdHeader'
- $ref: '#/components/parameters/Id'
- $ref: '#/components/parameters/IdempotencyKeyHeader'
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- remediation_action
properties:
remediation_action:
type: string
issue_code:
type: string
payout_ids:
type: array
items:
type: string
format: uuid
dry_run:
type: boolean
default: false
idempotency_key:
type: string
responses:
'200':
description: 'Remediation result, a preview when `dry_run` is true, or `replayed: true` for a repeated idempotency key'
content:
application/json:
schema:
$ref: '#/components/schemas/JsonObject'
'400':
$ref: '#/components/responses/MissingAccountId'
'401':
$ref: '#/components/responses/Unauthorized'
'429':
$ref: '#/components/responses/TooManyRequests'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'422':
$ref: '#/components/responses/ValidationError'
/api/v1/payout_runs/reconcile:
get:
tags:
- Payout Runs
operationId: reconcilePayoutRuns
summary: Reconcile recent payout runs
parameters:
- $ref: '#/components/parameters/AccountIdQuery'
- $ref: '#/components/parameters/AccountIdHeader'
- name: lookback_days
in: query
schema:
type: integer
responses:
'200':
description: Reconciliation report
content:
application/json:
schema:
$ref: '#/components/schemas/JsonObject'
'400':
$ref: '#/components/responses/MissingAccountId'
'401':
$ref: '#/components/responses/Unauthorized'
'429':
$ref: '#/components/responses/TooManyRequests'
'403':
$ref: '#/components/responses/Forbidden'
components:
schemas:
Error:
type: object
required:
- error
- code
properties:
error:
type: string
code:
type: string
details:
oneOf:
- type: 'null'
- type: object
additionalProperties: true
- type: array
items:
type: string
PayoutRun:
type: object
properties:
id:
type: string
format: uuid
account_id:
type: string
format: uuid
idempotency_key:
type: string
status:
type: string
selection_hash:
type: string
result_payload:
type: object
additionalProperties: true
completed_at:
oneOf:
- type: 'null'
- type: string
format: date-time
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
JsonObject:
type: object
additionalProperties: true
parameters:
Id:
name: id
in: path
required: true
schema:
type: string
format: uuid
AccountIdHeader:
name: X-Account-Id
in: header
required: false
schema:
type: string
format: uuid
description: Account context header. Required unless `account_id` query param is supplied.
AccountIdQuery:
name: account_id
in: query
required: false
schema:
type: string
format: uuid
description: Account context. Required unless `X-Account-Id` is supplied.
IdempotencyKeyHeader:
name: Idempotency-Key
in: header
required: false
description: Stable key for this operation. A retry with the same key returns the original result without writing again. `X-Idempotency-Key` is also accepted.
schema:
type: string
responses:
Forbidden:
description: Authenticated but not authorized
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error: Forbidden
code: FORBIDDEN
NotFound:
description: Resource not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error: Not found
code: NOT_FOUND
ValidationError:
description: Validation or state-transition error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error: Validation failed
code: VALIDATION_ERROR
MissingAccountId:
description: Missing account context
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error: Account ID is required
code: MISSING_ACCOUNT_ID
TooManyRequests:
description: API rate limit exceeded
headers:
RateLimit-Limit:
schema:
type: integer
description: Maximum requests allowed in the current window.
RateLimit-Remaining:
schema:
type: integer
description: Requests remaining in the current window.
RateLimit-Reset:
schema:
type: integer
description: Seconds until the current rate limit window resets.
Retry-After:
schema:
type: integer
description: Seconds to wait before retrying.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error: Too many API requests. Please retry shortly.
code: TOO_MANY_REQUESTS
Unauthorized:
description: Authentication failed
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error: Invalid API Secret.
code: UNAUTHORIZED
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: API Key
basicAuth:
type: http
scheme: basic
apiKeyAuth:
type: apiKey
in: header
name: X-Api-Key