coupang
POST/v2/providers/openapi/apis/api/v5/vendors/{vendorId}/orders/{orderId}/cancelv1

Cancel an order

# 01

Summary

Available buyer market: Korean, Taiwan This API cancels orders at the status [Payment completed] or [Product in preparation] (returns an error at other status). It immediately cancels an order at [Payment completed] and suspends the outbound shipment of the product at [Product in preparation].

# 02

Details

Available buyer market: Korean, Taiwan

This API cancels orders at the status [Payment completed] or [Product in preparation] (returns an error at other status).
It immediately cancels an order at [Payment completed] and suspends the outbound shipment of the product at [Product in preparation].
If there are different bundled shipping numbers (shipmentBoxId) in one order number, you must request cancellation for each shipmentBoxId to be processed normally.

※ Cancelling an order using this API lowers your seller score (on-time delivery), so please manage your inventory and pricing so as not to use this API.

Path

POST

/v2/providers/openapi/apis/api/v5/vendors/{vendorId}/orders/{orderId}/cancel

Example Endpoint

https://api-gateway.coupang.com/v2/providers/openapi/apis/api/v5/vendors/A00012345/orders/2000006593044/cancel

Request Parameters

Path Segment Parameter

Name Required Type Description
vendorId O String 
Seller ID
Unique code issued to Vendor by Coupang
ex) A00012345
orderId O Number
Order no.
ex) 2000006593044

Body Parameter

Name Required Type Description
orderId O Number
Order no.
Must also enter path variable
vendorItemIds O Array
Array of the option ID (vendorItemId) for a product to cancel
To be paired with receiptCounts
receiptCounts O Array
Array of the count of products to cancel, greater than 0
To be paired with vendorItemIds
bigCancelCode O String
High-level code of order cancellation reason
CANERR
middleCancelCode O String
Mid-level code of order cancellation reason
  • CCTTER // Inventory integration error: Cancelled due to an inventory issue
  • CCPNER // Partner site error: Cancelled when it fails to create a delivery destination due to an address issue 
  • CCPRER // Pricing error: Cancelled due to a pricing error between the two companies
When an order is cancelled (shipment suspended) at Product in preparation, the reason category is fixed at "Complaint about delivery" and "OOS," respectively. The detailed reason for cancellation is recorded as "Partner API forced cancellation."
O String
Vendor ID, must also enter path variable
userId O String
Vendor's ID to log in Coupang Wing

Request Example

{
  "orderId": 2000006593044,
  "vendorItemIds": [
    3145181064,
    3145181065,
    3145181067
  ],
  "receiptCounts": [
    1,
    2,
    1
  ],
  "bigCancelCode": "CANERR",
  "middleCancelCode": "CCTTER",
  "userId": "wing_login_id_123",
  "vendorId": "A00123456"
}

Response Message

Name Type Description
code String
Response code
200 - Whole/partial cancellation succeeded, 400 - Cancellation failed
message String
Reason and error message for failure
data CancelResponse
Detailed info about cancellation success and failure
  ReceiptMap Object
 
    receiptId Number
Receipt ID
    receiptType String
Immediate cancellation receipt ID in case of CANCEL,
Shipment Suspension Receipt ID in case of STOP_SHIPMENT
    vendorItemIds Array
List of product IDs cancelled by the receipt ID
    totalCount Number
Total count of products cancelled by the receipt ID
  orderId Number
Order ID
  failedItemIds Array
VendorItemId with cancellation failure

Response Example 1

{  
    "code": "200",
  	"message": "[요청번호] 43b97579-bcb5-4260-84cb-9a4a9063db71 \\r\\n",
  	"data": {
    	"receiptMap": {
      	"181627233": {
        	"receiptId": 181627233,
        	"receiptType": "CANCEL",
        	"vendorItemIds": [
          	70071284034
        	],
        	"totalCount": 1
      	   }
    	},
    	"orderId": 23000059824637,
    	"failedVendorItemIds": [
      
    	]
  	}
  }
}

