POST | /SalesOrder/SalesOrderCancel | Cancels a sales order | Uses your API Key, the Number of the sales order you want to cancel (mvSalesOrderNoToCancel) and cancels the specified sales order if its status is Pending or Verified. Optionally, you can use mvInsertUpdateDeleteSourceApplication when an external application ( eg Magento ) is the one that triggers the SalesOrderCancel call.
A. Cancel a sales order. First use The SalesOrderGet to find the Sales Order number
Value: {
"mvSalesOrderNoToCancel": "83",
"mvInsertUpdateDeleteSourceApplication": "WooCommerce"
}
Response: {
"result": true,
"ResponseStatus": {
"ErrorCode": "0"
}
}
B. Trying to cancel an order that is Closed.
Value: {
"mvSalesOrderNoToCancel": 19,
"mvInsertUpdateDeleteSourceApplication": "Magento"
}
Response: {
"result": false,
"ResponseStatus": {
"ErrorCode": "500",
"Message": "A Sales Order can only be Cancelled when the SalesOrderStatus is Pending or Verified. Sales Order Cancel Failed"
},
"InternalErrorCode": ""
}
|
---|