Payout batches

Generate a payout batch

Turns every due commission up to period_end into payouts, one per partner per currency, netting clawbacks and applying the threshold, payout-method and tax-form checks. Idempotent per partner per month: a second run for the same month skips partners already paid and re-evaluates the not-eligible ones. Money does not move; this creates the payable set.

Scope: payouts:write (or write)

post/v1/payout_batches

Request

  • Base URL: https://api.affiliaterail.com
  • URL: https://api.affiliaterail.com/v1/payout_batches
  • Auth: HTTP bearer

Request body

program_idstring required

Prefixed id (prg_…)

period_endstring date-time required

Last instant of the earning period

period_startstring date-time

ISO-8601, UTC

partner_idsstring[]
group_idstring

Prefixed id (grp_…)

ignore_thresholdboolean

Example request

{
  "program_id": "prg_7uSyy9FqVLCFWrdPeZaK",
  "period_end": "2026-08-21T10:15:30.000Z",
  "period_start": "2026-08-21T10:15:30.000Z",
  "partner_ids": [
    "part_7uSyy9FqVLCFWrdPeZaK"
  ],
  "group_id": "grp_7uSyy9FqVLCFWrdPeZaK"
}

Response

What the run produced

object'payout_batch_run' required
upgradedstring[] required
refreshedstring[] required

Example response

{
  "batches": [
    {
      "id": "batch_7uSyy9FqVLCFWrdPeZaK",
      "program_id": "prg_7uSyy9FqVLCFWrdPeZaK",
      "period_start": "2026-08-21T10:15:30.000Z",
      "period_end": "2026-08-21T10:15:30.000Z",
      "currency": "USD",
      "total_minor": 2500,
      "executed_at": "2026-08-21T10:15:30.000Z",
      "created_at": "2026-08-21T10:15:30.000Z",
      "updated_at": "2026-08-21T10:15:30.000Z"
    }
  ],
  "created": [
    {
      "payout_id": "pyt_7uSyy9FqVLCFWrdPeZaK",
      "partner_id": "part_7uSyy9FqVLCFWrdPeZaK",
      "currency": "USD",
      "amount_minor": 2500
    }
  ],
  "upgraded": [
    "pyt_7uSyy9FqVLCFWrdPeZaK"
  ],
  "refreshed": [
    "pyt_7uSyy9FqVLCFWrdPeZaK"
  ],
  "skipped": [
    {
      "partner_id": "part_7uSyy9FqVLCFWrdPeZaK",
      "currency": "USD"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.