{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/akahu/main/json-schema/akahu-create-referral-redemption-params-schema.json",
  "title": "CreateReferralRedemptionParams",
  "x-generated": "2026-10-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/akahu-referrals-api-openapi.yml#/components/schemas/CreateReferralRedemptionParams",
  "type": "object",
  "properties": {
    "code": {
      "$ref": "#/$defs/ReferralCode"
    },
    "reference": {
      "type": "string",
      "minLength": 1,
      "maxLength": 500,
      "description": "Optional reference to use for the application created in the redeeming organisation. Defaults to the referral reference."
    },
    "report_type": {
      "type": "string",
      "enum": [
        "standard",
        "income"
      ],
      "description": "If `report_type` is omitted, the application uses your organisation's default report type."
    }
  },
  "required": [
    "code"
  ],
  "$defs": {
    "ReferralCode": {
      "type": "string",
      "pattern": "^AK_[A-Z0-9]{10}$",
      "description": "A referral code using the format `AK_` followed by 10 uppercase alphanumeric characters."
    }
  }
}