object ScheduledSubTransaction
{
  "type": "object",
  "required": [
    "amount",
    "deleted",
    "id",
    "scheduled_transaction_id"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "memo": {
      "type": "string",
      "nullable": true
    },
    "amount": {
      "type": "integer",
      "format": "int64",
      "description": "The scheduled subtransaction amount in milliunits format"
    },
    "deleted": {
      "type": "boolean",
      "description": "Whether or not the scheduled subtransaction has been deleted. Deleted scheduled subtransactions will only be included in delta requests."
    },
    "payee_id": {
      "type": "string",
      "format": "uuid",
      "nullable": true
    },
    "category_id": {
      "type": "string",
      "format": "uuid",
      "nullable": true
    },
    "transfer_account_id": {
      "type": "string",
      "format": "uuid",
      "nullable": true,
      "description": "If a transfer, the account_id which the scheduled subtransaction transfers to"
    },
    "scheduled_transaction_id": {
      "type": "string",
      "format": "uuid"
    }
  }
}
object ScheduledTransactionDetail
{
  "allOf": [
    {
      "$ref": "#/components/schemas/ScheduledTransactionSummary"
    },
    {
      "type": "object",
      "required": [
        "account_name",
        "subtransactions"
      ],
      "properties": {
        "payee_name": {
          "type": "string",
          "nullable": true
        },
        "account_name": {
          "type": "string"
        },
        "category_name": {
          "type": "string",
          "nullable": true,
          "description": "The name of the category.  If a split scheduled transaction, this will be 'Split'."
        },
        "subtransactions": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/ScheduledSubTransaction"
          },
          "description": "If a split scheduled transaction, the subtransactions."
        }
      }
    }
  ]
}
object ScheduledTransactionResponse
{
  "type": "object",
  "required": [
    "data"
  ],
  "properties": {
    "data": {
      "type": "object",
      "required": [
        "scheduled_transaction"
      ],
      "properties": {
        "scheduled_transaction": {
          "$ref": "#/components/schemas/ScheduledTransactionDetail"
        }
      }
    }
  }
}
object ScheduledTransactionSummary
{
  "type": "object",
  "required": [
    "account_id",
    "amount",
    "date_first",
    "date_next",
    "deleted",
    "frequency",
    "id"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "memo": {
      "type": "string",
      "nullable": true
    },
    "amount": {
      "type": "integer",
      "format": "int64",
      "description": "The scheduled transaction amount in milliunits format"
    },
    "deleted": {
      "type": "boolean",
      "description": "Whether or not the scheduled transaction has been deleted.  Deleted scheduled transactions will only be included in delta requests."
    },
    "payee_id": {
      "type": "string",
      "format": "uuid",
      "nullable": true
    },
    "date_next": {
      "type": "string",
      "format": "date",
      "description": "The next date for which the Scheduled Transaction is scheduled."
    },
    "flag_name": {
      "$ref": "#/components/schemas/TransactionFlagName"
    },
    "frequency": {
      "enum": [
        "never",
        "daily",
        "weekly",
        "everyOtherWeek",
        "twiceAMonth",
        "every4Weeks",
        "monthly",
        "everyOtherMonth",
        "every3Months",
        "every4Months",
        "twiceAYear",
        "yearly",
        "everyOtherYear"
      ],
      "type": "string"
    },
    "account_id": {
      "type": "string",
      "format": "uuid"
    },
    "date_first": {
      "type": "string",
      "format": "date",
      "description": "The first date for which the Scheduled Transaction was scheduled."
    },
    "flag_color": {
      "$ref": "#/components/schemas/TransactionFlagColor"
    },
    "category_id": {
      "type": "string",
      "format": "uuid",
      "nullable": true
    },
    "transfer_account_id": {
      "type": "string",
      "format": "uuid",
      "nullable": true,
      "description": "If a transfer, the account_id which the scheduled transaction transfers to"
    }
  }
}
object ScheduledTransactionsResponse
{
  "type": "object",
  "required": [
    "data"
  ],
  "properties": {
    "data": {
      "type": "object",
      "required": [
        "scheduled_transactions",
        "server_knowledge"
      ],
      "properties": {
        "server_knowledge": {
          "type": "integer",
          "format": "int64",
          "description": "The knowledge of the server"
        },
        "scheduled_transactions": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/ScheduledTransactionDetail"
          }
        }
      }
    }
  }
}
object SubTransaction
{
  "type": "object",
  "required": [
    "amount",
    "deleted",
    "id",
    "transaction_id"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "memo": {
      "type": "string",
      "nullable": true
    },
    "amount": {
      "type": "integer",
      "format": "int64",
      "description": "The subtransaction amount in milliunits format"
    },
    "deleted": {
      "type": "boolean",
      "description": "Whether or not the subtransaction has been deleted.  Deleted subtransactions will only be included in delta requests."
    },
    "payee_id": {
      "type": "string",
      "format": "uuid",
      "nullable": true
    },
    "payee_name": {
      "type": "string",
      "nullable": true
    },
    "category_id": {
      "type": "string",
      "format": "uuid",
      "nullable": true
    },
    "category_name": {
      "type": "string",
      "nullable": true
    },
    "transaction_id": {
      "type": "string"
    },
    "transfer_account_id": {
      "type": "string",
      "format": "uuid",
      "nullable": true,
      "description": "If a transfer, the account_id which the subtransaction transfers to"
    },
    "transfer_transaction_id": {
      "type": "string",
      "nullable": true,
      "description": "If a transfer, the id of transaction on the other side of the transfer"
    }
  }
}
string TransactionClearedStatus
{
  "enum": [
    "cleared",
    "uncleared",
    "reconciled"
  ],
  "type": "string",
  "description": "The cleared status of the transaction"
}
object TransactionDetail
{
  "allOf": [
    {
      "$ref": "#/components/schemas/TransactionSummary"
    },
    {
      "type": "object",
      "required": [
        "account_name",
        "subtransactions"
      ],
      "properties": {
        "payee_name": {
          "type": "string",
          "nullable": true
        },
        "account_name": {
          "type": "string"
        },
        "category_name": {
          "type": "string",
          "nullable": true,
          "description": "The name of the category.  If a split transaction, this will be 'Split'."
        },
        "subtransactions": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/SubTransaction"
          },
          "description": "If a split transaction, the subtransactions."
        }
      }
    }
  ]
}
string TransactionFlagColor
{
  "enum": [
    "red",
    "orange",
    "yellow",
    "green",
    "blue",
    "purple",
    null
  ],
  "type": "string",
  "nullable": true,
  "description": "The transaction flag"
}
string TransactionFlagName
{
  "type": "string",
  "nullable": true,
  "description": "The customized name of a transaction flag"
}
object TransactionResponse
{
  "type": "object",
  "required": [
    "data"
  ],
  "properties": {
    "data": {
      "type": "object",
      "required": [
        "transaction"
      ],
      "properties": {
        "transaction": {
          "$ref": "#/components/schemas/TransactionDetail"
        }
      }
    }
  }
}
object TransactionSummary
{
  "type": "object",
  "required": [
    "account_id",
    "amount",
    "approved",
    "cleared",
    "date",
    "deleted",
    "id"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "date": {
      "type": "string",
      "format": "date",
      "description": "The transaction date in ISO format (e.g. 2016-12-01)"
    },
    "memo": {
      "type": "string",
      "nullable": true
    },
    "amount": {
      "type": "integer",
      "format": "int64",
      "description": "The transaction amount in milliunits format"
    },
    "cleared": {
      "$ref": "#/components/schemas/TransactionClearedStatus"
    },
    "deleted": {
      "type": "boolean",
      "description": "Whether or not the transaction has been deleted.  Deleted transactions will only be included in delta requests."
    },
    "approved": {
      "type": "boolean",
      "description": "Whether or not the transaction is approved"
    },
    "payee_id": {
      "type": "string",
      "format": "uuid",
      "nullable": true
    },
    "flag_name": {
      "$ref": "#/components/schemas/TransactionFlagName"
    },
    "import_id": {
      "type": "string",
      "nullable": true,
      "description": "If the transaction was imported, this field is a unique (by account) import identifier.  If this transaction was imported through File Based Import or Direct Import and not through the API, the import_id will have the format: 'YNAB:[milliunit_amount]:[iso_date]:[occurrence]'.  For example, a transaction dated 2015-12-30 in the amount of -$294.23 USD would have an import_id of 'YNAB:-294230:2015-12-30:1'.  If a second transaction on the same account was imported and had the same date and same amount, its import_id would be 'YNAB:-294230:2015-12-30:2'."
    },
    "account_id": {
      "type": "string",
      "format": "uuid"
    },
    "flag_color": {
      "$ref": "#/components/schemas/TransactionFlagColor"
    },
    "category_id": {
      "type": "string",
      "format": "uuid",
      "nullable": true
    },
    "import_payee_name": {
      "type": "string",
      "nullable": true,
      "description": "If the transaction was imported, the payee name that was used when importing and before applying any payee rename rules"
    },
    "transfer_account_id": {
      "type": "string",
      "format": "uuid",
      "nullable": true,
      "description": "If a transfer transaction, the account to which it transfers"
    },
    "debt_transaction_type": {
      "enum": [
        "payment",
        "refund",
        "fee",
        "interest",
        "escrow",
        "balanceAdjustment",
        "credit",
        "charge",
        null
      ],
      "type": "string",
      "nullable": true,
      "description": "If the transaction is a debt/loan account transaction, the type of transaction"
    },
    "matched_transaction_id": {
      "type": "string",
      "nullable": true,
      "description": "If transaction is matched, the id of the matched transaction"
    },
    "transfer_transaction_id": {
      "type": "string",
      "nullable": true,
      "description": "If a transfer transaction, the id of transaction on the other side of the transfer"
    },
    "import_payee_name_original": {
      "type": "string",
      "nullable": true,
      "description": "If the transaction was imported, the original payee name as it appeared on the statement"
    }
  }
}
object TransactionsImportResponse
{
  "type": "object",
  "required": [
    "data"
  ],
  "properties": {
    "data": {
      "type": "object",
      "required": [
        "transaction_ids"
      ],
      "properties": {
        "transaction_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The list of transaction ids that were imported."
        }
      }
    }
  }
}
object TransactionsResponse
{
  "type": "object",
  "required": [
    "data"
  ],
  "properties": {
    "data": {
      "type": "object",
      "required": [
        "server_knowledge",
        "transactions"
      ],
      "properties": {
        "transactions": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/TransactionDetail"
          }
        },
        "server_knowledge": {
          "type": "integer",
          "format": "int64",
          "description": "The knowledge of the server"
        }
      }
    }
  }
}
object User
{
  "type": "object",
  "required": [
    "id"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    }
  }
}
object UserResponse
{
  "type": "object",
  "required": [
    "data"
  ],
  "properties": {
    "data": {
      "type": "object",
      "required": [
        "user"
      ],
      "properties": {
        "user": {
          "$ref": "#/components/schemas/User"
        }
      }
    }
  }
}