{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bitnob/json-schema/bitnob-virtual-accounts-create-request-schema.json",
  "title": "VirtualAccountsCreateRequest",
  "x-generated": "2026-11-16",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bitnob-openapi.json#/components/schemas/VirtualAccountsCreateRequest",
  "else": {
    "required": [
      "customer_id"
    ]
  },
  "if": {
    "additionalProperties": true,
    "properties": {
      "rail": {
        "const": "mobile_money"
      }
    },
    "required": [
      "rail"
    ]
  },
  "properties": {
    "account_alias": {
      "description": "Shown instead of the customer name on the account. On a collection it defaults to account_name.",
      "maxLength": 100,
      "type": "string"
    },
    "account_name": {
      "description": "The payer's name. Collections only.",
      "maxLength": 100,
      "type": "string"
    },
    "account_number": {
      "description": "The payer's phone number. Required on the mobile_money rail. Local or international form; it is stored as digits with the country code, which must match phone_pattern from GET /api/virtual-accounts/supported-currencies.",
      "maxLength": 20,
      "type": "string"
    },
    "amount": {
      "description": "Amount to collect, in base units (cents; 100 is 1 KES or 1 UGX). Required on the mobile_money rail. KES 2000 to 14500000; UGX 50000 to 400000000. GET /api/virtual-accounts/supported-currencies gives the limits.",
      "format": "int64",
      "minimum": 1,
      "type": "integer"
    },
    "bank": {
      "description": "Bank to open the account at, case-insensitive. Omit to use the default bank. Bank rail only; ignored on the mobile_money rail.",
      "enum": [
        "nomba",
        "globus"
      ],
      "type": "string"
    },
    "country": {
      "description": "ISO 3166-1 alpha-2 country, case-insensitive. Collections only, where it must be KE for KES and UG for UGX; omit to use the currency's country.",
      "maxLength": 2,
      "minLength": 2,
      "type": "string"
    },
    "currency": {
      "description": "NGN on the bank rail; KES or UGX on the mobile_money rail. Case-insensitive.",
      "pattern": "^([Nn][Gg][Nn]|[Kk][Ee][Ss]|[Uu][Gg][Xx])$",
      "type": "string"
    },
    "customer_id": {
      "description": "An existing customer; register them first with POST /api/customers. Required on the bank rail. Optional on the mobile_money rail, where it links the payer's customer record.",
      "format": "uuid",
      "type": "string"
    },
    "description": {
      "description": "A note for the collection, returned in metadata.description. Collections only.",
      "maxLength": 255,
      "type": "string"
    },
    "lifetime": {
      "description": "Case-insensitive. permanent on the bank rail, temporary on the mobile_money rail. Omit to get the rail's only lifetime; any other pairing is 400.",
      "enum": [
        "permanent",
        "temporary"
      ],
      "type": "string"
    },
    "network": {
      "description": "Mobile money network. Required on the mobile_money rail. MPESA for KES; MTN or AIRTEL for UGX. Any case, and the network's display name is accepted (M-Pesa).",
      "maxLength": 32,
      "type": "string"
    },
    "rail": {
      "default": "bank",
      "description": "How the account receives money, case-insensitive. mobile_money opens a collection, which prompts the payer's phone for amount.",
      "enum": [
        "bank",
        "mobile_money"
      ],
      "type": "string"
    },
    "reference": {
      "description": "Your unique reference for the account.",
      "maxLength": 100,
      "type": "string"
    }
  },
  "required": [
    "reference",
    "currency"
  ],
  "then": {
    "required": [
      "amount",
      "network",
      "account_number"
    ]
  },
  "type": "object"
}