# 도매 주문을 취소하고 잡고 있던 재고를 해제합니다

`DELETE /api/v1/orders/{order_id}` — 토큰 필요 · order:write · 쓰기 · 2포인트

도매 주문

도매 주문을 취소하고 잡고 있던 재고를 해제합니다. 이미 출고된 주문은 취소할 수 없습니다

## 경로 파라미터

| 이름 | 타입 | 설명 |
| --- | --- | --- |
| `order_id` **필수** | string | 도매 주문번호, 주문 목록에서 확인. 본인 채널만. (최대 길이 64) |

## 응답

봉투는 HTTP 상태 코드만으로 판단합니다: 2xx 는 `{ data: … }`(목록은 `page / page_size / has_more` 또는 `total_count` 포함); 4xx / 5xx 는 `{ error: { code, message, hint, request_id, doc_url } }`.

```json
{
  "data": { … }
}
```

성공 응답에는 사람이 읽는 문구가 없습니다 — `code / result / msg` 없음. 프로그램이 분기해야 할 필드는 `error.code` 뿐이며 `message` 는 `Accept-Language` 를 따릅니다.

> 쓰기 요청에는 `Idempotency-Key` 헤더(UUID 등 고유 문자열)를 보내세요. 네트워크 재시도로 주문이 두 번 생기지 않습니다. 주문은 ERP에서 사람이 확인하기 전까지 초안입니다.

## 예제

### curl

```bash
curl -X DELETE "https://connect.everugg.net.au/api/v1/orders/{order_id}" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Idempotency-Key: <uuid>"
```

### Python

```python
import requests

r = requests.delete(
    "https://connect.everugg.net.au/api/v1/orders/{order_id}",
    headers={"Authorization": "Bearer " + TOKEN, "Idempotency-Key": str(uuid.uuid4())},
)
data = r.json()
r.raise_for_status()  # 4xx/5xx: data["error"]["code"] / ["hint"]
```

### Node

```js
const res = await fetch("https://connect.everugg.net.au/api/v1/orders/{order_id}", {
  method: "DELETE",
  headers: { Authorization: `Bearer ${TOKEN}`, "Idempotency-Key": crypto.randomUUID() },
})
const data = await res.json()
if (!res.ok) throw new Error(`${data.error?.code}: ${data.error?.message}`)
```

### Java

```java
HttpRequest req = HttpRequest.newBuilder()
    .uri(URI.create("https://connect.everugg.net.au/api/v1/orders/{order_id}"))
    .header("Authorization", "Bearer " + token)
    .header("Idempotency-Key", UUID.randomUUID().toString())
    .method("DELETE", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse<String> res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());
```

---
Markdown 원본: https://connect.everugg.net.au/reference/delete-api-v1-orders-order-id.md?lang=ko · 웹 페이지: https://connect.everugg.net.au/reference?op=delete-api-v1-orders-order-id&lang=ko