Response Example 2

{
  "code": "200",
  "message": "[요청번호] cdea5b4b-34e9-4bec-bbd9-061e358e46a0 \\r\\n[3145181064]<= 취소 가능한 개수보다 요청한 개수가 더 많습니다.",
  "data": {
    "receiptMap": {
      "44698107": {
"receiptId": 44698107, "receiptType": "STOP_SHIPMENT", "vendorItemIds": [ 3145181065, 3145181067 ], "totalCount": 3
} }, "orderId": 2000006593044, "failedVendorItemIds": [ 3145181064 ] } }

Response Example 3

{  
    "code": "400",
    "message": "[요청번호] 5d803ea1-e61d-44bd-a56d-44f3528f5136 \\r\\n [3145181067, 3145181065, 3145181064]<= 취소 가능한 개수보다 요청한 개수가 더 많습니다",
    "data": {
       "receiptMap": {
       },
      "orderId": 23000059824637,
      "failedVendorItemIds": [
     	 3145181067,
     	 3145181065,
     	 3145181064
       ]
    }
  }
}

Error Spec

HTTP status code (error type) Error message How to resolve
400 (check request parameter) Enter the order ID. Check if the order ID (orderId) is correct.
400 (check request parameter)

Enter a list of vendor item IDs to cancel.

Check if the product ID list (vendorItemIds) is correct. 

400 (check request parameter)

Enter the count of items to cancel.

Check if the array of the count of products to cancel (receiptCounts) is correct.

400 (check request parameter)

Check the count of products requested and that of products to cancel.

Check if the count of options on the product ID list (vendorItemIds) matches that of products to cancel.

400 (check request parameter)

Enter the high-level code of cancellation reason. 

Check if the high-level code of cancellation reason is "CANERR."

400 (check request parameter)

Enter the mid-level code of cancellation reason.

Check if the mid-level code of cancellation reason (middleCancelCode) is "CCTTER," "CCPNER" or "CCPRER."

400 (check request parameter) 

Enter the vendor ID.

Check if the seller ID (vendorId) is correct.

400 (check request parameter) 

Enter the right user ID for the vendor ID.

Check if the Wing user ID is right for the seller ID.

400 (check request parameter) 

Order info doesn't exist.

This occurs when no payment info exists for the requested order ID (OrderId) and product ID. Check the order ID and the status of each product. 

400 (check request parameter) 

The requested count exceeds the cancellable count.

Check if the requested count is greater than the cancellable count of a certain option (= count of orders - count of orders being cancelled - count of orders cancelled).

400 (check request parameter) 

The order status of this vendor item is not Payment Completed/Product in Preparation.

Check if the order you are requesting to cancel is not at Payment Completed or Product in Preparation.

400 (check request parameter) 

This product is not the requesting seller's.

Check if the order you are requesting to cancel is on your product.

400 (check request parameter) 

An error has occurred in cancellation request.

Cancellation has failed for an order you are requesting to cancel at Payment Completed. Double-check the order status at Payment Completed.

400 (check request parameter) 

Partial cancellation is unavailable.

Partial cancellation has failed. Check if the count of options on the product ID list (vendorItemIds) and that of products to cancel are correct.

400 (check request parameter) 

Shipment suspension has failed.

Shipment suspension has failed for an order you are requesting to cancel at Product in Preparation. Check the order status of the option and if cancellation has been double-requested for the option.

400 (check request parameter) 

It has failed to roll back shipment suspension request [receipt ID].

Shipment suspension has failed for an order you are requesting to cancel at Product in Preparation, and so did the suspension request roll-back. Check the processing status of the option.

400 (check request parameter) 

An internal error has occurred. Contact Coupang.

Error no.: %s 

Check the entries and send a request again sometime later.

URL API Name

CANCEL_ORDER_PROCESSING