> ## 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.

# 주문 취소 API

> 주문을 취소 상태로 바꿉니다. 결제 복구 시나리오가 멈춥니다.



## OpenAPI

````yaml /steppay_v1.json patch /api/v1/cover/order/cancel/{orderId}
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/cover/order/cancel/{orderId}:
    patch:
      tags:
        - 커버 API
      summary: 주문 취소 API
      description: 주문을 취소 상태로 바꿉니다. 결제 복구 시나리오가 멈춥니다.
      operationId: v1_cancelOrder_2
      parameters:
        - name: orderId
          in: path
          description: 주문 ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: 주문 상태 변경됨
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/CancelOrderResponse'
        '400':
          description: Bad Request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/CoverErrorresponse'
        '403':
          description: Forbidden
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/CoverErrorresponse'
components:
  schemas:
    CancelOrderResponse:
      required:
        - amount
        - amountReturned
        - customer
        - id
        - items
        - partnerOrderId
        - status
      type: object
      properties:
        id:
          type: integer
          description: 주문 ID - 다른 API 호출에 사용되므로 해당 주문 정보와 함께 저장해놓고 사용하세요.
          format: int64
        customer:
          $ref: '#/components/schemas/CoverCustomerdto'
        amount:
          type: number
          description: 주문 금액
        amountReturned:
          type: number
          description: 환불 금액
        items:
          type: array
          description: 주문 항목
          items:
            $ref: '#/components/schemas/CoverOrderitemdto'
        status:
          type: string
          description: 주문 상태
          enum:
            - CREATED
            - PAID
            - CANCEL_REQ
            - CANCELED
            - CHANGE_REQ
            - CHANGE_PROCESS
            - CHANGED
            - RETURN_REQ
            - RETURN_PROCESS
            - RETURNED
            - PREPARING
            - SHIPPING
            - FULFILLED
            - FULL_REFUND
            - PARTIAL_REFUND
            - PAYMENT_FAILURE
        canceledDate:
          type: string
          description: 주문 취소 시점
          format: date-time
        paymentDate:
          type: string
          description: 주문 결제 시점
          format: date-time
        idKey:
          type: string
          description: 스텝페이 주문 idKey
        retryDate:
          type: string
          description: >-
            다음 결제 시도 시점 - 시나리오에 의해서 계산된 시점입니다. 해당 시점에 다시 결제를 시도해주세요(실패 주문을 생성했을
            때 포함됩니다).
          format: date-time
        partnerOrderId:
          type: string
          description: 가맹점에서 사용하는 주문의 unique ID
    CoverErrorresponse:
      required:
        - errorCode
      type: object
      properties:
        traceId:
          type: string
        errorCode:
          type: string
        errorMessage:
          type: string
        details:
          $ref: '#/components/schemas/ReturnError'
    CoverCustomerdto:
      required:
        - email
        - id
        - name
        - partnerCustomerId
        - phone
      type: object
      properties:
        id:
          type: integer
          description: 고객 ID - 다른 API 호출에 사용되므로 해당 고객 정보와 함께 저장해놓고 사용하세요.
          format: int64
        name:
          type: string
          description: 고객 이름
        email:
          type: string
          description: 고객 email
        phone:
          type: string
          description: 고객 전화번호
        partnerCustomerId:
          type: string
          description: 가맹점에서 사용하는 고객의 unique ID
      description: 고객 정보
    CoverOrderitemdto:
      title: 주문 항목 정보
      required:
        - quantity
      type: object
      properties:
        price:
          $ref: '#/components/schemas/CoverPricedto'
        quantity:
          type: integer
          description: 항목 주문 수량
          format: int32
      description: 주문 항목
    ReturnError:
      type: object
    CoverPricedto:
      title: 가격 플랜 정보
      required:
        - id
        - isRecurring
        - name
        - partnerPriceId
        - price
        - product
      type: object
      properties:
        id:
          type: integer
          description: 플랜 ID - 다른 API 호출에 사용되므로 해당 플랜 정보와 함께 저장해놓고 사용하세요.
          format: int64
        name:
          type: string
          description: 플랜 이름
        partnerPriceId:
          type: string
          description: 가맹점에서 사용하는 플랜의 unique ID
        product:
          $ref: '#/components/schemas/CoverProductdto'
        price:
          type: number
          description: 판매 가격
        isRecurring:
          type: boolean
          description: 정기결제인지 여부
        recurringInterval:
          type: string
          description: 결제 주기에 대한 단위(isRecurring이 true일 때)
          enum:
            - DAY
            - WEEK
            - MONTH
            - YEAR
        recurringIntervalCount:
          type: integer
          description: 결제 주기에 대한 수(isRecurring이 true일 때)
          format: int32
      description: 가격 플랜 정보
    CoverProductdto:
      title: 상품 정보
      required:
        - id
        - name
        - partnerProductId
      type: object
      properties:
        id:
          type: integer
          description: 상품 ID - 다른 API 호출에 사용되므로 해당 상품 정보와 함께 저장해놓고 사용하세요.
          format: int64
        name:
          type: string
          description: 상품 이름
        featuredImageUrl:
          type: string
          description: 상품 대표 이미지 URL
        partnerProductId:
          type: string
          description: 가맹점에서 사용하는 상품의 unique ID
      description: 플랜과 연관된 상품 정보
  securitySchemes:
    Secret-Token:
      type: apiKey
      in: header
      name: Secret-Token

````