발송처리
주문에 딸린 발주(배송) 단위로 상태와 운송장을 갱신합니다. 관리자 주문 상세의 [발송처리]를 서버에서 합니다.
발송 완료로 바꾸면서 운송장을 같이 넣으면 배송 추적이 자동으로 시작됩니다. 그 뒤로 택배사가 알려주는 단계가 자동으로 쌓이므로 배송추적 조회로 읽으면 됩니다. 배송 완료를 받으면 발주 상태도 배송 완료로 바뀝니다.
Basic 인증과 user:order_purchase_update scope가 필요합니다. 입력과 오류 전체는 주문 API 원문을 확인합니다.
API 엔드포인트
요청 파라미터
요청 파라미터
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
| order_number | String | Y | 주문번호 (URL 경로) |
| purchases | Array | Y | 갱신할 발주 목록. 한 번에 최대 50건 |
| purchases[].order_purchase_number | String | Y | 발주 번호 — 주문 상세 응답의 order_purchases[].order_purchase_number |
| purchases[].status | Integer | Y | 바꿀 발주 상태 — 2 발주 확인 · 3 상품 준비중 · 4 발송 완료 · 5 배송 완료 |
| purchases[].delivery_company_code | String | N | 택배사 코드 (예: CJGLS) |
| purchases[].tracking_number | String | N | 운송장 번호 |
| purchases[].delivery_type | Integer | N | 배송 유형 — 커머스 Enum 참고 |
| purchases[].chosen_product_option_id | String | N | 발주 안에서 특정 옵션만 처리할 때 |
여러 발주는 순서대로 처리됩니다. 중간 항목에서 오류가 나면 앞 항목의 변경은 남을 수 있습니다. 오류 뒤에는 배송추적 조회로 현재 상태를 다시 확인합니다.
코드 예제
curl -X PUT "https://api.bootapi.com/v1/orders/25071182085082524116/purchases" \
-H "Authorization: Basic {base64(client_key:secret_key)}" \
-H "Content-Type: application/json" \
-d '{
"purchases": [
{
"order_purchase_number": "P25071182085082524116",
"status": 4,
"delivery_company_code": "CJGLS",
"tracking_number": "620148310301"
}
]
}'import { BootpayCommerce } from '@bootpay/backend-js'
const commerce = new BootpayCommerce({
client_key: 'your-commerce-client-key',
secret_key: 'your-commerce-secret-key',
mode: 'production'
})
// 두 번째 인자는 발주 배열 그대로 — SDK 가 { purchases: [...] } 로 감싸 보낸다
const response = await commerce.order.updatePurchases('25071182085082524116', [
{
order_purchase_number: 'P25071182085082524116',
status: 4,
delivery_company_code: 'CJGLS',
tracking_number: '620148310301'
}
])
console.log(response)from bootpay_backend import BootpayCommerce
commerce = BootpayCommerce(
client_key='your-commerce-client-key',
secret_key='your-commerce-secret-key',
mode='production'
)
# 두 번째 인자는 발주 리스트 그대로 — SDK 가 {'purchases': [...]} 로 감싸 보낸다
response = commerce.order.update_purchases('25071182085082524116', [
{
'order_purchase_number': 'P25071182085082524116',
'status': 4,
'delivery_company_code': 'CJGLS',
'tracking_number': '620148310301'
}
])
print(response)use Bootpay\ServerPhp\BootpayCommerceApi;
$commerce = new BootpayCommerceApi("your-commerce-client-key", "your-commerce-secret-key");
$response = $commerce->order->updatePurchases('25071182085082524116', [
[
'order_purchase_number' => 'P25071182085082524116',
'status' => 4,
'delivery_company_code' => 'CJGLS',
'tracking_number' => '620148310301'
]
]);
print_r($response);import java.util.Arrays;
import kr.co.bootpay.store.BootpayStore;
import kr.co.bootpay.store.model.request.TokenPayload;
import kr.co.bootpay.store.model.response.BootpayStoreResponse;
import kr.co.bootpay.store.model.request.order.OrderPurchaseUpdateItem;
import kr.co.bootpay.store.model.request.order.OrderPurchasesUpdateParams;
TokenPayload tp = new TokenPayload("your-commerce-client-key", "your-commerce-secret-key");
BootpayStore commerce = new BootpayStore(tp);
OrderPurchaseUpdateItem item = new OrderPurchaseUpdateItem();
item.orderPurchaseNumber = "P25071182085082524116";
item.status = 4;
item.deliveryCompanyCode = "CJGLS";
item.trackingNumber = "620148310301";
OrderPurchasesUpdateParams params = new OrderPurchasesUpdateParams();
params.orderNumber = "25071182085082524116";
params.purchases = Arrays.asList(item);
BootpayStoreResponse response = commerce.order.updatePurchases(params);
System.out.println(response);require 'bootpay'
commerce = BootpayStore::RestClient.new(client_key: 'your-commerce-client-key', secret_key: 'your-commerce-secret-key')
response = commerce.order_purchases_update(
order_number: '25071182085082524116',
purchases: [
{
order_purchase_number: 'P25071182085082524116',
status: 4,
delivery_company_code: 'CJGLS',
tracking_number: '620148310301'
}
]
)
puts response.dataimport "github.com/bootpay/backend-go/v2"
commerce := bootpay.NewCommerceAPI("your-commerce-client-key", "your-commerce-secret-key", nil, "production")
response, err := commerce.Order.UpdatePurchases(bootpay.OrderPurchasesUpdateParams{
OrderNumber: "25071182085082524116",
Purchases: []bootpay.OrderPurchaseUpdateItem{
{
OrderPurchaseNumber: "P25071182085082524116",
Status: 4,
DeliveryCompanyCode: "CJGLS",
TrackingNumber: "620148310301",
},
},
})
fmt.Println(response, err)using System.Collections.Generic;
using Bootpay.Commerce;
using Bootpay.Commerce.Models;
var commerce = new BootpayCommerceApi("your-commerce-client-key", "your-commerce-secret-key");
var response = await commerce.OrderUpdatePurchases("25071182085082524116", new List<OrderPurchaseUpdateItem> {
new OrderPurchaseUpdateItem {
OrderPurchaseNumber = "P25071182085082524116",
Status = 4,
DeliveryCompanyCode = "CJGLS",
TrackingNumber = "620148310301"
}
});
Console.WriteLine(await response.Content.ReadAsStringAsync());응답
성공 응답
갱신이 끝난 뒤의 발주 목록이 그대로 돌아옵니다. 필드 설명은 주문 상세와 같습니다.
JSON
[
{
"order_purchase_id": "6870824fb0eacea5cd974f12",
"order_purchase_number": "P25071182085082524116",
"status": 4,
"delivery_company_code": "CJGLS",
"tracking_number": "620148310301",
"d_ts": 1,
"sent_at": "2025-07-12T09:10:00Z",
"tracking_histories": []
}
]에러 코드
오류 코드
| 코드 | 메시지 | 대처 방법 |
|---|---|---|
ORDER_NOT_FOUND | 주문내역을 찾지 못했습니다. | order_number를 넣었는지 확인합니다 (order_id 아님) |
ORDER_DENIED | 주문 정보를 조회할 권한이 없습니다. | 다른 프로젝트의 주문번호는 아닌지 확인합니다 |
ORDER_PURCHASE_NOT_FOUND | 발주기록 정보가 없습니다. | 경로의 주문에 딸린 order_purchase_number인지 확인합니다 |
REQUIRED_PARAMETER_IS_MISSING | 필수 파라미터가 누락되었습니다 | purchases 배열을 넣었는지 확인합니다 |
INVALID_PARAMETER | 파라미터가 올바르지 않습니다. | status가 2·3·4·5 중 하나인지, 발주가 50건을 넘지 않는지 확인합니다 |