{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/currencycloud/main/json-schema/currencycloud-conversion-split-history-schema.json",
  "title": "ConversionSplitHistory",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/currencycloud-conversions-api-openapi.yml#/components/schemas/ConversionSplitHistory",
  "type": "object",
  "properties": {
    "origin_conversion": {
      "$ref": "#/$defs/ConversionSplitDetails",
      "description": "The original conversion (before split)."
    },
    "parent_conversion": {
      "$ref": "#/$defs/ConversionSplitDetails",
      "description": "The parent conversion (after split)."
    },
    "child_conversions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ConversionSplitDetails"
      },
      "description": "The child conversion (after split)."
    }
  },
  "$defs": {
    "ConversionSplitDetails": {
      "properties": {
        "id": {
          "type": "string",
          "description": "Conversion ID"
        },
        "short_reference": {
          "type": "string",
          "description": "A human readable unique trade indentifier, in the format YYYYMMDD-XXXXXX."
        },
        "sell_currency": {
          "type": "string",
          "description": "Three character ISO code for currency sold."
        },
        "buy_currency": {
          "type": "string",
          "description": "Three character ISO code for currency bought."
        },
        "buy_amount": {
          "type": "string",
          "description": "The amount of the buy_currency being bought."
        },
        "sell_amount": {
          "type": "string",
          "description": "The amount of the sell_currency being sold."
        },
        "settlement_date": {
          "type": "string",
          "format": "date-time",
          "description": "The date and time by which funds need to be available to settle the trade."
        },
        "conversion_date": {
          "type": "string",
          "format": "date-time",
          "description": "The date the conversion will be made."
        },
        "status": {
          "type": "string",
          "description": "Status of the related trade.",
          "enum": [
            "awaiting_authorisation",
            "awaiting_funds",
            "closed",
            "funds_arrived",
            "funds_being_processed",
            "funds_sent",
            "trade_settled",
            "trade_settling"
          ]
        }
      }
    }
  }
}