{
  "openapi": "3.1.0",
  "info": {
    "title": "PaySync API",
    "description": "페이싱크 무통장입금 자동 확인 서비스의 공개 REST API예요. 새 연동은 `/v2` 경로를 쓰세요. `/v1` 경로는 이전 연동을 위해 계속 동작해요.\n\n문서: https://docs.paysync.kr/api-reference",
    "version": "3.0.0",
    "contact": {
      "name": "페이싱크",
      "url": "https://paysync.kr"
    }
  },
  "servers": [
    {
      "url": "https://api.paysync.kr",
      "description": "운영 서버"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "주문",
      "description": "주문 생성, 조회, 수정, 결제 완료 처리, 취소예요. 입금자명과 금액이 같은 입금이 들어오면 자동으로 결제 완료돼요."
    },
    {
      "name": "입금",
      "description": "은행 알림으로 들어온 입금과 매칭 결과를 조회해요."
    },
    {
      "name": "현금영수증",
      "description": "현금영수증 발급, 조회, 취소, 재발급, 전송이에요. 사업자 정보를 먼저 등록해야 해요."
    },
    {
      "name": "파트너 OAuth",
      "description": "파트너 앱이 OAuth 2.0 인가 코드 방식으로 고객 워크스페이스에 연결하는 인가 요청, 토큰 발급, 토큰 폐기예요. API 키 경로와 달리 응답이 RFC 6749 형식이고 클라이언트 자격 증명으로 인증해요."
    },
    {
      "name": "v1 주문",
      "description": "이전 버전 v1 주문 API예요."
    },
    {
      "name": "v1 입금",
      "description": "이전 버전 v1 입금 API예요."
    },
    {
      "name": "v1 현금영수증",
      "description": "이전 버전 v1 현금영수증 API예요."
    }
  ],
  "paths": {
    "/v2/invoices": {
      "post": {
        "tags": [
          "주문"
        ],
        "operationId": "createInvoice",
        "summary": "주문 생성",
        "description": "결제받을 주문을 만들어요. [문서](https://docs.paysync.kr/api-reference/invoices/issue)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInvoiceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "성공",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceResponse"
                }
              }
            }
          },
          "401": {
            "description": "인증 실패",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "80003": {
                    "summary": "Authorization 헤더가 없어요.",
                    "value": {
                      "code": "80003"
                    }
                  },
                  "290006": {
                    "summary": "API 키가 올바르지 않아요.",
                    "value": {
                      "code": "290006"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "권한 없음",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "80002": {
                    "summary": "API 키의 계좌 범위 밖",
                    "value": {
                      "code": "80002"
                    }
                  },
                  "290007": {
                    "summary": "읽기 전용 API 키",
                    "value": {
                      "code": "290007"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "상태 충돌",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "220010": {
                    "summary": "같은 입금자명과 금액의 결제 대기 주문이 있어요. data에 기존 주문이 와요.",
                    "value": {
                      "code": "220010"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "요청 값 오류",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "30007": {
                    "summary": "본문 오류",
                    "value": {
                      "code": "30007"
                    }
                  },
                  "220002": {
                    "summary": "입금자명 오류",
                    "value": {
                      "code": "220002"
                    }
                  },
                  "220003": {
                    "summary": "금액 오류",
                    "value": {
                      "code": "220003"
                    }
                  },
                  "220004": {
                    "summary": "이메일 오류",
                    "value": {
                      "code": "220004"
                    }
                  },
                  "220005": {
                    "summary": "전화번호 오류",
                    "value": {
                      "code": "220005"
                    }
                  },
                  "220006": {
                    "summary": "만료 오류",
                    "value": {
                      "code": "220006"
                    }
                  },
                  "220007": {
                    "summary": "현금영수증 정보 오류",
                    "value": {
                      "code": "220007"
                    }
                  },
                  "220008": {
                    "summary": "metadata 오류",
                    "value": {
                      "code": "220008"
                    }
                  },
                  "220009": {
                    "summary": "계좌 ID 오류",
                    "value": {
                      "code": "220009"
                    }
                  },
                  "220018": {
                    "summary": "1원 인증 전 계좌",
                    "value": {
                      "code": "220018"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "주문"
        ],
        "operationId": "listInvoices",
        "summary": "주문 목록 조회",
        "description": "[문서](https://docs.paysync.kr/api-reference/invoices/list)",
        "parameters": [
          {
            "name": "offset",
            "in": "query",
            "required": true,
            "description": "건너뛸 항목 수 (0 이상)",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": true,
            "description": "가져올 항목 수 (1~100)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "주문 ID, 주문번호, 카페24 주문번호, 입금자명, 이메일, 전화번호 검색",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "PENDING, PAID, EXPIRED, CANCELED (쉼표로 여러 개)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "due",
            "in": "query",
            "required": false,
            "description": "결제 대기 주문의 입금 기한",
            "schema": {
              "type": "string",
              "enum": [
                "TODAY",
                "TOMORROW",
                "LATER",
                "NONE"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "description": "DASHBOARD, API, CSV, CAFE24, SIXSHOP, GODOMALL (쉼표로 여러 개)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "createdBy",
            "in": "query",
            "required": false,
            "description": "SYSTEM, 계정 ID, API 키 ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "description": "이 날짜(KST)부터. YYYY-MM-DD",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "description": "이 날짜(KST)까지, 그날 포함. YYYY-MM-DD",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "성공",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceListResponse"
                }
              }
            }
          },
          "401": {
            "description": "인증 실패",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "80003": {
                    "summary": "Authorization 헤더가 없어요.",
                    "value": {
                      "code": "80003"
                    }
                  },
                  "290006": {
                    "summary": "API 키가 올바르지 않아요.",
                    "value": {
                      "code": "290006"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "권한 없음",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "40001": {
                    "summary": "limit이 100을 넘어요.",
                    "value": {
                      "code": "40001"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "요청 값 오류",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "30001": {
                    "summary": "offset 오류",
                    "value": {
                      "code": "30001"
                    }
                  },
                  "30002": {
                    "summary": "limit 오류",
                    "value": {
                      "code": "30002"
                    }
                  },
                  "30004": {
                    "summary": "날짜 형식 오류",
                    "value": {
                      "code": "30004"
                    }
                  },
                  "30005": {
                    "summary": "dateFrom이 dateTo보다 늦어요.",
                    "value": {
                      "code": "30005"
                    }
                  },
                  "220012": {
                    "summary": "status 값 오류",
                    "value": {
                      "code": "220012"
                    }
                  },
                  "220013": {
                    "summary": "source 값 오류",
                    "value": {
                      "code": "220013"
                    }
                  },
                  "220017": {
                    "summary": "due 값 오류",
                    "value": {
                      "code": "220017"
                    }
                  },
                  "220019": {
                    "summary": "createdBy 값 오류",
                    "value": {
                      "code": "220019"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/invoices/{id}": {
      "get": {
        "tags": [
          "주문"
        ],
        "operationId": "getInvoice",
        "summary": "주문 단건 조회",
        "description": "[문서](https://docs.paysync.kr/api-reference/invoices/get)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "주문 ID (`ivc_` 접두사)"
          }
        ],
        "responses": {
          "200": {
            "description": "성공",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceDetailResponse"
                }
              }
            }
          },
          "401": {
            "description": "인증 실패",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "80003": {
                    "summary": "Authorization 헤더가 없어요.",
                    "value": {
                      "code": "80003"
                    }
                  },
                  "290006": {
                    "summary": "API 키가 올바르지 않아요.",
                    "value": {
                      "code": "290006"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "권한 없음",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "80002": {
                    "summary": "API 키의 계좌 범위 밖",
                    "value": {
                      "code": "80002"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "리소스 없음",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "20014": {
                    "summary": "주문이 없어요.",
                    "value": {
                      "code": "20014"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "요청 값 오류",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "220001": {
                    "summary": "주문 ID 형식 오류",
                    "value": {
                      "code": "220001"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "주문"
        ],
        "operationId": "updateInvoice",
        "summary": "주문 수정",
        "description": "결제 대기 주문을 바꿔요. [문서](https://docs.paysync.kr/api-reference/invoices/update)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "주문 ID (`ivc_` 접두사)"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInvoiceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "성공",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceResponse"
                }
              }
            }
          },
          "401": {
            "description": "인증 실패",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "80003": {
                    "summary": "Authorization 헤더가 없어요.",
                    "value": {
                      "code": "80003"
                    }
                  },
                  "290006": {
                    "summary": "API 키가 올바르지 않아요.",
                    "value": {
                      "code": "290006"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "권한 없음",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "80002": {
                    "summary": "API 키의 계좌 범위 밖",
                    "value": {
                      "code": "80002"
                    }
                  },
                  "290007": {
                    "summary": "읽기 전용 API 키",
                    "value": {
                      "code": "290007"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "리소스 없음",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "20014": {
                    "summary": "주문이 없어요.",
                    "value": {
                      "code": "20014"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "상태 충돌",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "220010": {
                    "summary": "다른 결제 대기 주문과 겹쳐요.",
                    "value": {
                      "code": "220010"
                    }
                  },
                  "220011": {
                    "summary": "결제 대기 주문이 아니에요.",
                    "value": {
                      "code": "220011"
                    }
                  },
                  "220022": {
                    "summary": "받을 계좌가 없어요.",
                    "value": {
                      "code": "220022"
                    }
                  },
                  "220023": {
                    "summary": "입금 기한이 없어요.",
                    "value": {
                      "code": "220023"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "요청 값 오류",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "30007": {
                    "summary": "본문 오류",
                    "value": {
                      "code": "30007"
                    }
                  },
                  "30009": {
                    "summary": "바꿀 필드가 없어요.",
                    "value": {
                      "code": "30009"
                    }
                  },
                  "220001": {
                    "summary": "주문 ID 형식 오류",
                    "value": {
                      "code": "220001"
                    }
                  },
                  "220018": {
                    "summary": "1원 인증 전 계좌",
                    "value": {
                      "code": "220018"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/invoices/{id}/mark-paid": {
      "post": {
        "tags": [
          "주문"
        ],
        "operationId": "markInvoicePaid",
        "summary": "주문 결제 완료 처리",
        "description": "입금 매칭 없이 결제 완료로 바꿔요. [문서](https://docs.paysync.kr/api-reference/invoices/mark-as-paid)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "주문 ID (`ivc_` 접두사)"
          }
        ],
        "responses": {
          "200": {
            "description": "성공",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceResponse"
                }
              }
            }
          },
          "401": {
            "description": "인증 실패",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "80003": {
                    "summary": "Authorization 헤더가 없어요.",
                    "value": {
                      "code": "80003"
                    }
                  },
                  "290006": {
                    "summary": "API 키가 올바르지 않아요.",
                    "value": {
                      "code": "290006"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "권한 없음",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "80002": {
                    "summary": "API 키의 계좌 범위 밖",
                    "value": {
                      "code": "80002"
                    }
                  },
                  "290007": {
                    "summary": "읽기 전용 API 키",
                    "value": {
                      "code": "290007"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "리소스 없음",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "20014": {
                    "summary": "주문이 없어요.",
                    "value": {
                      "code": "20014"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "상태 충돌",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "220011": {
                    "summary": "이미 결제됐거나 취소된 주문",
                    "value": {
                      "code": "220011"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "요청 값 오류",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "220001": {
                    "summary": "주문 ID 형식 오류",
                    "value": {
                      "code": "220001"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/invoices/{id}/cancel": {
      "post": {
        "tags": [
          "주문"
        ],
        "operationId": "cancelInvoice",
        "summary": "주문 취소",
        "description": "결제 대기나 만료 주문을 취소해요. [문서](https://docs.paysync.kr/api-reference/invoices/cancel)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "주문 ID (`ivc_` 접두사)"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelInvoiceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "성공",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceResponse"
                }
              }
            }
          },
          "401": {
            "description": "인증 실패",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "80003": {
                    "summary": "Authorization 헤더가 없어요.",
                    "value": {
                      "code": "80003"
                    }
                  },
                  "290006": {
                    "summary": "API 키가 올바르지 않아요.",
                    "value": {
                      "code": "290006"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "권한 없음",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "80002": {
                    "summary": "API 키의 계좌 범위 밖",
                    "value": {
                      "code": "80002"
                    }
                  },
                  "290007": {
                    "summary": "읽기 전용 API 키",
                    "value": {
                      "code": "290007"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "리소스 없음",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "20014": {
                    "summary": "주문이 없어요.",
                    "value": {
                      "code": "20014"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "상태 충돌",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "220011": {
                    "summary": "이미 결제됐거나 취소된 주문",
                    "value": {
                      "code": "220011"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "요청 값 오류",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "220001": {
                    "summary": "주문 ID 형식 오류",
                    "value": {
                      "code": "220001"
                    }
                  },
                  "220020": {
                    "summary": "취소 사유가 200자를 넘어요.",
                    "value": {
                      "code": "220020"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/transactions": {
      "get": {
        "tags": [
          "입금"
        ],
        "operationId": "listTransactions",
        "summary": "입금 내역 목록 조회",
        "description": "[문서](https://docs.paysync.kr/api-reference/transactions/list)",
        "parameters": [
          {
            "name": "offset",
            "in": "query",
            "required": true,
            "description": "건너뛸 항목 수 (0 이상)",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": true,
            "description": "가져올 항목 수 (1~100)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "입금 ID, 계좌 ID, 주문 ID, 주문번호, 입금자명, 계좌번호 검색",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "bankAccountId",
            "in": "query",
            "required": false,
            "description": "계좌 ID (쉼표로 여러 개)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "MATCHED, UNMATCHED, HIDDEN (쉼표로 여러 개)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "matchMethod",
            "in": "query",
            "required": false,
            "description": "EXACT, BRACKET_REMOVAL, NAME_PREFIX, CASE_INSENSITIVE, NORMALIZED, AMOUNT_TOLERANCE, MANUAL (쉼표로 여러 개)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "description": "이 날짜(KST)부터. YYYY-MM-DD",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "description": "이 날짜(KST)까지, 그날 포함. YYYY-MM-DD",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "성공",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionListResponse"
                }
              }
            }
          },
          "401": {
            "description": "인증 실패",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "80003": {
                    "summary": "Authorization 헤더가 없어요.",
                    "value": {
                      "code": "80003"
                    }
                  },
                  "290006": {
                    "summary": "API 키가 올바르지 않아요.",
                    "value": {
                      "code": "290006"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "권한 없음",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "40001": {
                    "summary": "limit이 100을 넘어요.",
                    "value": {
                      "code": "40001"
                    }
                  },
                  "80002": {
                    "summary": "API 키의 계좌 범위 밖",
                    "value": {
                      "code": "80002"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "요청 값 오류",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "30001": {
                    "summary": "offset 오류",
                    "value": {
                      "code": "30001"
                    }
                  },
                  "30002": {
                    "summary": "limit 오류",
                    "value": {
                      "code": "30002"
                    }
                  },
                  "30004": {
                    "summary": "날짜 형식 오류",
                    "value": {
                      "code": "30004"
                    }
                  },
                  "30005": {
                    "summary": "dateFrom이 dateTo보다 늦어요.",
                    "value": {
                      "code": "30005"
                    }
                  },
                  "200001": {
                    "summary": "계좌 ID 형식 오류",
                    "value": {
                      "code": "200001"
                    }
                  },
                  "210002": {
                    "summary": "status 값 오류",
                    "value": {
                      "code": "210002"
                    }
                  },
                  "210003": {
                    "summary": "matchMethod 값 오류",
                    "value": {
                      "code": "210003"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/transactions/{id}": {
      "get": {
        "tags": [
          "입금"
        ],
        "operationId": "getTransaction",
        "summary": "입금 단건 조회",
        "description": "[문서](https://docs.paysync.kr/api-reference/transactions/get)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "입금 ID (`trx_` 접두사)"
          }
        ],
        "responses": {
          "200": {
            "description": "성공",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionResponse"
                }
              }
            }
          },
          "401": {
            "description": "인증 실패",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "80003": {
                    "summary": "Authorization 헤더가 없어요.",
                    "value": {
                      "code": "80003"
                    }
                  },
                  "290006": {
                    "summary": "API 키가 올바르지 않아요.",
                    "value": {
                      "code": "290006"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "권한 없음",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "80002": {
                    "summary": "API 키의 계좌 범위 밖",
                    "value": {
                      "code": "80002"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "리소스 없음",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "20013": {
                    "summary": "입금이 없어요.",
                    "value": {
                      "code": "20013"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "요청 값 오류",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "210001": {
                    "summary": "입금 ID 형식 오류",
                    "value": {
                      "code": "210001"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/cash-receipts": {
      "post": {
        "tags": [
          "현금영수증"
        ],
        "operationId": "issueCashReceipt",
        "summary": "현금영수증 발급",
        "description": "팝빌이 거절해도 200과 함께 FAILED 현금영수증이 와요. [문서](https://docs.paysync.kr/api-reference/cash-receipts/issue)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IssueCashReceiptRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "성공",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CashReceiptResponse"
                }
              }
            }
          },
          "401": {
            "description": "인증 실패",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "80003": {
                    "summary": "Authorization 헤더가 없어요.",
                    "value": {
                      "code": "80003"
                    }
                  },
                  "290006": {
                    "summary": "API 키가 올바르지 않아요.",
                    "value": {
                      "code": "290006"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "권한 없음",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "290007": {
                    "summary": "읽기 전용 API 키",
                    "value": {
                      "code": "290007"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "리소스 없음",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "20014": {
                    "summary": "invoiceId의 주문이 없어요.",
                    "value": {
                      "code": "20014"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "상태 충돌",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "240005": {
                    "summary": "사업자 정보 없음",
                    "value": {
                      "code": "240005"
                    }
                  },
                  "240012": {
                    "summary": "이 주문에 이미 현금영수증이 있어요.",
                    "value": {
                      "code": "240012"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "요청 값 오류",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "30007": {
                    "summary": "본문 오류",
                    "value": {
                      "code": "30007"
                    }
                  },
                  "220001": {
                    "summary": "invoiceId 형식 오류",
                    "value": {
                      "code": "220001"
                    }
                  },
                  "240002": {
                    "summary": "type 오류",
                    "value": {
                      "code": "240002"
                    }
                  },
                  "240003": {
                    "summary": "identifier 오류",
                    "value": {
                      "code": "240003"
                    }
                  },
                  "240004": {
                    "summary": "amount 오류",
                    "value": {
                      "code": "240004"
                    }
                  },
                  "240014": {
                    "summary": "customerName 오류",
                    "value": {
                      "code": "240014"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "현금영수증"
        ],
        "operationId": "listCashReceipts",
        "summary": "현금영수증 목록 조회",
        "description": "[문서](https://docs.paysync.kr/api-reference/cash-receipts/list)",
        "parameters": [
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "건너뛸 항목 수. 기본값 0",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "가져올 항목 수. 기본값 100",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "현금영수증 ID, 주문 ID, 승인번호, 주문번호, 구매자 이름, 식별번호 검색",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "PENDING, ISSUED, FAILED, CANCELED (쉼표로 여러 개)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "PERSONAL, CORPORATE",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "method",
            "in": "query",
            "required": false,
            "description": "AUTO, MANUAL",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "description": "ORIGINAL, CANCELLATION",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "invoiceId",
            "in": "query",
            "required": false,
            "description": "연결된 주문 ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "description": "이 날짜(KST)부터. YYYY-MM-DD",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "description": "이 날짜(KST)까지, 그날 포함. YYYY-MM-DD",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "성공",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CashReceiptListResponse"
                }
              }
            }
          },
          "401": {
            "description": "인증 실패",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "80003": {
                    "summary": "Authorization 헤더가 없어요.",
                    "value": {
                      "code": "80003"
                    }
                  },
                  "290006": {
                    "summary": "API 키가 올바르지 않아요.",
                    "value": {
                      "code": "290006"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "권한 없음",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "40001": {
                    "summary": "limit이 100을 넘어요.",
                    "value": {
                      "code": "40001"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "요청 값 오류",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "30001": {
                    "summary": "offset 오류",
                    "value": {
                      "code": "30001"
                    }
                  },
                  "30002": {
                    "summary": "limit 오류",
                    "value": {
                      "code": "30002"
                    }
                  },
                  "30004": {
                    "summary": "날짜 형식 오류",
                    "value": {
                      "code": "30004"
                    }
                  },
                  "30005": {
                    "summary": "dateFrom이 dateTo보다 늦어요.",
                    "value": {
                      "code": "30005"
                    }
                  },
                  "240002": {
                    "summary": "type 값 오류",
                    "value": {
                      "code": "240002"
                    }
                  },
                  "240011": {
                    "summary": "status 값 오류",
                    "value": {
                      "code": "240011"
                    }
                  },
                  "240015": {
                    "summary": "kind 값 오류",
                    "value": {
                      "code": "240015"
                    }
                  },
                  "240016": {
                    "summary": "method 값 오류",
                    "value": {
                      "code": "240016"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/cash-receipts/{id}": {
      "get": {
        "tags": [
          "현금영수증"
        ],
        "operationId": "getCashReceipt",
        "summary": "현금영수증 단건 조회",
        "description": "[문서](https://docs.paysync.kr/api-reference/cash-receipts/get)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "현금영수증 ID (`crt_` 접두사)"
          }
        ],
        "responses": {
          "200": {
            "description": "성공",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CashReceiptResponse"
                }
              }
            }
          },
          "401": {
            "description": "인증 실패",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "80003": {
                    "summary": "Authorization 헤더가 없어요.",
                    "value": {
                      "code": "80003"
                    }
                  },
                  "290006": {
                    "summary": "API 키가 올바르지 않아요.",
                    "value": {
                      "code": "290006"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "리소스 없음",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "20015": {
                    "summary": "현금영수증이 없어요.",
                    "value": {
                      "code": "20015"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "요청 값 오류",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "240001": {
                    "summary": "ID 형식 오류",
                    "value": {
                      "code": "240001"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/cash-receipts/{id}/cancel": {
      "post": {
        "tags": [
          "현금영수증"
        ],
        "operationId": "cancelCashReceipt",
        "summary": "현금영수증 취소",
        "description": "ISSUED 원본의 전체나 일부를 취소하고 취소 영수증을 돌려줘요. [문서](https://docs.paysync.kr/api-reference/cash-receipts/cancel)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "현금영수증 ID (`crt_` 접두사)"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelCashReceiptRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "성공",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CashReceiptResponse"
                }
              }
            }
          },
          "401": {
            "description": "인증 실패",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "80003": {
                    "summary": "Authorization 헤더가 없어요.",
                    "value": {
                      "code": "80003"
                    }
                  },
                  "290006": {
                    "summary": "API 키가 올바르지 않아요.",
                    "value": {
                      "code": "290006"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "권한 없음",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "290007": {
                    "summary": "읽기 전용 API 키",
                    "value": {
                      "code": "290007"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "리소스 없음",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "20015": {
                    "summary": "현금영수증이 없어요.",
                    "value": {
                      "code": "20015"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "상태 충돌",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "240006": {
                    "summary": "취소할 수 없는 상태",
                    "value": {
                      "code": "240006"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "요청 값 오류",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "240004": {
                    "summary": "금액 오류",
                    "value": {
                      "code": "240004"
                    }
                  },
                  "240008": {
                    "summary": "팝빌이 거절했어요.",
                    "value": {
                      "code": "240008"
                    }
                  },
                  "240010": {
                    "summary": "사유 오류",
                    "value": {
                      "code": "240010"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/cash-receipts/{id}/reissue": {
      "post": {
        "tags": [
          "현금영수증"
        ],
        "operationId": "reissueCashReceipt",
        "summary": "현금영수증 재발급",
        "description": "FAILED 원본을 다시 발급해요. [문서](https://docs.paysync.kr/api-reference/cash-receipts/reissue)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "현금영수증 ID (`crt_` 접두사)"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReissueCashReceiptRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "성공",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CashReceiptResponse"
                }
              }
            }
          },
          "401": {
            "description": "인증 실패",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "80003": {
                    "summary": "Authorization 헤더가 없어요.",
                    "value": {
                      "code": "80003"
                    }
                  },
                  "290006": {
                    "summary": "API 키가 올바르지 않아요.",
                    "value": {
                      "code": "290006"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "권한 없음",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "290007": {
                    "summary": "읽기 전용 API 키",
                    "value": {
                      "code": "290007"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "리소스 없음",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "20015": {
                    "summary": "현금영수증이 없어요.",
                    "value": {
                      "code": "20015"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "상태 충돌",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "240005": {
                    "summary": "사업자 정보 없음",
                    "value": {
                      "code": "240005"
                    }
                  },
                  "240007": {
                    "summary": "재발급할 수 없어요.",
                    "value": {
                      "code": "240007"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "요청 값 오류",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "240002": {
                    "summary": "type 오류",
                    "value": {
                      "code": "240002"
                    }
                  },
                  "240003": {
                    "summary": "identifier 오류",
                    "value": {
                      "code": "240003"
                    }
                  },
                  "240008": {
                    "summary": "팝빌이 다시 거절했어요.",
                    "value": {
                      "code": "240008"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/cash-receipts/{id}/urls": {
      "get": {
        "tags": [
          "현금영수증"
        ],
        "operationId": "getCashReceiptUrls",
        "summary": "현금영수증 문서 주소 조회",
        "description": "[문서](https://docs.paysync.kr/api-reference/cash-receipts/urls)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "현금영수증 ID (`crt_` 접두사)"
          }
        ],
        "responses": {
          "200": {
            "description": "성공",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CashReceiptUrlsResponse"
                }
              }
            }
          },
          "401": {
            "description": "인증 실패",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "80003": {
                    "summary": "Authorization 헤더가 없어요.",
                    "value": {
                      "code": "80003"
                    }
                  },
                  "290006": {
                    "summary": "API 키가 올바르지 않아요.",
                    "value": {
                      "code": "290006"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "리소스 없음",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "20015": {
                    "summary": "현금영수증이 없어요.",
                    "value": {
                      "code": "20015"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "상태 충돌",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "240020": {
                    "summary": "문서를 열 수 없는 상태",
                    "value": {
                      "code": "240020"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "외부 서비스 오류",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "240009": {
                    "summary": "팝빌 호출 실패",
                    "value": {
                      "code": "240009"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/cash-receipts/{id}/send-email": {
      "post": {
        "tags": [
          "현금영수증"
        ],
        "operationId": "sendCashReceiptEmail",
        "summary": "현금영수증 이메일 전송",
        "description": "[문서](https://docs.paysync.kr/api-reference/cash-receipts/send-email)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "현금영수증 ID (`crt_` 접두사)"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendCashReceiptEmailRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "성공",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OkResponse"
                }
              }
            }
          },
          "401": {
            "description": "인증 실패",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "80003": {
                    "summary": "Authorization 헤더가 없어요.",
                    "value": {
                      "code": "80003"
                    }
                  },
                  "290006": {
                    "summary": "API 키가 올바르지 않아요.",
                    "value": {
                      "code": "290006"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "권한 없음",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "290007": {
                    "summary": "읽기 전용 API 키",
                    "value": {
                      "code": "290007"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "리소스 없음",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "20015": {
                    "summary": "현금영수증이 없어요.",
                    "value": {
                      "code": "20015"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "상태 충돌",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "240020": {
                    "summary": "보낼 수 없는 상태",
                    "value": {
                      "code": "240020"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "요청 값 오류",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "240018": {
                    "summary": "이메일 오류",
                    "value": {
                      "code": "240018"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "외부 서비스 오류",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "240009": {
                    "summary": "팝빌 호출 실패",
                    "value": {
                      "code": "240009"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/oauth/authorize": {
      "get": {
        "tags": [
          "파트너 OAuth"
        ],
        "operationId": "authorizeOauthApp",
        "summary": "인가 요청",
        "description": "고객의 브라우저를 페이싱크 연결 화면으로 보내요. API 서버가 아니라 `https://paysync.kr`에서 열려요. 고객이 허용하면 `redirect_uri`에 `code`와 `state`를 붙여 이동하고, 취소하면 `error=access_denied`와 `state`를 붙여 이동해요. 인가 코드는 10분 동안 한 번만 쓸 수 있어요. [문서](https://docs.paysync.kr/partners/oauth/authorize)",
        "servers": [
          {
            "url": "https://paysync.kr",
            "description": "연결 화면"
          }
        ],
        "security": [],
        "parameters": [
          {
            "name": "response_type",
            "in": "query",
            "required": true,
            "description": "`code`",
            "schema": {
              "type": "string",
              "enum": [
                "code"
              ]
            }
          },
          {
            "name": "client_id",
            "in": "query",
            "required": true,
            "description": "앱 ID (`oap_` 접두사)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "redirect_uri",
            "in": "query",
            "required": true,
            "description": "인가 코드를 받을 주소. 앱에 등록한 값과 똑같아야 해요.",
            "schema": {
              "type": "string",
              "format": "uri"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": true,
            "description": "공백으로 구분한 스코프. 앱에 등록된 스코프만 요청할 수 있어요.",
            "schema": {
              "type": "string"
            },
            "example": "invoices:read transactions:read"
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "description": "인가 코드와 함께 그대로 돌려주는 값",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code_challenge",
            "in": "query",
            "required": false,
            "description": "PKCE. `BASE64URL(SHA256(code_verifier))`, 패딩 없는 43자",
            "schema": {
              "type": "string",
              "minLength": 43,
              "maxLength": 43
            }
          },
          {
            "name": "code_challenge_method",
            "in": "query",
            "required": false,
            "description": "`code_challenge`를 보낼 때 필수. `S256`만 지원해요.",
            "schema": {
              "type": "string",
              "enum": [
                "S256"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "연결 화면 (HTML). 요청이 잘못되면 `redirect_uri`로 돌아가지 않고 연결 화면에 오류를 보여 줘요.",
            "content": {
              "text/html": {}
            }
          }
        }
      }
    },
    "/v2/oauth-apps/token": {
      "post": {
        "tags": [
          "파트너 OAuth"
        ],
        "operationId": "exchangeOauthCode",
        "summary": "토큰 발급",
        "description": "인가 코드를 연결된 앱의 액세스 토큰(`oat_...`)으로 바꿔요. 클라이언트 인증은 HTTP Basic 또는 본문의 `client_id`, `client_secret`으로 해요. Basic 헤더가 있으면 본문 값은 보지 않아요. 토큰에는 만료와 리프레시 토큰이 없어요. 응답에 `Cache-Control: no-store`가 붙어요. [문서](https://docs.paysync.kr/partners/oauth/token)",
        "security": [
          {
            "oauthClientBasic": []
          },
          {}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/OauthTokenRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "성공",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OauthTokenResponse"
                }
              }
            }
          },
          "400": {
            "description": "요청 오류",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OauthErrorResponse"
                },
                "examples": {
                  "invalid_request": {
                    "summary": "본문을 `application/x-www-form-urlencoded`로 읽을 수 없어요.",
                    "value": {
                      "error": "invalid_request"
                    }
                  },
                  "unsupported_grant_type": {
                    "summary": "`grant_type`이 `authorization_code`가 아니에요.",
                    "value": {
                      "error": "unsupported_grant_type"
                    }
                  },
                  "invalid_grant": {
                    "summary": "인가 코드가 없거나, 이미 썼거나, 만료됐거나, 다른 앱의 코드예요. `redirect_uri`나 `code_verifier`가 맞지 않아도 이 오류예요.",
                    "value": {
                      "error": "invalid_grant"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "클라이언트 인증 실패",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OauthErrorResponse"
                },
                "examples": {
                  "invalid_client": {
                    "summary": "`client_id`나 `client_secret`이 없거나 틀렸어요.",
                    "value": {
                      "error": "invalid_client"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/oauth-apps/revoke": {
      "post": {
        "tags": [
          "파트너 OAuth"
        ],
        "operationId": "revokeOauthToken",
        "summary": "토큰 폐기",
        "description": "액세스 토큰을 폐기해 고객 워크스페이스와의 연결을 끊어요 (RFC 7009). 이미 폐기했거나 모르는 토큰, 다른 앱의 토큰이어도 같은 성공 응답이 와요. [문서](https://docs.paysync.kr/partners/oauth/revoke)",
        "security": [
          {
            "oauthClientBasic": []
          },
          {}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/OauthRevokeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "성공. 빈 객체예요.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false
                },
                "example": {}
              }
            }
          },
          "400": {
            "description": "요청 오류",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OauthErrorResponse"
                },
                "examples": {
                  "invalid_request": {
                    "summary": "본문을 `application/x-www-form-urlencoded`로 읽을 수 없어요.",
                    "value": {
                      "error": "invalid_request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "클라이언트 인증 실패",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OauthErrorResponse"
                },
                "examples": {
                  "invalid_client": {
                    "summary": "`client_id`나 `client_secret`이 없거나 틀렸어요.",
                    "value": {
                      "error": "invalid_client"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/invoices": {
      "post": {
        "tags": [
          "v1 주문"
        ],
        "summary": "주문 생성",
        "description": "새로운 주문을 생성합니다. 등록된 계좌로 `입금자명` 과 `입금 금액` 이 모두 일치하는 입금이 들어오면 페이싱크가 자동으로 결제 완료 상태로 전환하고, 등록된 웹훅으로 `invoice.paid` 이벤트가 전송됩니다.",
        "operationId": "v1IssueInvoice",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1IssueInvoiceRequest"
              },
              "example": {
                "customer": {
                  "name": "홍길동",
                  "email": "hong@example.com",
                  "phoneNumber": "01012345678"
                },
                "amount": 50000,
                "cashReceipt": {
                  "type": "PERSONAL",
                  "identifier": "01012345678"
                },
                "expireAfter": "1d",
                "metadata": {
                  "orderId": "ORDER-2026-0001"
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "주문이 성공적으로 생성되었습니다.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1InvoiceResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1Unauthorized"
          },
          "403": {
            "description": "계좌 권한 또는 인증 상태 오류",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1EmptyResponse"
                },
                "examples": {
                  "INSUFFICIENT_PERMISSIONS": {
                    "value": {
                      "code": "INSUFFICIENT_PERMISSIONS",
                      "data": null
                    }
                  },
                  "BANK_ACCOUNT_NOT_VERIFIED": {
                    "value": {
                      "code": "BANK_ACCOUNT_NOT_VERIFIED",
                      "data": null
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "없는 계좌 ID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1EmptyResponse"
                },
                "examples": {
                  "BANK_ACCOUNT_NOT_FOUND": {
                    "value": {
                      "code": "BANK_ACCOUNT_NOT_FOUND",
                      "data": null
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "입금자명과 금액이 같고 받을 계좌가 겹치는 결제 대기 주문이 이미 있습니다.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1EmptyResponse"
                },
                "example": {
                  "code": "INVOICE_ALREADY_EXISTS",
                  "data": null
                }
              }
            }
          },
          "422": {
            "description": "요청 값이 유효하지 않습니다.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1EmptyResponse"
                },
                "examples": {
                  "INVALID_AMOUNT": {
                    "value": {
                      "code": "INVALID_AMOUNT",
                      "data": null
                    }
                  },
                  "INVALID_CUSTOMER_NAME": {
                    "value": {
                      "code": "INVALID_CUSTOMER_NAME",
                      "data": null
                    }
                  },
                  "INVALID_EMAIL": {
                    "value": {
                      "code": "INVALID_EMAIL",
                      "data": null
                    }
                  },
                  "INVALID_PHONE_NUMBER": {
                    "value": {
                      "code": "INVALID_PHONE_NUMBER",
                      "data": null
                    }
                  },
                  "INVALID_DURATION": {
                    "value": {
                      "code": "INVALID_DURATION",
                      "data": null
                    }
                  },
                  "EXPIRE_AFTER_EXCEEDS_MAXIMUM": {
                    "value": {
                      "code": "EXPIRE_AFTER_EXCEEDS_MAXIMUM",
                      "data": null
                    }
                  },
                  "METADATA_KEY_VALUE_PAIR_LIMIT_EXCEEDED": {
                    "value": {
                      "code": "METADATA_KEY_VALUE_PAIR_LIMIT_EXCEEDED",
                      "data": null
                    }
                  },
                  "METADATA_KEY_LENGTH_LIMIT_EXCEEDED": {
                    "value": {
                      "code": "METADATA_KEY_LENGTH_LIMIT_EXCEEDED",
                      "data": null
                    }
                  },
                  "METADATA_VALUE_LENGTH_LIMIT_EXCEEDED": {
                    "value": {
                      "code": "METADATA_VALUE_LENGTH_LIMIT_EXCEEDED",
                      "data": null
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "v1 주문"
        ],
        "summary": "주문 목록 조회",
        "description": "API 키와 연결된 계정의 주문 목록을 페이지 단위로 조회합니다.",
        "operationId": "v1ListInvoices",
        "parameters": [
          {
            "$ref": "#/components/parameters/V1Offset"
          },
          {
            "$ref": "#/components/parameters/V1Limit"
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "주문 ID가 같거나, 입금자명, 이메일, 전화번호, 현금영수증 식별번호에 검색어가 들어간 주문 (대소문자 무시, 하이픈 무시)"
          },
          {
            "name": "paid",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "결제 완료 여부"
          },
          {
            "name": "expired",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "true면 만료된 주문, false면 만료 기간이 없거나 아직 만료되지 않은 주문"
          },
          {
            "name": "dateAfter",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "이 날짜(KST, 포함) 이후에 만든 주문"
          },
          {
            "name": "dateBefore",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "이 날짜(KST, 포함) 이전에 만든 주문"
          }
        ],
        "responses": {
          "200": {
            "description": "주문 목록",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1InvoiceListResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1Unauthorized"
          },
          "403": {
            "description": "limit 이 100 을 초과했습니다.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1EmptyResponse"
                },
                "example": {
                  "code": "LIMIT_EXCEEDS_MAXIMUM",
                  "data": null
                }
              }
            }
          },
          "422": {
            "description": "페이징/날짜 파라미터가 유효하지 않습니다.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1EmptyResponse"
                },
                "examples": {
                  "INVALID_OFFSET": {
                    "value": {
                      "code": "INVALID_OFFSET",
                      "data": null
                    }
                  },
                  "INVALID_LIMIT": {
                    "value": {
                      "code": "INVALID_LIMIT",
                      "data": null
                    }
                  },
                  "INVALID_DATE_RANGE_FORMAT": {
                    "value": {
                      "code": "INVALID_DATE_RANGE_FORMAT",
                      "data": null
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/invoices/{id}": {
      "get": {
        "tags": [
          "v1 주문"
        ],
        "summary": "주문 단건 조회",
        "operationId": "v1GetInvoice",
        "parameters": [
          {
            "$ref": "#/components/parameters/V1InvoiceId"
          }
        ],
        "responses": {
          "200": {
            "description": "주문 정보",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1InvoiceResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/V1Forbidden"
          },
          "404": {
            "description": "주문을 찾을 수 없습니다.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1EmptyResponse"
                },
                "example": {
                  "code": "INVOICE_NOT_FOUND",
                  "data": null
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "v1 주문"
        ],
        "summary": "주문 삭제",
        "description": "결제 완료 상태가 아닌 주문만 삭제할 수 있습니다.",
        "operationId": "v1DeleteInvoice",
        "parameters": [
          {
            "$ref": "#/components/parameters/V1InvoiceId"
          }
        ],
        "responses": {
          "200": {
            "description": "삭제 완료",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1EmptyResponse"
                },
                "example": {
                  "code": "DELETED",
                  "data": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1Unauthorized"
          },
          "403": {
            "description": "이미 결제 완료된 주문은 삭제할 수 없거나, 권한이 없습니다.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1EmptyResponse"
                },
                "examples": {
                  "INVOICE_ALREADY_PAID": {
                    "value": {
                      "code": "INVOICE_ALREADY_PAID",
                      "data": null
                    }
                  },
                  "INSUFFICIENT_PERMISSIONS": {
                    "value": {
                      "code": "INSUFFICIENT_PERMISSIONS",
                      "data": null
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "주문을 찾을 수 없습니다.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1EmptyResponse"
                },
                "example": {
                  "code": "INVOICE_NOT_FOUND",
                  "data": null
                }
              }
            }
          },
          "500": {
            "description": "삭제 처리 중 서버 내부 오류가 발생했습니다.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1EmptyResponse"
                },
                "example": {
                  "code": "INTERNAL_SERVER_ERROR",
                  "data": null
                }
              }
            }
          }
        }
      }
    },
    "/v1/invoices/{id}/mark-as-paid": {
      "post": {
        "tags": [
          "v1 주문"
        ],
        "summary": "주문 결제 완료 처리",
        "description": "현금 등 페이싱크 외부 경로로 결제가 이뤄진 경우, 주문을 수동으로 결제 완료 상태로 전환합니다. 등록된 웹훅으로 `invoice.paid` 이벤트가 전송됩니다.",
        "operationId": "v1MarkInvoiceAsPaid",
        "parameters": [
          {
            "$ref": "#/components/parameters/V1InvoiceId"
          }
        ],
        "responses": {
          "200": {
            "description": "결제 완료로 전환된 주문",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1InvoiceResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1Unauthorized"
          },
          "403": {
            "description": "이미 결제된 주문이거나 권한이 없습니다.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1EmptyResponse"
                },
                "examples": {
                  "INVOICE_ALREADY_PAID": {
                    "value": {
                      "code": "INVOICE_ALREADY_PAID",
                      "data": null
                    }
                  },
                  "INSUFFICIENT_PERMISSIONS": {
                    "value": {
                      "code": "INSUFFICIENT_PERMISSIONS",
                      "data": null
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "주문을 찾을 수 없습니다.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1EmptyResponse"
                },
                "example": {
                  "code": "INVOICE_NOT_FOUND",
                  "data": null
                }
              }
            }
          }
        }
      }
    },
    "/v1/transactions": {
      "get": {
        "tags": [
          "v1 입금"
        ],
        "summary": "입금 내역 목록 조회",
        "description": "API 키와 연결된 계정의 입금 트랜잭션 목록을 조회합니다.",
        "operationId": "v1ListTransactions",
        "parameters": [
          {
            "$ref": "#/components/parameters/V1Offset"
          },
          {
            "$ref": "#/components/parameters/V1Limit"
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "입금 ID, 계좌 ID, 매칭된 주문 ID가 같거나, 계좌번호나 입금자명에 검색어가 들어간 입금 (대소문자 무시, 계좌번호 하이픈 무시)"
          },
          {
            "name": "bankAccountId",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "이 계좌(`bac_`)의 입금만. API 키의 계좌 범위 밖이면 INSUFFICIENT_PERMISSIONS"
          },
          {
            "name": "matched",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "주문 매칭 여부"
          },
          {
            "name": "hidden",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "대시보드 숨김 여부"
          },
          {
            "name": "dateAfter",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "이 날짜(KST, 포함) 이후에 받은 입금"
          },
          {
            "name": "dateBefore",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "이 날짜(KST, 포함) 이전에 받은 입금"
          }
        ],
        "responses": {
          "200": {
            "description": "입금 목록",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1TransactionListResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1Unauthorized"
          },
          "403": {
            "description": "limit 이 100 을 초과했습니다.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1EmptyResponse"
                },
                "example": {
                  "code": "LIMIT_EXCEEDS_MAXIMUM",
                  "data": null
                }
              }
            }
          },
          "422": {
            "description": "페이징/날짜 파라미터가 유효하지 않습니다.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1EmptyResponse"
                },
                "examples": {
                  "INVALID_OFFSET": {
                    "value": {
                      "code": "INVALID_OFFSET",
                      "data": null
                    }
                  },
                  "INVALID_LIMIT": {
                    "value": {
                      "code": "INVALID_LIMIT",
                      "data": null
                    }
                  },
                  "INVALID_DATE_RANGE_FORMAT": {
                    "value": {
                      "code": "INVALID_DATE_RANGE_FORMAT",
                      "data": null
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/transactions/{id}": {
      "get": {
        "tags": [
          "v1 입금"
        ],
        "summary": "입금 단건 조회",
        "operationId": "v1GetTransaction",
        "parameters": [
          {
            "$ref": "#/components/parameters/V1TransactionId"
          }
        ],
        "responses": {
          "200": {
            "description": "입금 정보",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1TransactionResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/V1Forbidden"
          },
          "404": {
            "description": "입금 내역을 찾을 수 없습니다.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1EmptyResponse"
                },
                "example": {
                  "code": "TRANSACTION_NOT_FOUND",
                  "data": null
                }
              }
            }
          }
        }
      }
    },
    "/v1/cash-receipts": {
      "post": {
        "tags": [
          "v1 현금영수증"
        ],
        "summary": "현금영수증 발급",
        "description": "새 현금영수증 발급을 요청합니다. 국세청 연동을 거치므로 비동기로 처리되며, 응답의 `status` 는 항상 `PENDING` 입니다.",
        "operationId": "v1IssueCashReceipt",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1IssueCashReceiptRequest"
              },
              "example": {
                "type": "PERSONAL",
                "identifier": "01012345678",
                "amount": 50000
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "발급 요청이 접수되었습니다.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CashReceiptResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1Unauthorized"
          },
          "404": {
            "description": "사업자 정보 미등록.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1EmptyResponse"
                },
                "example": {
                  "code": "BUSINESS_INFO_NOT_REGISTERED",
                  "data": null
                }
              }
            }
          },
          "422": {
            "description": "요청 값이 유효하지 않습니다.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1EmptyResponse"
                },
                "examples": {
                  "INVALID_CASH_RECEIPT_IDENTIFIER": {
                    "value": {
                      "code": "INVALID_CASH_RECEIPT_IDENTIFIER",
                      "data": null
                    }
                  },
                  "INVALID_CASH_RECEIPT_AMOUNT": {
                    "value": {
                      "code": "INVALID_CASH_RECEIPT_AMOUNT",
                      "data": null
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "국세청 연동(팝빌) API 호출 실패.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1EmptyResponse"
                },
                "example": {
                  "code": "POPBILL_API_FAILED",
                  "data": null
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "v1 현금영수증"
        ],
        "summary": "현금영수증 목록 조회",
        "description": "API 키와 연결된 계정의 현금영수증 발급 내역을 조회합니다.",
        "operationId": "v1ListCashReceipts",
        "parameters": [
          {
            "$ref": "#/components/parameters/V1Offset"
          },
          {
            "$ref": "#/components/parameters/V1Limit"
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "현금영수증 ID, 관련 주문 ID, 사업자등록번호가 같거나, 식별번호에 검색어가 들어간 현금영수증 (하이픈 무시)"
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "PENDING",
                "ISSUED",
                "FAILED",
                "REVOKED"
              ]
            },
            "description": "발급 상태"
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "PERSONAL",
                "CORPORATE"
              ]
            },
            "description": "현금영수증 종류"
          },
          {
            "name": "identifier",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "식별번호"
          },
          {
            "name": "corpNum",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "발급 사업자등록번호"
          },
          {
            "name": "dateAfter",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "이 날짜(KST, 포함) 이후 발급 요청"
          },
          {
            "name": "dateBefore",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "이 날짜(KST, 포함) 이전 발급 요청"
          }
        ],
        "responses": {
          "200": {
            "description": "현금영수증 목록",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CashReceiptListResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1Unauthorized"
          },
          "403": {
            "description": "권한 오류",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1EmptyResponse"
                },
                "example": {
                  "code": "LIMIT_EXCEEDS_MAXIMUM",
                  "data": null
                }
              }
            }
          },
          "422": {
            "description": "페이징/날짜 파라미터가 유효하지 않습니다.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1EmptyResponse"
                },
                "examples": {
                  "INVALID_OFFSET": {
                    "value": {
                      "code": "INVALID_OFFSET",
                      "data": null
                    }
                  },
                  "INVALID_LIMIT": {
                    "value": {
                      "code": "INVALID_LIMIT",
                      "data": null
                    }
                  },
                  "INVALID_DATE_RANGE_FORMAT": {
                    "value": {
                      "code": "INVALID_DATE_RANGE_FORMAT",
                      "data": null
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/cash-receipts/{id}": {
      "get": {
        "tags": [
          "v1 현금영수증"
        ],
        "summary": "현금영수증 단건 조회",
        "operationId": "v1GetCashReceipt",
        "parameters": [
          {
            "$ref": "#/components/parameters/V1CashReceiptId"
          }
        ],
        "responses": {
          "200": {
            "description": "현금영수증 정보",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CashReceiptResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/V1Forbidden"
          },
          "404": {
            "description": "현금영수증을 찾을 수 없습니다.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1EmptyResponse"
                },
                "example": {
                  "code": "CASH_RECEIPT_NOT_FOUND",
                  "data": null
                }
              }
            }
          }
        }
      }
    },
    "/v1/cash-receipts/{id}/revoke": {
      "post": {
        "tags": [
          "v1 현금영수증"
        ],
        "summary": "현금영수증 발급 취소",
        "description": "국세청 발급이 끝난(`ISSUED`) 현금영수증의 남은 금액 전체를 취소해요. v3부터 `PENDING`, `FAILED`, `REVOKED` 상태는 `CASH_RECEIPT_NOT_REVOCABLE`이에요.",
        "operationId": "v1RevokeCashReceipt",
        "parameters": [
          {
            "$ref": "#/components/parameters/V1CashReceiptId"
          }
        ],
        "responses": {
          "200": {
            "description": "취소 완료",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1EmptyResponse"
                },
                "example": {
                  "code": "OK",
                  "data": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/V1Forbidden"
          },
          "404": {
            "description": "현금영수증을 찾을 수 없습니다.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1EmptyResponse"
                },
                "example": {
                  "code": "CASH_RECEIPT_NOT_FOUND",
                  "data": null
                }
              }
            }
          },
          "409": {
            "description": "`ISSUED` 상태가 아니에요.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1EmptyResponse"
                },
                "example": {
                  "code": "CASH_RECEIPT_NOT_REVOCABLE",
                  "data": null
                }
              }
            }
          },
          "500": {
            "description": "국세청 연동(팝빌) API 호출 실패.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1EmptyResponse"
                },
                "example": {
                  "code": "POPBILL_API_FAILED",
                  "data": null
                }
              }
            }
          }
        }
      }
    }
  },
  "webhooks": {
    "invoice.created": {
      "post": {
        "summary": "주문 생성",
        "description": "v2 웹훅 `invoice.created` 이벤트예요. [문서](https://docs.paysync.kr/api-reference/webhooks/invoice-created)",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "전송 ID (`whm_`). 재시도에서는 같은 값"
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "이번 시도의 전송 시각 (Unix 초)"
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "`v1,<Base64 HMAC-SHA256>`. 서명 문자열은 `{webhook-id}.{webhook-timestamp}.{본문}`"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "2xx로 응답하면 성공으로 기록해요. 그 밖의 응답이나 10초 안에 응답이 없으면 최대 6번 다시 보내요."
          }
        }
      }
    },
    "invoice.updated": {
      "post": {
        "summary": "주문 수정",
        "description": "v2 웹훅 `invoice.updated` 이벤트예요. [문서](https://docs.paysync.kr/api-reference/webhooks/invoice-updated)",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "전송 ID (`whm_`). 재시도에서는 같은 값"
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "이번 시도의 전송 시각 (Unix 초)"
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "`v1,<Base64 HMAC-SHA256>`. 서명 문자열은 `{webhook-id}.{webhook-timestamp}.{본문}`"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "2xx로 응답하면 성공으로 기록해요. 그 밖의 응답이나 10초 안에 응답이 없으면 최대 6번 다시 보내요."
          }
        }
      }
    },
    "invoice.paid": {
      "post": {
        "summary": "주문 결제 완료",
        "description": "v2 웹훅 `invoice.paid` 이벤트예요. [문서](https://docs.paysync.kr/api-reference/webhooks/invoice-paid)",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "전송 ID (`whm_`). 재시도에서는 같은 값"
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "이번 시도의 전송 시각 (Unix 초)"
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "`v1,<Base64 HMAC-SHA256>`. 서명 문자열은 `{webhook-id}.{webhook-timestamp}.{본문}`"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "2xx로 응답하면 성공으로 기록해요. 그 밖의 응답이나 10초 안에 응답이 없으면 최대 6번 다시 보내요."
          }
        }
      }
    },
    "invoice.expired": {
      "post": {
        "summary": "주문 만료",
        "description": "v2 웹훅 `invoice.expired` 이벤트예요. [문서](https://docs.paysync.kr/api-reference/webhooks/invoice-expired)",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "전송 ID (`whm_`). 재시도에서는 같은 값"
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "이번 시도의 전송 시각 (Unix 초)"
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "`v1,<Base64 HMAC-SHA256>`. 서명 문자열은 `{webhook-id}.{webhook-timestamp}.{본문}`"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "2xx로 응답하면 성공으로 기록해요. 그 밖의 응답이나 10초 안에 응답이 없으면 최대 6번 다시 보내요."
          }
        }
      }
    },
    "invoice.canceled": {
      "post": {
        "summary": "주문 취소",
        "description": "v2 웹훅 `invoice.canceled` 이벤트예요. [문서](https://docs.paysync.kr/api-reference/webhooks/invoice-canceled)",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "전송 ID (`whm_`). 재시도에서는 같은 값"
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "이번 시도의 전송 시각 (Unix 초)"
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "`v1,<Base64 HMAC-SHA256>`. 서명 문자열은 `{webhook-id}.{webhook-timestamp}.{본문}`"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "2xx로 응답하면 성공으로 기록해요. 그 밖의 응답이나 10초 안에 응답이 없으면 최대 6번 다시 보내요."
          }
        }
      }
    },
    "invoice.reopened": {
      "post": {
        "summary": "주문 다시 열림",
        "description": "v2 웹훅 `invoice.reopened` 이벤트예요. [문서](https://docs.paysync.kr/api-reference/webhooks/invoice-reopened)",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "전송 ID (`whm_`). 재시도에서는 같은 값"
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "이번 시도의 전송 시각 (Unix 초)"
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "`v1,<Base64 HMAC-SHA256>`. 서명 문자열은 `{webhook-id}.{webhook-timestamp}.{본문}`"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "2xx로 응답하면 성공으로 기록해요. 그 밖의 응답이나 10초 안에 응답이 없으면 최대 6번 다시 보내요."
          }
        }
      }
    },
    "transaction.created": {
      "post": {
        "summary": "새 입금",
        "description": "v2 웹훅 `transaction.created` 이벤트예요. [문서](https://docs.paysync.kr/api-reference/webhooks/transaction-created)",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "전송 ID (`whm_`). 재시도에서는 같은 값"
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "이번 시도의 전송 시각 (Unix 초)"
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "`v1,<Base64 HMAC-SHA256>`. 서명 문자열은 `{webhook-id}.{webhook-timestamp}.{본문}`"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransactionWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "2xx로 응답하면 성공으로 기록해요. 그 밖의 응답이나 10초 안에 응답이 없으면 최대 6번 다시 보내요."
          }
        }
      }
    },
    "v1 invoice.paid": {
      "post": {
        "summary": "주문 결제 완료",
        "description": "주문이 결제 완료 상태로 전환되면 등록된 웹훅 엔드포인트로 호출됩니다. 입금 자동 매칭 또는 수동 결제 처리(`POST /v1/invoices/{id}/mark-as-paid`) 모두에서 발생합니다.\n\n페이로드는 [Standard Webhooks](https://www.standardwebhooks.com/) 명세를 따르며, `webhook-id` / `webhook-timestamp` / `webhook-signature` 헤더를 검증해야 합니다.",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "전송 건의 고유 ID (`whm_` 접두사). 멱등 처리에 활용하세요."
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "전송 시각 (Unix 초). 5분 이상 차이나면 거부 권장."
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "`v1,<base64>` 형식의 HMAC-SHA256 서명. 서명 대상은 `${webhook-id}.${webhook-timestamp}.${body}`."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1InvoicePaidEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "수신 성공. 페이싱크는 **HTTP 200** 응답만 성공으로 처리합니다. 그 외(2xx 포함)는 실패로 기록됩니다."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "대시보드에서 만든 API 키(`sk_live_...`)를 `Authorization: Bearer <API 키>`로 보내요. API 키는 워크스페이스 하나에 속하고, 읽기·쓰기 또는 읽기 전용 권한과 계좌 범위를 가져요. 파트너 서비스가 OAuth 2.0으로 받은 연결된 앱의 액세스 토큰(`oat_...`)도 같은 방식으로 `/v2` 경로에 보내요. 이 토큰은 고객이 허용한 스코프의 API만 호출할 수 있고 `/v1` 경로에는 쓸 수 없어요. 문서: https://docs.paysync.kr/partners"
      },
      "oauthClientBasic": {
        "type": "http",
        "scheme": "basic",
        "description": "파트너 앱의 클라이언트 자격 증명이에요. `Authorization: Basic <base64(client_id:client_secret)>`로 보내거나, 본문에 `client_id`와 `client_secret`을 넣어요. 토큰 발급과 토큰 폐기에만 써요."
      }
    },
    "parameters": {
      "V1Offset": {
        "name": "offset",
        "in": "query",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 0
        },
        "description": "건너뛸 아이템 수"
      },
      "V1Limit": {
        "name": "limit",
        "in": "query",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        "description": "한 번에 조회할 아이템 수 (최대 100)"
      },
      "V1InvoiceId": {
        "name": "id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        },
        "description": "주문 ID (`ivc_` 접두사)"
      },
      "V1TransactionId": {
        "name": "id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        },
        "description": "트랜잭션 ID (`trx_` 접두사)"
      },
      "V1CashReceiptId": {
        "name": "id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        },
        "description": "현금영수증 ID (`crt_` 접두사)"
      }
    },
    "responses": {
      "V1Unauthorized": {
        "description": "API 키가 없거나 유효하지 않습니다.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/V1EmptyResponse"
            },
            "example": {
              "code": "NOT_AUTHORIZED",
              "data": null
            }
          }
        }
      },
      "V1Forbidden": {
        "description": "리소스에 접근할 권한이 없습니다.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/V1EmptyResponse"
            },
            "example": {
              "code": "INSUFFICIENT_PERMISSIONS",
              "data": null
            }
          }
        }
      }
    },
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "숫자 오류 코드. [에러 코드](https://docs.paysync.kr/api-reference/error-codes) 참고",
            "example": "220003"
          },
          "data": {
            "description": "오류에 따라 붙는 추가 정보",
            "nullable": true
          }
        }
      },
      "OkResponse": {
        "type": "object",
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "성공 코드",
            "enum": [
              "10001"
            ]
          }
        }
      },
      "Actor": {
        "type": "object",
        "required": [
          "type",
          "accountId",
          "apiKeyId",
          "name"
        ],
        "properties": {
          "type": {
            "type": "string",
            "description": "주체 종류",
            "enum": [
              "MEMBER",
              "API_KEY",
              "CONNECTED_APP",
              "SYSTEM"
            ]
          },
          "accountId": {
            "type": "string",
            "description": "멤버 계정 ID",
            "nullable": true
          },
          "apiKeyId": {
            "type": "string",
            "description": "API 키 ID (`apk_`)",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "멤버 이름, API 키 이름, 연결된 앱 이름",
            "nullable": true
          }
        }
      },
      "InvoiceCustomer": {
        "type": "object",
        "required": [
          "name",
          "email",
          "phoneNumber"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "입금자명",
            "example": "홍길동"
          },
          "email": {
            "type": "string",
            "description": "구매자 이메일",
            "nullable": true
          },
          "phoneNumber": {
            "type": "string",
            "description": "구매자 전화번호 (숫자만)",
            "nullable": true
          }
        }
      },
      "InvoiceCashReceipt": {
        "type": "object",
        "required": [
          "type",
          "identifier"
        ],
        "properties": {
          "type": {
            "type": "string",
            "description": "현금영수증 종류",
            "enum": [
              "PERSONAL",
              "CORPORATE"
            ]
          },
          "identifier": {
            "type": "string",
            "description": "휴대폰 번호, 현금영수증 카드 번호(10~18자리) 또는 사업자등록번호(10자리)"
          }
        }
      },
      "Invoice": {
        "type": "object",
        "required": [
          "id",
          "number",
          "status",
          "customer",
          "amount",
          "paidAmount",
          "amountDiff",
          "bankAccountIds",
          "cashReceipt",
          "metadata",
          "source",
          "createdBy",
          "shopOrder",
          "guideUrl",
          "guideEmailSentAt",
          "createdAt",
          "updatedAt",
          "expiresAt",
          "paidAt",
          "paidTrigger",
          "paidBy",
          "matchedTransactionId",
          "canceledAt",
          "cancelReason",
          "canceledBy",
          "expiredAt",
          "reopenedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "주문 ID (`ivc_` 접두사)",
            "example": "ivc_a1b2c3d4e5f6g7h8i9j0k1l2"
          },
          "number": {
            "type": "integer",
            "format": "int64",
            "description": "워크스페이스 안의 주문번호. 1001부터 매겨요.",
            "example": 1043
          },
          "status": {
            "type": "string",
            "description": "주문 상태",
            "enum": [
              "PENDING",
              "PAID",
              "EXPIRED",
              "CANCELED"
            ]
          },
          "customer": {
            "$ref": "#/components/schemas/InvoiceCustomer"
          },
          "amount": {
            "type": "integer",
            "format": "int64",
            "description": "주문 금액 (원)",
            "example": 50000
          },
          "paidAmount": {
            "type": "integer",
            "format": "int64",
            "description": "실제로 받은 금액. 결제 완료 전에는 null",
            "nullable": true
          },
          "amountDiff": {
            "type": "integer",
            "format": "int64",
            "description": "paidAmount - amount. 같으면 null",
            "nullable": true
          },
          "bankAccountIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "입금받을 계좌 ID 목록. 빈 배열이면 모든 계좌"
          },
          "cashReceipt": {
            "$ref": "#/components/schemas/InvoiceCashReceipt",
            "nullable": true
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "주문에 저장한 키와 값. 없으면 빈 객체"
          },
          "source": {
            "type": "string",
            "description": "주문을 만든 곳",
            "enum": [
              "DASHBOARD",
              "API",
              "CSV",
              "CAFE24",
              "SIXSHOP",
              "GODOMALL"
            ]
          },
          "createdBy": {
            "$ref": "#/components/schemas/Actor"
          },
          "shopOrder": {
            "type": "object",
            "description": "쇼핑몰 주문으로 만든 주문의 쇼핑몰 주문 정보",
            "required": [
              "platform",
              "storeId",
              "shopNo",
              "orderId"
            ],
            "properties": {
              "platform": {
                "type": "string",
                "description": "쇼핑몰 플랫폼",
                "enum": [
                  "CAFE24",
                  "SIXSHOP",
                  "GODOMALL"
                ]
              },
              "storeId": {
                "type": "string",
                "description": "쇼핑몰 아이디. 카페24는 쇼핑몰 아이디, 식스샵은 스토어 아이디"
              },
              "shopNo": {
                "type": "integer",
                "format": "int32",
                "nullable": true,
                "description": "멀티쇼핑몰 번호. 카페24 기본 쇼핑몰은 1, 식스샵은 null"
              },
              "orderId": {
                "type": "string",
                "description": "쇼핑몰 주문번호"
              }
            },
            "nullable": true
          },
          "guideUrl": {
            "type": "string",
            "description": "구매자용 입금 안내 페이지 주소",
            "format": "uri"
          },
          "guideEmailSentAt": {
            "type": "integer",
            "format": "int64",
            "description": "입금 안내 메일을 마지막으로 보낸 시각 (Unix 초)",
            "nullable": true
          },
          "createdAt": {
            "type": "integer",
            "format": "int64",
            "description": "만든 시각 (Unix 초)"
          },
          "updatedAt": {
            "type": "integer",
            "format": "int64",
            "description": "마지막으로 바뀐 시각 (Unix 초)",
            "nullable": true
          },
          "expiresAt": {
            "type": "integer",
            "format": "int64",
            "description": "입금 기한 (Unix 초)",
            "nullable": true
          },
          "paidAt": {
            "type": "integer",
            "format": "int64",
            "description": "결제 완료 시각 (Unix 초)",
            "nullable": true
          },
          "paidTrigger": {
            "type": "string",
            "description": "결제 완료 경로",
            "enum": [
              "AUTOMATIC_MATCHING",
              "MANUAL_MATCHING",
              "MANUAL_APPROVE",
              "API_CALL"
            ],
            "nullable": true
          },
          "paidBy": {
            "$ref": "#/components/schemas/Actor",
            "nullable": true
          },
          "matchedTransactionId": {
            "type": "string",
            "description": "매칭된 입금 ID",
            "nullable": true
          },
          "canceledAt": {
            "type": "integer",
            "format": "int64",
            "description": "취소 시각 (Unix 초)",
            "nullable": true
          },
          "cancelReason": {
            "type": "string",
            "description": "취소 사유",
            "nullable": true
          },
          "canceledBy": {
            "$ref": "#/components/schemas/Actor",
            "nullable": true
          },
          "expiredAt": {
            "type": "integer",
            "format": "int64",
            "description": "만료 처리 시각 (Unix 초)",
            "nullable": true
          },
          "reopenedAt": {
            "type": "integer",
            "format": "int64",
            "description": "매칭 해제로 다시 열린 시각 (Unix 초)",
            "nullable": true
          }
        }
      },
      "InvoiceHistoryEntry": {
        "type": "object",
        "required": [
          "type",
          "at",
          "actor",
          "detail",
          "changes"
        ],
        "properties": {
          "type": {
            "type": "string",
            "description": "이력 종류",
            "enum": [
              "CREATED",
              "GUIDE_EMAIL_SENT",
              "GUIDE_RESENT",
              "UPDATED",
              "PAID",
              "EXPIRED",
              "CANCELED",
              "REOPENED"
            ]
          },
          "at": {
            "type": "integer",
            "format": "int64",
            "description": "일어난 시각 (Unix 초)"
          },
          "actor": {
            "$ref": "#/components/schemas/Actor",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "description": "추가 설명",
            "nullable": true
          },
          "changes": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "before",
                "after"
              ],
              "properties": {
                "field": {
                  "type": "string",
                  "description": "필드"
                },
                "before": {
                  "type": "string",
                  "description": "이전 값",
                  "nullable": true
                },
                "after": {
                  "type": "string",
                  "description": "바뀐 값",
                  "nullable": true
                }
              }
            },
            "description": "UPDATED에서 바뀐 필드"
          }
        }
      },
      "InvoiceDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Invoice"
          },
          {
            "type": "object",
            "required": [
              "history"
            ],
            "properties": {
              "history": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/InvoiceHistoryEntry"
                },
                "description": "처리 이력"
              }
            }
          }
        ]
      },
      "CreateInvoiceRequest": {
        "type": "object",
        "required": [
          "customer",
          "amount"
        ],
        "properties": {
          "customer": {
            "type": "object",
            "required": [
              "name"
            ],
            "properties": {
              "name": {
                "type": "string",
                "description": "입금자명. 1~16자, 공백 없이",
                "minLength": 1,
                "maxLength": 16
              },
              "email": {
                "type": "string",
                "description": "구매자 이메일. 5~255자"
              },
              "phoneNumber": {
                "type": "string",
                "description": "구매자 전화번호. 숫자 10~11자리 (하이픈 허용)"
              }
            }
          },
          "amount": {
            "type": "integer",
            "format": "int64",
            "description": "금액 (원). 0보다 커야 해요.",
            "minimum": 1
          },
          "bankAccountIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "입금받을 계좌 ID. 빼거나 빈 배열이면 모든 계좌"
          },
          "expiresAt": {
            "type": "integer",
            "format": "int64",
            "description": "입금 기한. 지금보다 뒤이고 365일 안 (Unix 초)"
          },
          "expireAfterDays": {
            "type": "integer",
            "format": "int64",
            "description": "지금부터 며칠 뒤 만료할지. 1~365. expiresAt과 함께 보낼 수 없어요.",
            "minimum": 1,
            "maximum": 365
          },
          "cashReceipt": {
            "$ref": "#/components/schemas/InvoiceCashReceipt"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "최대 5쌍, 키 1~64자, 값 1024자"
          },
          "sendGuideEmail": {
            "type": "boolean",
            "description": "입금 안내 메일 발송 여부. 빼면 자동화 설정을 따라요."
          }
        }
      },
      "UpdateInvoiceRequest": {
        "type": "object",
        "required": [],
        "properties": {
          "customer": {
            "type": "object",
            "required": [],
            "properties": {
              "name": {
                "type": "string",
                "description": "입금자명"
              },
              "email": {
                "type": "string",
                "description": "구매자 이메일. null이면 지워요.",
                "nullable": true
              },
              "phoneNumber": {
                "type": "string",
                "description": "구매자 전화번호. null이면 지워요.",
                "nullable": true
              }
            }
          },
          "amount": {
            "type": "integer",
            "format": "int64",
            "description": "금액 (원)",
            "minimum": 1
          },
          "expiresAt": {
            "type": "integer",
            "format": "int64",
            "description": "새 입금 기한. null이면 기한을 없애요. (Unix 초)",
            "nullable": true
          },
          "extendDays": {
            "type": "integer",
            "format": "int64",
            "description": "입금 기한을 늘릴 일수. 1~365",
            "minimum": 1,
            "maximum": 365
          },
          "bankAccountIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "입금받을 계좌 ID"
          },
          "cashReceipt": {
            "$ref": "#/components/schemas/InvoiceCashReceipt",
            "nullable": true
          },
          "resendGuideEmail": {
            "type": "boolean",
            "description": "금액이나 입금 기한이 바뀌면 입금 안내 메일을 다시 보내요. 기본값 false"
          }
        }
      },
      "CancelInvoiceRequest": {
        "type": "object",
        "required": [],
        "properties": {
          "reason": {
            "type": "string",
            "description": "취소 사유. 200자까지",
            "maxLength": 200
          }
        }
      },
      "DuplicateInvoice": {
        "type": "object",
        "required": [
          "invoiceId",
          "number"
        ],
        "properties": {
          "invoiceId": {
            "type": "string",
            "description": "겹친 결제 대기 주문 ID"
          },
          "number": {
            "type": "integer",
            "format": "int64",
            "description": "겹친 주문의 주문번호"
          }
        }
      },
      "TransactionBankAccount": {
        "type": "object",
        "required": [
          "id",
          "alias",
          "provider",
          "type",
          "number"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "계좌 ID (`bac_`)"
          },
          "alias": {
            "type": "string",
            "description": "계좌 별칭"
          },
          "provider": {
            "type": "string",
            "description": "은행",
            "enum": [
              "KB_KOOKMIN_BANK",
              "NH_NONGHYUP_BANK",
              "KEB_HANA_BANK",
              "INDUSTRIAL_BANK_OF_KOREA",
              "SHINHAN_BANK"
            ]
          },
          "type": {
            "type": "string",
            "description": "계좌 유형",
            "enum": [
              "PERSONAL",
              "CORPORATE"
            ]
          },
          "number": {
            "type": "string",
            "description": "하이픈을 넣은 계좌번호"
          }
        }
      },
      "TransactionMatch": {
        "type": "object",
        "required": [
          "invoiceId",
          "invoiceNumber",
          "method",
          "automatic",
          "matchedAt",
          "matchedBy",
          "amountDiff"
        ],
        "properties": {
          "invoiceId": {
            "type": "string",
            "description": "매칭된 주문 ID"
          },
          "invoiceNumber": {
            "type": "integer",
            "format": "int64",
            "description": "매칭된 주문번호"
          },
          "method": {
            "type": "string",
            "description": "매칭 방식",
            "enum": [
              "EXACT",
              "BRACKET_REMOVAL",
              "NAME_PREFIX",
              "CASE_INSENSITIVE",
              "NORMALIZED",
              "AMOUNT_TOLERANCE",
              "MANUAL"
            ]
          },
          "automatic": {
            "type": "boolean",
            "description": "자동 매칭 여부"
          },
          "matchedAt": {
            "type": "integer",
            "format": "int64",
            "description": "매칭 시각 (Unix 초)"
          },
          "matchedBy": {
            "$ref": "#/components/schemas/Actor"
          },
          "amountDiff": {
            "type": "integer",
            "format": "int64",
            "description": "입금액 - 주문 금액. 같으면 null",
            "nullable": true
          }
        }
      },
      "TransactionUnmatch": {
        "type": "object",
        "required": [
          "invoiceId",
          "invoiceNumber",
          "method",
          "reason",
          "note",
          "unmatchedAt",
          "unmatchedBy"
        ],
        "properties": {
          "invoiceId": {
            "type": "string",
            "description": "해제한 주문 ID"
          },
          "invoiceNumber": {
            "type": "integer",
            "format": "int64",
            "description": "해제한 주문번호"
          },
          "method": {
            "type": "string",
            "description": "해제 전 매칭 방식",
            "enum": [
              "EXACT",
              "BRACKET_REMOVAL",
              "NAME_PREFIX",
              "CASE_INSENSITIVE",
              "NORMALIZED",
              "AMOUNT_TOLERANCE",
              "MANUAL"
            ]
          },
          "reason": {
            "type": "string",
            "description": "해제 사유",
            "enum": [
              "WRONG_MATCH",
              "BUYER_REFUND",
              "OTHER"
            ]
          },
          "note": {
            "type": "string",
            "description": "메모",
            "nullable": true
          },
          "unmatchedAt": {
            "type": "integer",
            "format": "int64",
            "description": "해제 시각 (Unix 초)"
          },
          "unmatchedBy": {
            "$ref": "#/components/schemas/Actor"
          }
        }
      },
      "Transaction": {
        "type": "object",
        "required": [
          "id",
          "bankAccount",
          "depositorName",
          "amount",
          "receivedAt",
          "status",
          "match",
          "failureReason",
          "candidateCount",
          "hidden",
          "hiddenAt",
          "unmatches",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "입금 ID (`trx_` 접두사)",
            "example": "trx_m1n2o3p4q5r6s7t8u9v0w1x2"
          },
          "bankAccount": {
            "$ref": "#/components/schemas/TransactionBankAccount"
          },
          "depositorName": {
            "type": "string",
            "description": "은행 알림의 입금자명"
          },
          "amount": {
            "type": "integer",
            "format": "int64",
            "description": "입금 금액 (원)"
          },
          "receivedAt": {
            "type": "integer",
            "format": "int64",
            "description": "은행 알림 기준 입금 시각 (Unix 초)"
          },
          "status": {
            "type": "string",
            "description": "입금 상태",
            "enum": [
              "MATCHED",
              "UNMATCHED",
              "HIDDEN"
            ]
          },
          "match": {
            "$ref": "#/components/schemas/TransactionMatch",
            "nullable": true
          },
          "failureReason": {
            "type": "string",
            "description": "자동 매칭 실패 사유",
            "enum": [
              "NO_CANDIDATE",
              "MULTIPLE_EXACT",
              "MULTIPLE_RULE",
              "ONLY_EXPIRED",
              "ONLY_CANCELED",
              "AMOUNT_MISMATCH"
            ],
            "nullable": true
          },
          "candidateCount": {
            "type": "integer",
            "format": "int64",
            "description": "매칭 실패 때 후보 주문 수",
            "nullable": true
          },
          "hidden": {
            "type": "boolean",
            "description": "대시보드에서 숨겼는지 여부"
          },
          "hiddenAt": {
            "type": "integer",
            "format": "int64",
            "description": "숨긴 시각 (Unix 초)",
            "nullable": true
          },
          "unmatches": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TransactionUnmatch"
            },
            "description": "매칭 해제 기록"
          },
          "createdAt": {
            "type": "integer",
            "format": "int64",
            "description": "페이싱크가 기록한 시각 (Unix 초)"
          }
        }
      },
      "CashReceiptFailure": {
        "type": "object",
        "required": [
          "stage",
          "code",
          "message",
          "action"
        ],
        "properties": {
          "stage": {
            "type": "string",
            "description": "실패 단계",
            "enum": [
              "REQUEST",
              "NTS"
            ]
          },
          "code": {
            "type": "string",
            "description": "팝빌 오류 코드나 국세청 결과 코드"
          },
          "message": {
            "type": "string",
            "description": "실패 사유"
          },
          "action": {
            "type": "string",
            "description": "해결 방법",
            "enum": [
              "FIX_IDENTIFIER",
              "CHECK_BUSINESS_INFO",
              "CONTACT_SUPPORT"
            ]
          }
        }
      },
      "CashReceipt": {
        "type": "object",
        "required": [
          "id",
          "kind",
          "status",
          "type",
          "identifier",
          "selfIssued",
          "customerName",
          "amount",
          "supplyCost",
          "tax",
          "serviceFee",
          "taxation",
          "itemName",
          "method",
          "invoiceId",
          "invoiceNumber",
          "ntsConfirmNum",
          "tradeDate",
          "failure",
          "ntsSentAt",
          "ntsResultAt",
          "ntsResultCode",
          "originalId",
          "cancellationIds",
          "canceledAmount",
          "remainingAmount",
          "partial",
          "reissuedFromId",
          "reissuedToId",
          "cancelReason",
          "issuedBy",
          "createdAt",
          "updatedAt",
          "canceledAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "현금영수증 ID (`crt_` 접두사)",
            "example": "crt_a1b2c3d4e5f6g7h8i9j0k1l2"
          },
          "kind": {
            "type": "string",
            "description": "발급 또는 취소 영수증",
            "enum": [
              "ORIGINAL",
              "CANCELLATION"
            ]
          },
          "status": {
            "type": "string",
            "description": "발급 상태",
            "enum": [
              "PENDING",
              "ISSUED",
              "FAILED",
              "CANCELED"
            ]
          },
          "type": {
            "type": "string",
            "description": "용도",
            "enum": [
              "PERSONAL",
              "CORPORATE"
            ]
          },
          "identifier": {
            "type": "string",
            "description": "식별번호"
          },
          "selfIssued": {
            "type": "boolean",
            "description": "자진발급 여부"
          },
          "customerName": {
            "type": "string",
            "description": "구매자 이름",
            "nullable": true
          },
          "amount": {
            "type": "integer",
            "format": "int64",
            "description": "거래 금액 (부가세 포함)"
          },
          "supplyCost": {
            "type": "integer",
            "format": "int64",
            "description": "공급가액"
          },
          "tax": {
            "type": "integer",
            "format": "int64",
            "description": "부가세"
          },
          "serviceFee": {
            "type": "integer",
            "format": "int64",
            "description": "봉사료. 항상 0"
          },
          "taxation": {
            "type": "string",
            "description": "과세 유형",
            "enum": [
              "TAXABLE",
              "TAX_FREE"
            ]
          },
          "itemName": {
            "type": "string",
            "description": "품목명",
            "nullable": true
          },
          "method": {
            "type": "string",
            "description": "발급 방식",
            "enum": [
              "AUTO",
              "MANUAL"
            ]
          },
          "invoiceId": {
            "type": "string",
            "description": "연결된 주문 ID",
            "nullable": true
          },
          "invoiceNumber": {
            "type": "integer",
            "format": "int64",
            "description": "연결된 주문번호",
            "nullable": true
          },
          "ntsConfirmNum": {
            "type": "string",
            "description": "국세청 승인번호",
            "nullable": true
          },
          "tradeDate": {
            "type": "string",
            "description": "거래일자 (YYYYMMDD)",
            "nullable": true
          },
          "failure": {
            "$ref": "#/components/schemas/CashReceiptFailure",
            "nullable": true
          },
          "ntsSentAt": {
            "type": "integer",
            "format": "int64",
            "description": "국세청 전송 시각 (Unix 초)",
            "nullable": true
          },
          "ntsResultAt": {
            "type": "integer",
            "format": "int64",
            "description": "국세청 결과 수신 시각 (Unix 초)",
            "nullable": true
          },
          "ntsResultCode": {
            "type": "string",
            "description": "국세청 결과 코드",
            "nullable": true
          },
          "originalId": {
            "type": "string",
            "description": "취소 영수증의 원본 ID",
            "nullable": true
          },
          "cancellationIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "원본을 취소한 취소 영수증 ID"
          },
          "canceledAmount": {
            "type": "integer",
            "format": "int64",
            "description": "취소한 금액"
          },
          "remainingAmount": {
            "type": "integer",
            "format": "int64",
            "description": "더 취소할 수 있는 금액"
          },
          "partial": {
            "type": "boolean",
            "description": "부분 취소 영수증 여부"
          },
          "reissuedFromId": {
            "type": "string",
            "description": "재발급 전 원본 ID",
            "nullable": true
          },
          "reissuedToId": {
            "type": "string",
            "description": "재발급으로 만든 현금영수증 ID",
            "nullable": true
          },
          "cancelReason": {
            "type": "string",
            "description": "취소 사유",
            "nullable": true
          },
          "issuedBy": {
            "$ref": "#/components/schemas/Actor"
          },
          "createdAt": {
            "type": "integer",
            "format": "int64",
            "description": "발급 요청 시각 (Unix 초)"
          },
          "updatedAt": {
            "type": "integer",
            "format": "int64",
            "description": "마지막으로 바뀐 시각 (Unix 초)",
            "nullable": true
          },
          "canceledAt": {
            "type": "integer",
            "format": "int64",
            "description": "전액 취소 시각 (Unix 초)",
            "nullable": true
          }
        }
      },
      "IssueCashReceiptRequest": {
        "type": "object",
        "required": [
          "type",
          "amount"
        ],
        "properties": {
          "type": {
            "type": "string",
            "description": "용도",
            "enum": [
              "PERSONAL",
              "CORPORATE"
            ]
          },
          "identifier": {
            "type": "string",
            "description": "식별번호. selfIssued가 아니면 필수"
          },
          "selfIssued": {
            "type": "boolean",
            "description": "자진발급 여부. 기본값 false"
          },
          "amount": {
            "type": "integer",
            "format": "int64",
            "description": "거래 금액 (부가세 포함). 1~999,999,999",
            "minimum": 1,
            "maximum": 999999999
          },
          "customerName": {
            "type": "string",
            "description": "구매자 이름. 40자까지",
            "maxLength": 40
          },
          "invoiceId": {
            "type": "string",
            "description": "연결할 주문 ID"
          }
        }
      },
      "ReissueCashReceiptRequest": {
        "type": "object",
        "required": [],
        "properties": {
          "identifier": {
            "type": "string",
            "description": "새 식별번호. selfIssued가 아니면 필수"
          },
          "type": {
            "type": "string",
            "description": "새 용도. 빼면 원본 용도",
            "enum": [
              "PERSONAL",
              "CORPORATE"
            ]
          },
          "selfIssued": {
            "type": "boolean",
            "description": "자진발급으로 다시 발급"
          }
        }
      },
      "CancelCashReceiptRequest": {
        "type": "object",
        "required": [
          "reason"
        ],
        "properties": {
          "amount": {
            "type": "integer",
            "format": "int64",
            "description": "취소 금액. 빼면 남은 금액 전체",
            "minimum": 1
          },
          "reason": {
            "type": "string",
            "description": "취소 사유. 1~100자",
            "minLength": 1,
            "maxLength": 100
          }
        }
      },
      "CashReceiptUrls": {
        "type": "object",
        "required": [
          "view",
          "print",
          "pdf"
        ],
        "properties": {
          "view": {
            "type": "string",
            "description": "화면 주소"
          },
          "print": {
            "type": "string",
            "description": "인쇄 주소"
          },
          "pdf": {
            "type": "string",
            "description": "PDF 주소"
          }
        }
      },
      "SendCashReceiptEmailRequest": {
        "type": "object",
        "required": [
          "email"
        ],
        "properties": {
          "email": {
            "type": "string",
            "description": "받을 이메일 주소. 100자까지",
            "maxLength": 100
          }
        }
      },
      "WebhookInvoice": {
        "type": "object",
        "required": [
          "id",
          "number",
          "status",
          "customer",
          "amount",
          "paidAmount",
          "amountDiff",
          "bankAccountIds",
          "cashReceipt",
          "metadata",
          "source",
          "createdAt",
          "updatedAt",
          "expiresAt",
          "paidAt",
          "paidTrigger",
          "matchedTransactionId",
          "canceledAt",
          "cancelReason",
          "expiredAt",
          "reopenedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "주문 ID (`ivc_` 접두사)",
            "example": "ivc_a1b2c3d4e5f6g7h8i9j0k1l2"
          },
          "number": {
            "type": "integer",
            "format": "int64",
            "description": "워크스페이스 안의 주문번호. 1001부터 매겨요.",
            "example": 1043
          },
          "status": {
            "type": "string",
            "description": "주문 상태",
            "enum": [
              "PENDING",
              "PAID",
              "EXPIRED",
              "CANCELED"
            ]
          },
          "customer": {
            "$ref": "#/components/schemas/InvoiceCustomer"
          },
          "amount": {
            "type": "integer",
            "format": "int64",
            "description": "주문 금액 (원)",
            "example": 50000
          },
          "paidAmount": {
            "type": "integer",
            "format": "int64",
            "description": "실제로 받은 금액. 결제 완료 전에는 null",
            "nullable": true
          },
          "amountDiff": {
            "type": "integer",
            "format": "int64",
            "description": "paidAmount - amount. 같으면 null",
            "nullable": true
          },
          "bankAccountIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "입금받을 계좌 ID 목록. 빈 배열이면 모든 계좌"
          },
          "cashReceipt": {
            "$ref": "#/components/schemas/InvoiceCashReceipt",
            "nullable": true
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "주문에 저장한 키와 값. 없으면 빈 객체"
          },
          "source": {
            "type": "string",
            "description": "주문을 만든 곳",
            "enum": [
              "DASHBOARD",
              "API",
              "CSV",
              "CAFE24",
              "SIXSHOP",
              "GODOMALL"
            ]
          },
          "createdAt": {
            "type": "string",
            "description": "만든 시각",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "description": "마지막으로 바뀐 시각",
            "format": "date-time",
            "nullable": true
          },
          "expiresAt": {
            "type": "string",
            "description": "입금 기한",
            "format": "date-time",
            "nullable": true
          },
          "paidAt": {
            "type": "string",
            "description": "결제 완료 시각",
            "format": "date-time",
            "nullable": true
          },
          "paidTrigger": {
            "type": "string",
            "description": "결제 완료 경로",
            "enum": [
              "AUTOMATIC_MATCHING",
              "MANUAL_MATCHING",
              "MANUAL_APPROVE",
              "API_CALL"
            ],
            "nullable": true
          },
          "matchedTransactionId": {
            "type": "string",
            "description": "매칭된 입금 ID",
            "nullable": true
          },
          "canceledAt": {
            "type": "string",
            "description": "취소 시각",
            "format": "date-time",
            "nullable": true
          },
          "cancelReason": {
            "type": "string",
            "description": "취소 사유",
            "nullable": true
          },
          "expiredAt": {
            "type": "string",
            "description": "만료 처리 시각",
            "format": "date-time",
            "nullable": true
          },
          "reopenedAt": {
            "type": "string",
            "description": "매칭 해제로 다시 열린 시각",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "WebhookTransaction": {
        "type": "object",
        "required": [
          "id",
          "bankAccount",
          "depositorName",
          "amount",
          "status",
          "matchedInvoiceId",
          "matchedInvoiceNumber",
          "receivedAt",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "입금 ID"
          },
          "bankAccount": {
            "$ref": "#/components/schemas/TransactionBankAccount"
          },
          "depositorName": {
            "type": "string",
            "description": "입금자명"
          },
          "amount": {
            "type": "integer",
            "format": "int64",
            "description": "입금 금액"
          },
          "status": {
            "type": "string",
            "description": "보낼 때의 입금 상태",
            "enum": [
              "MATCHED",
              "UNMATCHED",
              "HIDDEN"
            ]
          },
          "matchedInvoiceId": {
            "type": "string",
            "description": "매칭된 주문 ID",
            "nullable": true
          },
          "matchedInvoiceNumber": {
            "type": "integer",
            "format": "int64",
            "description": "매칭된 주문번호",
            "nullable": true
          },
          "receivedAt": {
            "type": "string",
            "description": "입금 시각",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "description": "기록 시각",
            "format": "date-time"
          }
        }
      },
      "InvoiceResponse": {
        "type": "object",
        "required": [
          "code",
          "data"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "성공 코드",
            "enum": [
              "10001"
            ]
          },
          "data": {
            "$ref": "#/components/schemas/Invoice"
          }
        }
      },
      "InvoiceDetailResponse": {
        "type": "object",
        "required": [
          "code",
          "data"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "성공 코드",
            "enum": [
              "10001"
            ]
          },
          "data": {
            "$ref": "#/components/schemas/InvoiceDetail"
          }
        }
      },
      "TransactionResponse": {
        "type": "object",
        "required": [
          "code",
          "data"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "성공 코드",
            "enum": [
              "10001"
            ]
          },
          "data": {
            "$ref": "#/components/schemas/Transaction"
          }
        }
      },
      "CashReceiptResponse": {
        "type": "object",
        "required": [
          "code",
          "data"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "성공 코드",
            "enum": [
              "10001"
            ]
          },
          "data": {
            "$ref": "#/components/schemas/CashReceipt"
          }
        }
      },
      "CashReceiptUrlsResponse": {
        "type": "object",
        "required": [
          "code",
          "data"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "성공 코드",
            "enum": [
              "10001"
            ]
          },
          "data": {
            "$ref": "#/components/schemas/CashReceiptUrls"
          }
        }
      },
      "InvoiceListResponse": {
        "type": "object",
        "required": [
          "code",
          "items",
          "totalItems"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "성공 코드",
            "enum": [
              "10001"
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Invoice"
            }
          },
          "totalItems": {
            "type": "integer",
            "format": "int64",
            "description": "조건에 맞는 전체 항목 수"
          }
        }
      },
      "TransactionListResponse": {
        "type": "object",
        "required": [
          "code",
          "items",
          "totalItems"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "성공 코드",
            "enum": [
              "10001"
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Transaction"
            }
          },
          "totalItems": {
            "type": "integer",
            "format": "int64",
            "description": "조건에 맞는 전체 항목 수"
          }
        }
      },
      "CashReceiptListResponse": {
        "type": "object",
        "required": [
          "code",
          "items",
          "totalItems"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "성공 코드",
            "enum": [
              "10001"
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CashReceipt"
            }
          },
          "totalItems": {
            "type": "integer",
            "format": "int64",
            "description": "조건에 맞는 전체 항목 수"
          }
        }
      },
      "InvoiceWebhookEvent": {
        "type": "object",
        "required": [
          "id",
          "type",
          "timestamp",
          "data"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "이벤트 ID (`evt_`)"
          },
          "type": {
            "type": "string",
            "description": "이벤트 종류",
            "enum": [
              "invoice.created",
              "invoice.updated",
              "invoice.paid",
              "invoice.expired",
              "invoice.canceled",
              "invoice.reopened"
            ]
          },
          "timestamp": {
            "type": "string",
            "description": "이벤트가 일어난 시각",
            "format": "date-time"
          },
          "data": {
            "$ref": "#/components/schemas/WebhookInvoice"
          }
        }
      },
      "TransactionWebhookEvent": {
        "type": "object",
        "required": [
          "id",
          "type",
          "timestamp",
          "data"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "이벤트 ID (`evt_`)"
          },
          "type": {
            "type": "string",
            "description": "이벤트 종류",
            "enum": [
              "transaction.created"
            ]
          },
          "timestamp": {
            "type": "string",
            "description": "이벤트가 일어난 시각",
            "format": "date-time"
          },
          "data": {
            "$ref": "#/components/schemas/WebhookTransaction"
          }
        }
      },
      "OauthTokenRequest": {
        "type": "object",
        "required": [
          "grant_type",
          "code",
          "redirect_uri"
        ],
        "properties": {
          "grant_type": {
            "type": "string",
            "enum": [
              "authorization_code"
            ]
          },
          "code": {
            "type": "string",
            "description": "리디렉션으로 받은 인가 코드"
          },
          "redirect_uri": {
            "type": "string",
            "format": "uri",
            "description": "인가 요청에 보낸 `redirect_uri`와 같은 값"
          },
          "code_verifier": {
            "type": "string",
            "description": "인가 요청에 `code_challenge`를 넣었다면 필수. 43~128자",
            "minLength": 43,
            "maxLength": 128
          },
          "client_id": {
            "type": "string",
            "description": "앱 ID (`oap_` 접두사). HTTP Basic 인증을 쓰지 않을 때 넣어요."
          },
          "client_secret": {
            "type": "string",
            "description": "클라이언트 시크릿 (`oas_` 접두사). HTTP Basic 인증을 쓰지 않을 때 넣어요."
          }
        }
      },
      "OauthRevokeRequest": {
        "type": "object",
        "required": [
          "token"
        ],
        "properties": {
          "token": {
            "type": "string",
            "description": "폐기할 액세스 토큰 (`oat_` 접두사)"
          },
          "client_id": {
            "type": "string",
            "description": "앱 ID (`oap_` 접두사). HTTP Basic 인증을 쓰지 않을 때 넣어요."
          },
          "client_secret": {
            "type": "string",
            "description": "클라이언트 시크릿 (`oas_` 접두사). HTTP Basic 인증을 쓰지 않을 때 넣어요."
          }
        }
      },
      "OauthTokenResponse": {
        "type": "object",
        "required": [
          "access_token",
          "token_type",
          "scope",
          "workspace_id"
        ],
        "properties": {
          "access_token": {
            "type": "string",
            "description": "액세스 토큰 (`oat_` 접두사). 만료되지 않아요.",
            "example": "oat_7v2m9q4k1x8c3n6b5z0p2w7r4t9y1u3i8o5a6s2d"
          },
          "token_type": {
            "type": "string",
            "enum": [
              "Bearer"
            ]
          },
          "scope": {
            "type": "string",
            "description": "이 토큰에 허용된 스코프. 공백으로 구분해요.",
            "example": "invoices:read transactions:read"
          },
          "workspace_id": {
            "type": "string",
            "description": "고객이 연결한 워크스페이스 ID",
            "example": "ws_a1b2c3d4e5f6g7h8i9j0k1l2"
          }
        }
      },
      "OauthErrorResponse": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "enum": [
              "invalid_request",
              "invalid_client",
              "invalid_grant",
              "unsupported_grant_type"
            ],
            "description": "RFC 6749 오류 코드"
          }
        }
      },
      "V1EmptyResponse": {
        "type": "object",
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "결과 코드"
          },
          "data": {
            "type": "null"
          }
        }
      },
      "V1Customer": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 16,
            "description": "입금자명. 공백 없이 1~16자. 은행 알림의 입금자명과 같아야 자동 매칭됩니다. 은행이 자른 긴 이름은 이름 앞자리 매칭(매칭 어시스트)으로 처리합니다."
          },
          "email": {
            "type": "string",
            "format": "email",
            "minLength": 5,
            "maxLength": 255,
            "nullable": true
          },
          "phoneNumber": {
            "type": "string",
            "nullable": true,
            "pattern": "^d{10,11}$",
            "description": "하이픈 없는 숫자 10~11자리 (예: `01012345678`)"
          }
        }
      },
      "V1InvoiceCashReceipt": {
        "type": "object",
        "required": [
          "type",
          "identifier"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "PERSONAL",
              "CORPORATE"
            ],
            "description": "`PERSONAL` (소득공제용) 또는 `CORPORATE` (지출증빙용)"
          },
          "identifier": {
            "type": "string",
            "description": "개인: 휴대폰 번호, 사업자: 사업자등록번호"
          }
        }
      },
      "V1IssueInvoiceRequest": {
        "type": "object",
        "required": [
          "bankAccountIds",
          "customer",
          "amount"
        ],
        "properties": {
          "bankAccountIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "uniqueItems": true,
            "description": "입금받을 계좌 ID(`bac_`) 목록. 빈 배열이면 등록한 모든 계좌로 받습니다. 1원 인증을 마친 내 계좌만 넣을 수 있습니다.",
            "example": []
          },
          "customer": {
            "$ref": "#/components/schemas/V1Customer"
          },
          "amount": {
            "type": "integer",
            "minimum": 1,
            "description": "주문 금액 (원). 0보다 커야 합니다. 자동 매칭 시 입금 금액과 정확히 일치해야 합니다."
          },
          "cashReceipt": {
            "allOf": [
              {
                "$ref": "#/components/schemas/V1InvoiceCashReceipt"
              }
            ],
            "nullable": true,
            "description": "결제 완료 시 발급할 현금영수증 정보. 사업자 정보를 등록해야 발급됩니다. 주문 생성 때는 식별번호 형식을 검사하지 않습니다."
          },
          "expireAfter": {
            "type": "string",
            "nullable": true,
            "description": "주문 만료 기간. ISO-8601 duration (`PT30M`, `PT1H`, `P1D`, `P1DT6H20M`, `P7D`) 또는 간이 표기 (`30m`, `1h`, `1d 6h 20m`, `7d`) 를 지원합니다. 최대 365일.",
            "example": "1d"
          },
          "metadata": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {
              "type": "string"
            },
            "description": "문자열 키/값. 최대 5쌍, 키 64자, 값 1024자. `CAFE24_`, `SIXSHOP_`, `IMWEB_`으로 시작하는 키는 쇼핑몰 연동용이라 쓰지 마세요."
          }
        }
      },
      "V1Invoice": {
        "type": "object",
        "required": [
          "id",
          "issuerId",
          "bankAccountIds",
          "customer",
          "amount",
          "paid",
          "issuedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "주문 ID (`ivc_` 접두사)",
            "example": "ivc_a1b2c3d4e5f6g7h8i9j0k1l2"
          },
          "issuerId": {
            "type": "string",
            "description": "발행자 계정 ID"
          },
          "bankAccountIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "입금받을 계좌 ID 목록. 빈 배열이면 모든 계좌."
          },
          "customer": {
            "$ref": "#/components/schemas/V1Customer"
          },
          "cashReceipt": {
            "allOf": [
              {
                "$ref": "#/components/schemas/V1InvoiceCashReceipt"
              }
            ],
            "nullable": true
          },
          "amount": {
            "type": "integer"
          },
          "paid": {
            "type": "boolean",
            "description": "결제 완료 여부"
          },
          "metadata": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {
              "type": "string"
            }
          },
          "issuedAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "deletedAt": {
            "type": "null",
            "description": "조회 가능한 주문에서는 항상 null."
          }
        }
      },
      "V1BankAccount": {
        "type": "object",
        "required": [
          "id",
          "active",
          "ownerId",
          "alias",
          "provider",
          "type",
          "number",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "계좌 ID (`bac_` 접두사)"
          },
          "active": {
            "type": "boolean"
          },
          "ownerId": {
            "type": "string",
            "description": "계좌를 등록한 계정 ID (`acc_`)"
          },
          "alias": {
            "type": "string",
            "description": "대시보드에서 등록한 계좌 별칭"
          },
          "provider": {
            "type": "string",
            "enum": [
              "INDUSTRIAL_BANK_OF_KOREA",
              "KB_KOOKMIN_BANK",
              "NH_NONGHYUP_BANK",
              "IM_BANK",
              "KEB_HANA_BANK",
              "SHINHAN_BANK",
              "K_BANK"
            ]
          },
          "type": {
            "type": "string",
            "enum": [
              "PERSONAL",
              "CORPORATE"
            ]
          },
          "number": {
            "type": "string",
            "description": "하이픈 없는 계좌번호"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "verifiedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "1원 인증 완료 시각"
          },
          "deletedAt": {
            "type": "null"
          }
        },
        "description": "입금을 받은 시점의 계좌 정보 스냅샷입니다."
      },
      "V1Transaction": {
        "type": "object",
        "required": [
          "id",
          "bankAccount",
          "amount",
          "description",
          "hidden",
          "receivedAt",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "트랜잭션 ID (`trx_` 접두사)",
            "example": "trx_a1b2c3d4e5f6g7h8i9j0k1l2"
          },
          "bankAccount": {
            "$ref": "#/components/schemas/V1BankAccount"
          },
          "matchedInvoiceId": {
            "type": "string",
            "nullable": true,
            "description": "매칭된 주문 ID (`ivc_` 접두사)"
          },
          "matchMethod": {
            "type": "string",
            "nullable": true,
            "enum": [
              "EXACT",
              "BRACKET_REMOVAL",
              "NAME_PREFIX",
              "MANUAL",
              null
            ],
            "description": "매칭 방식. 매칭되지 않았거나 기록 이전에 매칭된 입금은 null."
          },
          "amount": {
            "type": "integer",
            "description": "입금 금액 (원)"
          },
          "description": {
            "type": "string",
            "description": "은행 알림의 입금자명"
          },
          "hidden": {
            "type": "boolean",
            "description": "대시보드에서 숨긴 입금인지 여부. API로는 바꿀 수 없습니다."
          },
          "receivedAt": {
            "type": "string",
            "format": "date-time",
            "description": "은행 알림 기준 입금 시각"
          },
          "matchedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "페이싱크가 입금 알림을 받은 시각"
          },
          "deletedAt": {
            "type": "null"
          }
        }
      },
      "V1IssueCashReceiptRequest": {
        "type": "object",
        "required": [
          "type",
          "identifier",
          "amount"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "PERSONAL",
              "CORPORATE"
            ],
            "description": "`PERSONAL` (소득공제용) 또는 `CORPORATE` (지출증빙용)"
          },
          "identifier": {
            "type": "string",
            "description": "개인: 휴대폰 번호, 사업자: 사업자등록번호"
          },
          "amount": {
            "type": "integer",
            "minimum": 1,
            "description": "발급 금액 (원). 0보다 커야 합니다."
          }
        }
      },
      "V1CashReceipt": {
        "type": "object",
        "required": [
          "id",
          "status",
          "issuerId",
          "corpNum",
          "type",
          "identifier",
          "amount",
          "ntsConfirmNum",
          "issuedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "현금영수증 ID (`crt_` 접두사)",
            "example": "crt_a1b2c3d4e5f6g7h8i9j0k1l2"
          },
          "status": {
            "type": "string",
            "enum": [
              "PENDING",
              "ISSUED",
              "FAILED",
              "REVOKED"
            ],
            "description": "발급 상태"
          },
          "issuerId": {
            "type": "string"
          },
          "corpNum": {
            "type": "string",
            "description": "발행자 사업자등록번호"
          },
          "type": {
            "type": "string",
            "enum": [
              "PERSONAL",
              "CORPORATE"
            ]
          },
          "identifier": {
            "type": "string"
          },
          "amount": {
            "type": "integer",
            "description": "부가세 포함 거래 금액 (원)"
          },
          "relatedInvoiceId": {
            "type": "string",
            "nullable": true,
            "description": "주문 결제 완료 시 자동 발급된 경우 연결된 주문 ID"
          },
          "ntsConfirmNum": {
            "type": "string",
            "description": "국세청 승인번호"
          },
          "ntsResultCode": {
            "type": "string",
            "nullable": true,
            "description": "국세청 결과 코드. 콜백 도착 전이면 null."
          },
          "issuedAt": {
            "type": "string",
            "format": "date-time"
          },
          "revokedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "deletedAt": {
            "type": "null"
          }
        }
      },
      "V1InvoiceResponse": {
        "type": "object",
        "required": [
          "code",
          "data"
        ],
        "properties": {
          "code": {
            "type": "string",
            "example": "OK"
          },
          "data": {
            "$ref": "#/components/schemas/V1Invoice"
          }
        }
      },
      "V1InvoiceListResponse": {
        "type": "object",
        "required": [
          "code",
          "totalItems",
          "data"
        ],
        "properties": {
          "code": {
            "type": "string",
            "example": "OK"
          },
          "totalItems": {
            "type": "integer"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1Invoice"
            }
          }
        }
      },
      "V1TransactionResponse": {
        "type": "object",
        "required": [
          "code",
          "data"
        ],
        "properties": {
          "code": {
            "type": "string",
            "example": "OK"
          },
          "data": {
            "$ref": "#/components/schemas/V1Transaction"
          }
        }
      },
      "V1TransactionListResponse": {
        "type": "object",
        "required": [
          "code",
          "totalItems",
          "data"
        ],
        "properties": {
          "code": {
            "type": "string",
            "example": "OK"
          },
          "totalItems": {
            "type": "integer"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1Transaction"
            }
          }
        }
      },
      "V1CashReceiptResponse": {
        "type": "object",
        "required": [
          "code",
          "data"
        ],
        "properties": {
          "code": {
            "type": "string",
            "example": "OK"
          },
          "data": {
            "$ref": "#/components/schemas/V1CashReceipt"
          }
        }
      },
      "V1CashReceiptListResponse": {
        "type": "object",
        "required": [
          "code",
          "totalItems",
          "data"
        ],
        "properties": {
          "code": {
            "type": "string",
            "example": "OK"
          },
          "totalItems": {
            "type": "integer"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1CashReceipt"
            }
          }
        }
      },
      "V1InvoicePaidEvent": {
        "type": "object",
        "required": [
          "type",
          "invoice",
          "trigger"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "invoice.paid"
            ]
          },
          "invoice": {
            "$ref": "#/components/schemas/V1Invoice"
          },
          "trigger": {
            "type": "string",
            "enum": [
              "AUTOMATIC_MATCHING",
              "MANUAL_MATCHING",
              "MANUAL_APPROVE",
              "API_CALL"
            ]
          }
        }
      }
    }
  }
}
