API ReferenceapiaffiliatesPOST /v1/admin/payouts/run-monthly

POST /v1/admin/payouts/run-monthly

Service: affiliates · operationId: (none)

Monthly commission → payout aggregation. Idempotent: re-running for the same period skips already-created payouts. Defaults to the previous calendar month.

Required scopes

(no scope declared — review service config)

Request body

{
  "type": "object",
  "properties": {
    "period_start": {
      "type": "string",
      "format": "date-time"
    },
    "period_end": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Responses

200 Monthly batch completed

{
  "type": "object",
  "properties": {
    "period_start": {
      "type": "string"
    },
    "period_end": {
      "type": "string"
    },
    "created": {
      "type": "integer"
    },
    "skipped": {
      "type": "integer"
    },
    "already_exists": {
      "type": "integer"
    },
    "total_net_cents": {
      "type": "string"
    },
    "errors": {
      "type": "integer"
    }
  },
  "required": [
    "period_start",
    "period_end",
    "created",
    "skipped",
    "already_exists",
    "total_net_cents",
    "errors"
  ]
}

500 Internal error

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

Example

curl -X POST https://affiliates.platform.loop.health/v1/admin/payouts/run-monthly \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'