Cancel an order
post
/ccadmin/v1/orders/cancel
Cancels the order with the provided orderId. The order must not be in an "Incomplete" state.
Note: You must specify the payload properties orderId and cancelReason
Example cancel reasons:- badProductReview
- betterCompetitorPrice
- cannotProcessOrder
- changeOfMind
- itemAvailableAtDiscountCurrently
- noLongerNeeded
- noUpdateOnShipmentStatus
- paymentNotReceived
See Merchant Settings Get Cancel Reasons for list of cancel reasons.
Request
Supported Media Types
- application/json
Header Parameters
-
X-CCAsset-Language: string
Instructs the endpoint to use the specified locale code for content returned in the response. The locale supplied in the header must be supported by your store.
-
x-ccsite(required): string
The site ID from which the order was placed.
Root Schema : cancelOrder_request
Type:
Show Source
object
-
cancelReason(required):
string
The cancel reason of the order.
-
orderId(required):
string
The ID of the order to be cancelled.
Example:
{
"orderId":"o30413",
"cancelReason":"badProductReview"
}
Response
Supported Media Types
- application/json
200 Response
Returned when the operation succeeds.
Root Schema : cancelOrder_response
Type:
Show Source
object
-
result:
string
The result of the cancel operation performed.
Example Response (application/json)
{
"result":"success"
}
Default Response
The following are the internal error codes thrown by this API when the request processing fails in Oracle Commerce Cloud:
The error response:
Error Code | Description | Possible Fix |
---|---|---|
200126 | Invalid Input. | The request payload has an error in it e.g. spelling mistake |
200101 | Order is not in a state that can be cancelled. | |
200218 | Invalid cancel reason. | Supply a valid cancel reason. |
210105 | Order not found. | Supply a valid order ID. |
The error response:
Root Schema : errorModel
Type:
Show Source
object
-
devMessage:
string
An optional non-localized message containing technical information for developers
-
errorCode:
string
The numerical code identifying the error
-
errors:
array errors
An optional list of errors if multiple errors were encountered
-
message:
string
The localized message describing the error
-
moreInfo:
string
An optional non-localized message with more information
-
o:errorPath:
string
An optional machine readable description of where the error occurred
-
status:
string
The HTTP status code
-
type:
string
The URI to the HTTP state code definition
Nested Schema : errors
Type:
array
An optional list of errors if multiple errors were encountered
Show Source
Nested Schema : items
Type:
Show Source
object
-
devMessage:
string
An optional non-localized message containing technical information for developers
-
errorCode:
string
The numerical code identifying the error
-
message:
string
The localized message describing the error
-
moreInfo:
string
An optional non-localized message with more information
-
o:errorPath:
string
An optional machine readable description of where the error occurred
-
status:
string
The HTTP status code