{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/lightspark/main/json-schema/lightspark-transfer-out-request-schema.json",
  "title": "TransferOutRequest",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/lightspark-same-currency-transfers-api-openapi.yml#/components/schemas/TransferOutRequest",
  "type": "object",
  "required": [
    "source",
    "destination"
  ],
  "properties": {
    "source": {
      "$ref": "#/$defs/InternalAccountReference",
      "description": "Source internal account details"
    },
    "destination": {
      "$ref": "#/$defs/ExternalAccountDestinationReference",
      "description": "Destination external account details"
    },
    "amount": {
      "type": "integer",
      "format": "int64",
      "description": "Amount in the smallest unit of the currency (e.g., cents for USD/EUR, satoshis for BTC)"
    },
    "remittanceInformation": {
      "type": "string",
      "maxLength": 80,
      "description": "Free-form information about the payment that travels with it to the recipient. The field this populates depends on the payment rail: for ACH it populates the Addenda record, for FedNow and RTP it populates the remittanceInformation field, and for wires it populates the OBI (Originator to Beneficiary Information) / beneficiary information."
    }
  },
  "$defs": {
    "ExternalAccountDestinationReference": {
      "type": "object",
      "required": [
        "accountId"
      ],
      "properties": {
        "accountId": {
          "type": "string",
          "description": "Reference to an external account ID"
        },
        "paymentRail": {
          "description": "The payment rail to use for the transfer. Must be one of the rails supported by the destination account. If not specified, the system will select a default rail.",
          "allOf": [
            {
              "$ref": "#/$defs/PaymentRail"
            }
          ]
        }
      }
    },
    "InternalAccountReference": {
      "type": "object",
      "required": [
        "accountId"
      ],
      "properties": {
        "accountId": {
          "type": "string",
          "description": "Reference to an internal account ID"
        }
      }
    },
    "PaymentRail": {
      "type": "string",
      "enum": [
        "ACH",
        "ACH_COLOMBIA",
        "BANK_TRANSFER",
        "BRE_B",
        "CIPS",
        "FAST",
        "FASTER_PAYMENTS",
        "FEDNOW",
        "INSTAPAY",
        "MOBILE_MONEY",
        "NEFT",
        "PAYNOW",
        "PESONET",
        "PIX",
        "RTGS",
        "RTP",
        "SEPA",
        "SEPA_INSTANT",
        "SPEI",
        "SWIFT",
        "UNIONPAY",
        "UPI",
        "WIRE"
      ],
      "description": "The payment rail used for the transfer. Payment rails represent the underlying payment network or system used to move funds between accounts."
    }
  }
}