{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/grainfinance-co/json-schema/grainfinance-co-initiate-payout-request-schema.json",
  "title": "InitiatePayoutRequest",
  "description": "Request body for `POST /v1/payouts` (review). Creates a pending, time-limited payout proposal\nthat must be submitted via `POST /v1/payouts/{id}/submit` before it expires.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/grainfinance-co-payouts-api-openapi.yml#/components/schemas/InitiatePayoutRequest",
  "properties": {
    "externalVendorId": {
      "$ref": "#/$defs/ExternalVendorId",
      "description": "Your own reference id for the vendor receiving the payout."
    },
    "externalPayoutId": {
      "$ref": "#/$defs/ExternalPayoutId",
      "description": "Your own reference number for this payout."
    },
    "currency": {
      "$ref": "#/$defs/CurrencyCode",
      "description": "The alpha-3 ISO 4217 currency code of the payout."
    },
    "amount": {
      "type": "number",
      "format": "double",
      "description": "The payout amount, denoted in `currency`."
    },
    "reason": {
      "$ref": "#/$defs/ComplianceReasonCode",
      "description": "The compliance reason categorising this payout, as a numeric code:\n\n1 - Intercompany Payment\n2 - Purchase of Good(s)\n3 - Purchase of Service(s)\n4 - Transferring to Own Accounts\n5 - Valid Vendor Purchases"
    },
    "description": {
      "type": "string",
      "description": "Optional free-form description for the payout."
    }
  },
  "required": [
    "externalVendorId",
    "externalPayoutId",
    "currency",
    "amount",
    "reason"
  ],
  "type": "object",
  "additionalProperties": false,
  "$defs": {
    "ComplianceReasonCode": {
      "description": "The compliance reason categorising a payout, as a numeric code:\n\n1 - Intercompany Payment\n2 - Purchase of Good(s)\n3 - Purchase of Service(s)\n4 - Transferring to Own Accounts\n5 - Valid Vendor Purchases",
      "enum": [
        1,
        2,
        3,
        4,
        5
      ],
      "type": "number"
    },
    "CurrencyCode": {
      "type": "string",
      "description": "The alpha-3 ISO 4217 currency code of the related entity, in upper case.",
      "pattern": "^[A-Z]{3}$"
    },
    "ExternalPayoutId": {
      "type": "string",
      "description": "Partner's own reference number for this payout.",
      "pattern": "^[A-Za-z0-9_.\\-]{1,64}$"
    },
    "ExternalVendorId": {
      "type": "string",
      "description": "Partner's own reference ID for the vendor.",
      "pattern": "^[A-Za-z0-9_.\\-]{1,64}$"
    }
  }
}