> ## Documentation Index
> Fetch the complete documentation index at: https://docs.morrowly.app/llms.txt
> Use this file to discover all available pages before exploring further.

# 플랜 만들기

> 필요한 권한: `plans:write`



## OpenAPI

````yaml /openapi.json post /v1/plans
openapi: 3.1.0
info:
  title: OpenAPI definition
  version: v0
servers:
  - url: https://api.morrowly.app
security:
  - token: []
paths:
  /v1/plans:
    post:
      tags:
        - plans
      summary: 플랜 만들기
      description: '필요한 권한: `plans:write`'
      operationId: create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePlanRequest'
        required: true
      responses:
        '201':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiResponsePlanDoc'
          description: Created
        '401':
          description: 토큰이 없거나 틀리거나 만료됨(본문 없음)
        '403':
          description: 토큰의 권한이 모자람(본문 없음)
components:
  schemas:
    CreatePlanRequest:
      properties:
        fixedStart:
          type: boolean
        name:
          type: string
      required:
        - fixedStart
        - name
      type: object
    ApiResponsePlanDoc:
      properties:
        data:
          oneOf:
            - $ref: '#/components/schemas/PlanDoc'
            - type: 'null'
        error:
          oneOf:
            - $ref: '#/components/schemas/ErrorMessage'
            - type: 'null'
        result:
          $ref: '#/components/schemas/ResultType'
      required:
        - data
        - error
        - result
      type: object
    PlanDoc:
      properties:
        assumptions:
          $ref: '#/components/schemas/Assumptions'
        id:
          format: uuid
          type: string
        items:
          items:
            oneOf:
              - $ref: '#/components/schemas/AssetItem'
              - $ref: '#/components/schemas/ChangeItem'
              - $ref: '#/components/schemas/ChildItem'
              - $ref: '#/components/schemas/ExpenseItem'
              - $ref: '#/components/schemas/GiftItem'
              - $ref: '#/components/schemas/HoldingItem'
              - $ref: '#/components/schemas/HousingItem'
              - $ref: '#/components/schemas/IncomeItem'
              - $ref: '#/components/schemas/LumpSumItem'
              - $ref: '#/components/schemas/SeveranceItem'
              - $ref: '#/components/schemas/TransferItem'
          type: array
        milestones:
          items:
            $ref: '#/components/schemas/Milestone'
          type: array
        monteCarlo:
          $ref: '#/components/schemas/MonteCarloSettings'
        months:
          format: int32
          type: integer
        name:
          type: string
        'off':
          items:
            type: string
          type: array
        revision:
          type: string
        startMonth:
          type:
            - string
            - 'null'
        updatedAt:
          format: date-time
          type: string
      required:
        - assumptions
        - id
        - items
        - milestones
        - monteCarlo
        - months
        - name
        - 'off'
        - revision
        - startMonth
        - updatedAt
      type: object
    ErrorMessage:
      properties:
        code:
          type: string
        data: {}
        message:
          type: string
      required:
        - code
        - data
        - message
      type: object
    ResultType:
      enum:
        - SUCCESS
        - ERROR
      type: string
    Assumptions:
      properties:
        capLoans:
          type: boolean
        cashFloor:
          format: int64
          type: integer
        cashReturn:
          format: double
          type: number
        childDependent:
          type: boolean
        contributions:
          items:
            $ref: '#/components/schemas/Contribution'
          type: array
        dividendYield:
          format: double
          type: number
        harvestGains:
          type: boolean
        incomeGrowth:
          format: double
          type: number
        inflation:
          format: double
          type: number
        investmentReturn:
          format: double
          type: number
        prepayDebt:
          type: boolean
        realEstateGrowth:
          format: double
          type: number
        safeWithdrawalRate:
          format: double
          type: number
        surplusTargetAssetId:
          type:
            - string
            - 'null'
        withdrawalOrder:
          $ref: '#/components/schemas/WithdrawalOrder'
      required:
        - capLoans
        - cashFloor
        - cashReturn
        - childDependent
        - contributions
        - dividendYield
        - harvestGains
        - incomeGrowth
        - inflation
        - investmentReturn
        - prepayDebt
        - realEstateGrowth
        - safeWithdrawalRate
        - surplusTargetAssetId
        - withdrawalOrder
      type: object
    AssetItem:
      allOf:
        - $ref: '#/components/schemas/PlanItem'
        - properties:
            annualRate:
              format: double
              type:
                - number
                - 'null'
            assetType:
              $ref: '#/components/schemas/AssetType'
            cost:
              format: int64
              type: integer
            end:
              oneOf:
                - $ref: '#/components/schemas/Time'
                - type: 'null'
            loan:
              oneOf:
                - $ref: '#/components/schemas/ItemLoan'
                - type: 'null'
            owner:
              $ref: '#/components/schemas/Owner'
            price:
              format: int64
              type: integer
            saleCost:
              format: int64
              type: integer
            start:
              $ref: '#/components/schemas/Time'
          required:
            - annualRate
            - assetType
            - cost
            - end
            - loan
            - owner
            - price
            - saleCost
            - start
          type: object
    ChangeItem:
      allOf:
        - $ref: '#/components/schemas/PlanItem'
        - properties:
            at:
              $ref: '#/components/schemas/Time'
            cashFlowId:
              type: string
            monthlyAmount:
              format: int64
              type: integer
          required:
            - at
            - cashFlowId
            - monthlyAmount
          type: object
    ChildItem:
      allOf:
        - $ref: '#/components/schemas/PlanItem'
        - properties:
            birth:
              $ref: '#/components/schemas/Time'
            childcare:
              format: int64
              type: integer
            until:
              oneOf:
                - $ref: '#/components/schemas/Time'
                - type: 'null'
          required:
            - birth
            - childcare
            - until
          type: object
    ExpenseItem:
      allOf:
        - $ref: '#/components/schemas/PlanItem'
        - properties:
            annualGrowth:
              format: double
              type:
                - number
                - 'null'
            end:
              oneOf:
                - $ref: '#/components/schemas/Time'
                - type: 'null'
            expenseKind:
              oneOf:
                - $ref: '#/components/schemas/ExpenseKind'
                - type: 'null'
            monthlyAmount:
              format: int64
              type: integer
            start:
              $ref: '#/components/schemas/Time'
          required:
            - annualGrowth
            - end
            - expenseKind
            - monthlyAmount
            - start
          type: object
    GiftItem:
      allOf:
        - $ref: '#/components/schemas/PlanItem'
        - properties:
            amount:
              format: int64
              type: integer
            at:
              $ref: '#/components/schemas/Time'
            marriageOrBirth:
              type: boolean
            recipient:
              type: string
            relation:
              $ref: '#/components/schemas/GiftRelation'
          required:
            - amount
            - at
            - marriageOrBirth
            - recipient
            - relation
          type: object
    HoldingItem:
      allOf:
        - $ref: '#/components/schemas/PlanItem'
        - properties:
            assetId:
              type: string
            dividend:
              oneOf:
                - $ref: '#/components/schemas/Dividend'
                - type: 'null'
            protect:
              oneOf:
                - $ref: '#/components/schemas/Time'
                - type: 'null'
            renew:
              oneOf:
                - $ref: '#/components/schemas/HoldingRenew'
                - type: 'null'
            reverseMortgage:
              oneOf:
                - $ref: '#/components/schemas/Time'
                - type: 'null'
            sell:
              oneOf:
                - $ref: '#/components/schemas/Sell'
                - type: 'null'
          required:
            - assetId
            - dividend
            - protect
            - renew
            - reverseMortgage
            - sell
          type: object
    HousingItem:
      allOf:
        - $ref: '#/components/schemas/PlanItem'
        - properties:
            cost:
              format: int64
              type: integer
            end:
              oneOf:
                - $ref: '#/components/schemas/Time'
                - type: 'null'
            firstHome:
              type: boolean
            loan:
              oneOf:
                - $ref: '#/components/schemas/ItemLoan'
                - type: 'null'
            owner:
              $ref: '#/components/schemas/Owner'
            price:
              format: int64
              type: integer
            region:
              type:
                - string
                - 'null'
            renew:
              oneOf:
                - $ref: '#/components/schemas/Renew'
                - type: 'null'
            rent:
              format: int64
              type:
                - integer
                - 'null'
            reverseMortgage:
              oneOf:
                - $ref: '#/components/schemas/Time'
                - type: 'null'
            saleCost:
              format: int64
              type: integer
            start:
              $ref: '#/components/schemas/Time'
            tenure:
              $ref: '#/components/schemas/HousingTenure'
          required:
            - cost
            - end
            - firstHome
            - loan
            - owner
            - price
            - region
            - renew
            - rent
            - reverseMortgage
            - saleCost
            - start
            - tenure
          type: object
    IncomeItem:
      allOf:
        - $ref: '#/components/schemas/PlanItem'
        - properties:
            annualGrowth:
              format: double
              type:
                - number
                - 'null'
            end:
              oneOf:
                - $ref: '#/components/schemas/Time'
                - type: 'null'
            expenseRate:
              format: double
              type:
                - number
                - 'null'
            incomeKind:
              $ref: '#/components/schemas/IncomeKind'
            monthlyAmount:
              format: int64
              type: integer
            owner:
              $ref: '#/components/schemas/Owner'
            start:
              $ref: '#/components/schemas/Time'
          required:
            - annualGrowth
            - end
            - expenseRate
            - incomeKind
            - monthlyAmount
            - owner
            - start
          type: object
    LumpSumItem:
      allOf:
        - $ref: '#/components/schemas/PlanItem'
        - properties:
            amount:
              format: int64
              type: integer
            at:
              $ref: '#/components/schemas/Time'
          required:
            - amount
            - at
          type: object
    SeveranceItem:
      allOf:
        - $ref: '#/components/schemas/PlanItem'
        - properties:
            amount:
              format: int64
              type: integer
            at:
              $ref: '#/components/schemas/Time'
            serviceYears:
              format: int32
              type: integer
          required:
            - amount
            - at
            - serviceYears
          type: object
    TransferItem:
      allOf:
        - $ref: '#/components/schemas/PlanItem'
        - properties:
            amount:
              format: int64
              type:
                - integer
                - 'null'
            at:
              $ref: '#/components/schemas/Time'
            fromAssetId:
              type: string
            newAsset:
              oneOf:
                - $ref: '#/components/schemas/Asset'
                - type: 'null'
            toAssetId:
              type: string
          required:
            - amount
            - at
            - fromAssetId
            - newAsset
            - toAssetId
          type: object
    Milestone:
      properties:
        id:
          type: string
        name:
          type: string
        time:
          $ref: '#/components/schemas/Time'
      required:
        - id
        - name
        - time
      type: object
    MonteCarloSettings:
      properties:
        almostYears:
          format: int32
          type: integer
        comfortable:
          format: double
          type: number
        distribution:
          $ref: '#/components/schemas/Distribution'
        excellent:
          format: double
          type: number
        fair:
          format: double
          type: number
        good:
          format: double
          type: number
        homeRisk:
          type: boolean
        market:
          $ref: '#/components/schemas/Market'
        runs:
          format: int32
          type: integer
        seed:
          format: int64
          type: integer
        surplus:
          format: double
          type: number
        volatility:
          format: double
          type: number
      required:
        - almostYears
        - comfortable
        - distribution
        - excellent
        - fair
        - good
        - homeRisk
        - market
        - runs
        - seed
        - surplus
        - volatility
      type: object
    Contribution:
      properties:
        assetId:
          type: string
        monthlyAmount:
          format: int64
          type: integer
        until:
          type:
            - string
            - 'null'
        untilRetirement:
          type: boolean
      required:
        - assetId
        - monthlyAmount
        - until
        - untilRetirement
      type: object
    WithdrawalOrder:
      enum:
        - PROPORTIONAL
        - TAXABLE_FIRST
        - TAX_FREE_FIRST
      type: string
    PlanItem:
      discriminator:
        mapping:
          asset: '#/components/schemas/AssetItem'
          change: '#/components/schemas/ChangeItem'
          child: '#/components/schemas/ChildItem'
          expense: '#/components/schemas/ExpenseItem'
          gift: '#/components/schemas/GiftItem'
          holding: '#/components/schemas/HoldingItem'
          housing: '#/components/schemas/HousingItem'
          income: '#/components/schemas/IncomeItem'
          lumpSum: '#/components/schemas/LumpSumItem'
          severance: '#/components/schemas/SeveranceItem'
          transfer: '#/components/schemas/TransferItem'
        propertyName: kind
      properties:
        id:
          type: string
        kind:
          type: string
        name:
          type: string
      required:
        - id
        - kind
        - name
      type: object
    AssetType:
      enum:
        - INVESTMENT
        - REAL_ESTATE
        - VEHICLE
        - PENSION_ACCOUNT
        - DEPOSIT
        - RETIREMENT_PENSION
      type: string
    Time:
      properties:
        age:
          format: int32
          type:
            - integer
            - 'null'
        milestone:
          type:
            - string
            - 'null'
        month:
          type:
            - string
            - 'null'
        offset:
          format: int32
          type: integer
        who:
          oneOf:
            - $ref: '#/components/schemas/Owner'
            - type: 'null'
      required:
        - age
        - milestone
        - month
        - offset
        - who
      type: object
    ItemLoan:
      properties:
        annualRate:
          format: double
          type: number
        owner:
          $ref: '#/components/schemas/Owner'
        policyLoan:
          oneOf:
            - $ref: '#/components/schemas/PolicyLoan'
            - type: 'null'
        principal:
          format: int64
          type: integer
        repayment:
          $ref: '#/components/schemas/Repayment'
        termMonths:
          format: int32
          type: integer
      required:
        - annualRate
        - owner
        - policyLoan
        - principal
        - repayment
        - termMonths
      type: object
    Owner:
      enum:
        - SELF
        - SPOUSE
        - JOINT
      type: string
    ExpenseKind:
      enum:
        - RENT
        - DONATION
      type: string
    GiftRelation:
      enum:
        - SPOUSE
        - ADULT_CHILD
        - MINOR_CHILD
      type: string
    Dividend:
      properties:
        from:
          $ref: '#/components/schemas/Time'
        until:
          oneOf:
            - $ref: '#/components/schemas/Time'
            - type: 'null'
      required:
        - from
        - until
      type: object
    HoldingRenew:
      properties:
        at:
          $ref: '#/components/schemas/Time'
        liabilityId:
          type:
            - string
            - 'null'
        rate:
          format: double
          type:
            - number
            - 'null'
      required:
        - at
        - liabilityId
        - rate
      type: object
    Sell:
      properties:
        at:
          $ref: '#/components/schemas/Time'
        cost:
          format: int64
          type: integer
        payOffLiabilityId:
          type:
            - string
            - 'null'
      required:
        - at
        - cost
        - payOffLiabilityId
      type: object
    Renew:
      properties:
        at:
          oneOf:
            - $ref: '#/components/schemas/Time'
            - type: 'null'
        rate:
          format: double
          type:
            - number
            - 'null'
      required:
        - at
        - rate
      type: object
    HousingTenure:
      enum:
        - OWN
        - JEONSE
        - RENT
        - GAP
      type: string
    IncomeKind:
      enum:
        - NET
        - SALARY
        - PUBLIC_PENSION
        - BUSINESS
      type: string
    Asset:
      properties:
        acquiredAt:
          type:
            - string
            - 'null'
        acquisitionPrice:
          format: int64
          type:
            - integer
            - 'null'
        annualRate:
          format: double
          type:
            - number
            - 'null'
        dividendYield:
          format: double
          type:
            - number
            - 'null'
        id:
          type: string
        investmentTax:
          $ref: '#/components/schemas/InvestmentTax'
        monthlyContribution:
          format: int64
          type:
            - integer
            - 'null'
        name:
          type: string
        owner:
          $ref: '#/components/schemas/Owner'
        payoutStartAge:
          format: int32
          type:
            - integer
            - 'null'
        payoutYears:
          format: int32
          type:
            - integer
            - 'null'
        region:
          type:
            - string
            - 'null'
        serviceYears:
          format: int32
          type:
            - integer
            - 'null'
        type:
          $ref: '#/components/schemas/AssetType'
        value:
          format: int64
          type: integer
      required:
        - acquiredAt
        - acquisitionPrice
        - annualRate
        - dividendYield
        - id
        - investmentTax
        - monthlyContribution
        - name
        - owner
        - payoutStartAge
        - payoutYears
        - region
        - serviceYears
        - type
        - value
      type: object
    Distribution:
      enum:
        - LOGNORMAL
        - HISTORICAL
      type: string
    Market:
      enum:
        - SP500
        - KOSPI
      type: string
    PolicyLoan:
      enum:
        - DIDIMDOL
        - NEWBORN
        - BOGEUMJARI
      type: string
    Repayment:
      enum:
        - ANNUITY
        - EQUAL_PRINCIPAL
        - BULLET
        - DEPOSIT
      type: string
    InvestmentTax:
      enum:
        - DOMESTIC_STOCK
        - FOREIGN_STOCK
        - INTEREST
        - TAX_FREE
        - OTHER_ETF
        - HIGH_DIVIDEND
        - ISA
      type: string
  securitySchemes:
    token:
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.