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

# 정산 부분 수정

> 정산 정보를 부분 수정합니다.

**부수효과:** `status` 변경 시 `SettlementStatusHistory`가 자동 생성됩니다. 변경 이력은 정산 히스토리 API로 조회할 수 있습니다.



## OpenAPI

````yaml PATCH /v1/settlement/{settlement_id}
openapi: 3.1.0
info:
  title: pluuug openapi
  version: 1.0.0
  description: >-
    플러그에서 제공하는 REST API의 상세 내용을 확인하고 직접 테스트할 수 있는 인터페이스입니다.<br>이 문서를 통해 API의
    엔드포인트, 요청 및 응답 형식 등을 확인할 수 있습니다.
servers:
  - url: https://openapi.pluuug.com
security: []
paths:
  /v1/settlement/{settlement_id}:
    patch:
      tags:
        - settlement
      summary: 정산 부분 수정
      description: >-
        정산 정보를 부분 수정합니다.


        **부수효과:** `status` 변경 시 `SettlementStatusHistory`가 자동 생성됩니다. 변경 이력은 정산
        히스토리 API로 조회할 수 있습니다.
      operationId: settlement_partial_update
      parameters:
        - in: path
          name: settlement_id
          schema:
            type: integer
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/PatchedOpenapiSettlementRetrieveUpdateRequest
          application/x-www-form-urlencoded:
            schema:
              $ref: >-
                #/components/schemas/PatchedOpenapiSettlementRetrieveUpdateRequest
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/PatchedOpenapiSettlementRetrieveUpdateRequest
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenapiSettlementRetrieveUpdate'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/OpenapiSettlementRetrieveUpdateValidationError
          description: ''
      security:
        - ApiKeyAuth: []
          Signature: []
