sayren Docs
주문 상품 처리

판매자 취소

POST
/v1/order-items/{orderItemId}/cancel

Authorization

accessToken
headerAuthorizationBearer <token>

Sayren 계정 토큰(로그인 토큰 또는 개인 액세스 토큰, RFC 9068 JWT)

Path Parameters

orderItemId*string

Header Parameters

X-Store-Id*string

대상 상점 id. 토큰의 상점 범위 밖이면 403 STORE_NOT_GRANTED, 없으면 400 STORE_ID_REQUIRED다

idempotency-key?string

멱등키. 같은 키로 다시 보내면 처음 결과를 돌려주고 한 번만 적용한다. 재시도에는 같은 키를 쓴다

Lengthlength <= 255

Request Body

application/json
  1. body
reason*string
Value in"OUT_OF_STOCK""PRICE_ERROR""DELIVERY_IMPOSSIBLE""ETC"
detail?string
Lengthlength <= 500
quantity?integer

취소할 수량. 생략하면 남은 수량 전체다. 남은 수량보다 크면 400 INVALID_QUANTITY. 일부만 취소하면 주문상품은 상태를 유지한 채 canceledQuantity가 늘고, 전 수량이 소진되면 CANCELED가 된다

Range1 <= value
holdRefund?boolean

true면 주문만 취소하고 결제 환불은 대기로 남긴다(#115). 정산·재고·적립금 반환은 그대로 하고, PG 환불은 결제 상세의 POST /v1/payments/refunds/{refundId}/process로 따로 한다. 생략하면 취소와 함께 환불한다

Response Body

성공

application/json
  1. response
meta*
data*
error*|null
curl -X POST 'https://api.sayren.io/v1/order-items/string/cancel' \  -H 'X-Store-Id: string' \  -H 'Content-Type: application/json' \  -d '{  "reason": "OUT_OF_STOCK"}'
{  "meta": {    "status": 200,    "code": "OK",    "message": "OK",    "isSuccess": true  },  "data": {    "orderItemId": "string",    "refundAmount": 0,    "quantity": 0,    "canceledQuantity": 0,    "deliveryFeeRefundAmount": 0,    "deliveryFeeChargeAmount": 0,    "couponChargeAmount": 0,    "couponChargeRefundAmount": 0,    "pointRefundAmount": 0,    "refundedAt": "string",    "refundHeld": false  },  "error": null}