# 도매 주문 제출(이후 명세 변경 불가)

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

도매 주문

도매 주문 제출(이후 명세 변경 불가). payment_method 기본값은 invoice(청구서 결제)

## 경로 파라미터

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

## 요청 본문(JSON)

| 필드 | 타입 | 설명 |
| --- | --- | --- |
| `payment_method` | string | 결제 수단: balance / invoice(청구서 결제) / wechat / alipay. 기본값은 invoice, 즉 월 정산입니다. |
| `use_reservation` | boolean | 이번 배정에 예약(잠금) 재고를 사용할지 여부. 생략 = 사용 안 함. |

## 응답

봉투는 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 POST "https://connect.everugg.net.au/api/v1/orders/{order_id}/submit" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: <uuid>" \
  -d '{ "payment_method": "<payment_method>", "use_reservation": false }'
```

### Python

```python
import requests

r = requests.post(
    "https://connect.everugg.net.au/api/v1/orders/{order_id}/submit",
    headers={"Authorization": "Bearer " + TOKEN, "Idempotency-Key": str(uuid.uuid4())},
    json={
      "payment_method": "<payment_method>",
      "use_reservation": False
    },
)
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}/submit", {
  method: "POST",
  headers: { Authorization: `Bearer ${TOKEN}`, "Content-Type": "application/json", "Idempotency-Key": crypto.randomUUID() },
  body: JSON.stringify({
    "payment_method": "<payment_method>",
    "use_reservation": false
  }),
})
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}/submit"))
    .header("Authorization", "Bearer " + token)
    .header("Content-Type", "application/json")
    .header("Idempotency-Key", UUID.randomUUID().toString())
    .POST(HttpRequest.BodyPublishers.ofString("{ \"payment_method\": \"<payment_method>\", \"use_reservation\": false }"))
    .build();
HttpResponse<String> res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());
```

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