components:
  schemas:
    PatchedOpenapiSettlementRetrieveUpdateRequest:
      type: object
      properties:
        title:
          type: string
          minLength: 1
          description: 정산 제목
          maxLength: 128
        amount:
          type: integer
          minimum: 0
          description: 정산 금액
        additionalAmount:
          type: integer
          minimum: 0
          description: 추가 금액
        vat:
          type: integer
          minimum: 0
          description: 부가세
        dueDate:
          type:
            - string
            - 'null'
          format: date
          description: 지급 예정일
        settledDate:
          type:
            - string
            - 'null'
          format: date
          description: 지급 완료일
        isTaxInvoiceIssued:
          type: boolean
          description: 세금 계산서 발행 여부
        isTaxInvoiceNeeded:
          type: boolean
          description: 세금 계산서 발행 필요 여부
        taxInvoiceIssuedDate:
          type:
            - string
            - 'null'
          format: date
          description: 세금 계산서 발행 날짜
        taxInvoiceIssueDueDate:
          type:
            - string
            - 'null'
          format: date
          description: 세금 계산서 발행 예정 날짜
        inChargeSet:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/OpenapiNestedMemberRequest'
          description: 담당자
    OpenapiSettlementRetrieveUpdate:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        title:
          type: string
          description: 정산 제목
          maxLength: 128
        status:
          enum:
            - C
            - D
            - S
            - P
          type: string
          x-spec-enum-id: 3bf0af9565254de8
          readOnly: true
          description: |-
            정산 상태

            * `C` - 정산 예정
            * `D` - 정산 지연
            * `S` - 정산 완료
            * `P` - 정산 중단
          x-enumNames:
            - 정산 예정
            - 정산 지연
            - 정산 완료
            - 정산 중단
        amount:
          type: integer
          minimum: 0
          description: 정산 금액
        additionalAmount:
          type: integer
          minimum: 0
          description: 추가 금액
        vat:
          type: integer
          minimum: 0
          description: 부가세
        settlementRound:
          type: integer
          readOnly: true
          description: 정산 차수
        dueDate:
          type:
            - string
            - 'null'
          format: date
          description: 지급 예정일
        settledDate:
          type:
            - string
            - 'null'
          format: date
          description: 지급 완료일
        isTaxInvoiceIssued:
          type: boolean
          description: 세금 계산서 발행 여부
        isTaxInvoiceNeeded:
          type: boolean
          description: 세금 계산서 발행 필요 여부
        taxInvoiceIssuedDate:
          type:
            - string
            - 'null'
          format: date
          description: 세금 계산서 발행 날짜
        taxInvoiceIssueDueDate:
          type:
            - string
            - 'null'
          format: date
          description: 세금 계산서 발행 예정 날짜
        typeAlias:
          type: string
          readOnly: true
          description: 정산 형태
        created:
          type: string
          format: date-time
          readOnly: true
          description: 생성일시
        contract:
          allOf:
            - $ref: '#/components/schemas/OpenapiNestedSettlementContract'
          readOnly: true
          description: 계약
        type:
          allOf:
            - $ref: '#/components/schemas/OpenapiNestedSettlementType'
          readOnly: true
          description: 정산 형태
        inChargeSet:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/OpenapiNestedMember'
          description: 담당자
      required:
        - additionalAmount
        - amount
        - contract
        - created
        - id
        - isTaxInvoiceIssued
        - isTaxInvoiceNeeded
        - settlementRound
        - status
        - title
        - type
        - typeAlias
        - vat
    OpenapiSettlementRetrieveUpdateValidationError:
      type: object
      properties:
        nonField:
          type: array
          items:
            type: string
        title:
          type: array
          items:
            type: string
        amount:
          type: array
          items:
            type: string
        additionalAmount:
          type: array
          items:
            type: string
        vat:
          type: array
          items:
            type: string
        dueDate:
          type: array
          items:
            type: string
        settledDate:
          type: array
          items:
            type: string
        isTaxInvoiceIssued:
          type: array
          items:
            type: string
        isTaxInvoiceNeeded:
          type: array
          items:
            type: string
        taxInvoiceIssuedDate:
          type: array
          items:
            type: string
        taxInvoiceIssueDueDate:
          type: array
          items:
            type: string
        inChargeSet:
          type: array
          items:
            type: string
    OpenapiNestedMemberRequest:
      type: object
      description: |-
        nested 아이템이 제공되면 선언된 required 필드를 모두 가져야 함을 강제한다.

        부모 레벨 partial(미전송 필드 생략)은 유지하되, nested 아이템은 object-level
        validate에서 required 필드 존재를 재확인해 누락 시 400을 반환한다.
      properties:
        id:
          type: integer
      required:
        - id
    OpenapiNestedSettlementContract:
      type: object
      description: |-
        nested 아이템이 제공되면 선언된 required 필드를 모두 가져야 함을 강제한다.

        부모 레벨 partial(미전송 필드 생략)은 유지하되, nested 아이템은 object-level
        validate에서 required 필드 존재를 재확인해 누락 시 400을 반환한다.
      properties:
        id:
          type: integer
        title:
          type: string
          readOnly: true
          description: 계약 제목
        amount:
          type: integer
          readOnly: true
          description: 계약 금액
        type:
          enum:
            - I
            - S
            - G
          type: string
          x-spec-enum-id: 4b039ce324ed7b8c
          readOnly: true
          description: |-
            계약 타입

            * `I` - 회차 정산형
            * `S` - 정기 결제형
            * `G` - 단건 정산
          x-enumNames:
            - 회차 정산형
            - 정기 결제형
            - 단건 정산
        status:
          enum:
            - P
            - I
            - C
            - T
          type: string
          x-spec-enum-id: 81c3becab4b92e5c
          readOnly: true
          description: |-
            계약 상태

            * `P` - 계약 준비 중
            * `I` - 정산 진행 중
            * `C` - 계약 종료
            * `T` - 계약 중단
          x-enumNames:
            - 계약 준비 중
            - 정산 진행 중
            - 계약 종료
            - 계약 중단
        startDate:
          type:
            - string
            - 'null'
          format: date
          readOnly: true
          description: 계약 착수일
        endDate:
          type:
            - string
            - 'null'
          format: date
          readOnly: true
          description: 계약 종료일
      required:
        - amount
        - endDate
        - id
        - startDate
        - status
        - title
        - type
    OpenapiNestedSettlementType:
      type: object
      properties:
        id:
          type: integer
        baseType:
          enum:
            - INI
            - INS
            - BAL
            - COM
            - SUB
            - SIN
            - ADD
            - OUT
          type: string
          x-spec-enum-id: 07a520aefeea2324
          readOnly: true
          description: |-
            기본 정산 유형

            * `INI` - 착수금
            * `INS` - 중도금
            * `BAL` - 잔금
            * `COM` - 수수료
            * `SUB` - 회차
            * `SIN` - 단건 정산
            * `ADD` - 추가 정산
            * `OUT` - 미수 정산
          x-enumNames:
            - 착수금
            - 중도금
            - 잔금
            - 수수료
            - 회차
            - 단건 정산
            - 추가 정산
            - 미수 정산
        category:
          enum:
            - I
            - S
            - E
          type: string
          x-spec-enum-id: e67ffd252a025015
          readOnly: true
          description: |-
            정산 방식

            * `I` - 회차 정산형
            * `S` - 정기 결제형
            * `E` - 기타
          x-enumNames:
            - 회차 정산형
            - 정기 결제형
            - 기타
        title:
          type: string
          readOnly: true
          description: 제목
        allowsMultipleRounds:
          type: boolean
          readOnly: true
          description: 다중 차수 허용 여부
      required:
        - allowsMultipleRounds
        - baseType
        - category
        - id
        - title
    OpenapiNestedMember:
      type: object
      description: |-
        nested 아이템이 제공되면 선언된 required 필드를 모두 가져야 함을 강제한다.

        부모 레벨 partial(미전송 필드 생략)은 유지하되, nested 아이템은 object-level
        validate에서 required 필드 존재를 재확인해 누락 시 400을 반환한다.
      properties:
        id:
          type: integer
        nickname:
          type:
            - string
            - 'null'
          readOnly: true
          description: 닉네임
        email:
          type: string
          readOnly: true
          description: 이메일
        isActive:
          type: boolean
          readOnly: true
          description: 활성화 여부
        grade:
          allOf:
            - $ref: '#/components/schemas/OpenapiNestedMemberGrade'
          readOnly: true
          description: 등급
      required:
        - email
        - grade
        - id
        - isActive
        - nickname
    OpenapiNestedMemberGrade:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        title:
          type: string
          readOnly: true
      required:
        - id
        - title
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
    Signature:
      type: apiKey
      in: header
      name: X-Signature
      description: |-
        HMAC-SHA256 방식으로 body를 secret key로 해싱하여 생성한 서명을 넣어야 합니다.
        서버는 X-API-Key와 대응되는 secret key로 서명을 검증합니다.

````