> For the complete documentation index, see [llms.txt](https://ofin.gitbook.io/document/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ofin.gitbook.io/document/payment/cancelation.md).

# 결제 취소

구매자가 결제를 취소한 경우, 플랫폼이 Allra BNPL(Ofin) 서버에 취소 사실을 알릴 때 사용하는 API입니다.

{% hint style="danger" %} <mark style="color:$danger;">**결제 취소 API를 호출하지 않는 경우 구매자로부터 결제 금액을 회수 요청하게 됩니다.**</mark>
{% endhint %}

## Endpoints

* **URL:** `/api/v1/user/payment`
* **Method:** `DELETE`

## **Request**

* **apiKey (String) (Required) (maxLen:255)**
  * 플랫폼 API Key
* **orderNo (String) (Required) (maxLen:50)**
  * 주문번호

#### **Request Example**

```json
{
  "apiKey": "my8isVOhkPvAeLbtealSrEYyJBCZa ... BSDINWJPKs6th5QBTdYZHCtLxavagMR2I",
  "orderNo" : "order:20250901:000001"
}
```

## Response

* **status (String) (maxLen:50)**
  * BEFORE\_PAYOUT : 지급 전 상태로 플랫폼에 지급 시 제외되고 지급됩니다.
  * AFTER\_PAYOUT : 이미 지급된 상태로 플랫폼으로부터 회수가 필요함을 나타냅니다.
* **withdrawalAmount (Integer) (maxLen:16)**
  * 회수 예정 금액
* **withdrawalDueDate (String) (maxLen:10)**
  * 회수 예정 일자 (yyyy-mm-dd)

#### **Response Example**

```json
{
  "status": "BEFORE_PAYOUT",
  "withdrawalAmount" : null,
  "withdrawalDueDate" : null
}

// or

{
  "status": "AFTER_PAYOUT",
  "withdrawalAmount" : 128900,
  "withdrawalDueDate" : 2025-10-01
}
```

### Error Handling

* ALL\_DONE\_PAYMENT : 결제 완료 후 납부까지 완료된 결제건입니다.
* INTERNAL\_SERVER\_ERROR : 서버 내부 에러입니다.

```json
{
  "meta": {
    "code": "ALL_DONE_PAYMENT",
    "message": "결제 완료 후 납부까지 완료된 결제건입니다."
  },
  "data": null
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ofin.gitbook.io/document/payment/cancelation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
