메인 콘텐츠로 건너뛰기
POST
결제 취소 요청

인증

Authorization
string
header
필수

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

헤더

Idempotency-Key
string<uuid>

취소 요청마다 발급한 UUID. 응답을 받지 못해 다시 요청할 때는 같은 값을 보낸다.

경로 매개변수

id
string<uuid>
필수

취소할 결제 시도의 id.

본문

application/json
reason
string
필수

취소 사유. 토스페이먼츠에 그대로 넘긴다

Maximum string length: 200
amount
integer<int64>

취소할 금액. 원 단위 양의 정수. 빼면 남은 결제 금액 전부를 취소한다

응답

결제 취소. status는 done, failed, pending 중 하나

amount
integer<int64>

취소한 금액. 원 단위 정수

completed_at
string<date-time>
failure_code
string

failed일 때만 있다. 토스페이먼츠가 준 값: 취소 거절 코드(예: NOT_CANCELABLE_AMOUNT). MeterEngine이 정한 값: HTTP_<상태>(토스페이먼츠 거절 응답에 코드가 없을 때 그 HTTP 상태), NOT_FOUND_CANCELLATION(취소를 요청하고 payment.not-found-failure-delay(기본 10분)가 지나도 토스페이먼츠 결제 조회에 이 취소에 맞는 취소 거래가 없을 때. 토스페이먼츠 코드가 아니다), toss_payments_credential_missing(토스페이먼츠를 부르기 전에 결제 모드의 키가 없었다).

failure_message
string

failed일 때만 있다. 토스페이먼츠가 준 거절 문구이거나, failure_code가 MeterEngine 코드면 그 오류 문구다

id
string<uuid>
mode
enum<string>

취소한 결제 시도의 결제 모드. test 또는 live

사용 가능한 옵션:
test,
live
payment_attempt_id
string<uuid>
reason
string

취소 사유

requested_at
string<date-time>
status
enum<string>

pending은 토스페이먼츠 결과를 아직 확인하지 못한 취소다

사용 가능한 옵션:
pending,
done,
failed