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

# 주문 취소

> 주문을 취소할 때 호출합니다. 결제가 완료된 주문건은 환불되며, 그렇지 않은 주문은 취소됩니다.



## OpenAPI

````yaml /steppay_v1.json patch /api/v1/orders/{orderIdOrCode}/cancel
openapi: 3.0.1
info:
  title: STEPPAY
  version: '1.0'
  contact:
    name: Steppay
    url: https://www.steppay.kr
    email: contact@steppay.kr
servers:
  - url: https://api.steppay.kr
    description: Generated server url
security:
  - Secret-Token: []
paths:
  /api/v1/orders/{orderIdOrCode}/cancel:
    patch:
      tags:
        - 주문 API
      summary: 주문 취소
      description: 주문을 취소할 때 호출합니다. 결제가 완료된 주문건은 환불되며, 그렇지 않은 주문은 취소됩니다.
      operationId: v1_cancelOrder
      parameters:
        - name: orderIdOrCode
          in: path
          description: 주문 번호
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReqV1'
        required: true
      responses:
        '200':
          description: 정상적으로 취소됨
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ProductApiresponse'
        '400':
          description: Bad Request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ProductErrorresponse'
        '403':
          description: Forbidden
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ProductErrorresponse'
        '404':
          description: 주문을 찾지 못 함
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiResponseUnit'
components:
  schemas:
    ReqV1:
      required:
        - requestPrice
      type: object
      properties:
        requestPrice:
          minimum: 0
          type: number
          description: 환불 요청 금액
        reason:
          type: string
          description: 환불 사유
      description: 주문 취소 요청 데이터
    ProductApiresponse:
      title: 단순 API 응답
      required:
        - message
      type: object
      properties:
        message:
          type: string
          description: 결과에 대한 메세지
        body:
          type: object
          description: 관련 데이터
    ProductErrorresponse:
      required:
        - errorCode
      type: object
      properties:
        traceId:
          type: string
        errorCode:
          type: string
        errorMessage:
          type: string
        details:
          $ref: '#/components/schemas/ReturnError'
    ApiResponseUnit:
      title: 단순 API 응답
      required:
        - message
      type: object
      properties:
        message:
          type: string
          description: 결과에 대한 메세지
        body:
          $ref: '#/components/schemas/Unit'
    ReturnError:
      type: object
    Unit:
      type: object
  securitySchemes:
    Secret-Token:
      type: apiKey
      in: header
      name: Secret-Token

````