Cancel Sales Order Items
This API allows cancellation of unallocated quantities and optionally allocated wave quantities that have not yet been picked. The system processes cancellations by first cancelling unallocated quantities, and if required and enabled, cancelling allocated wave quantities.
OrderNumber
string, required
Represents the Sales Order number for which the cancellation request is made.
AutoCancelWaveQty
boolean
Determines whether wave-allocated quantities can be cancelled. false cancels only unallocated quantities. true allows cancellation of allocated but unpicked wave quantities.
CancelWaveQtyCode
integer, required
Determines whether wave-allocated quantities can be cancelled. false cancels only unallocated quantities. true allows cancellation of allocated but unpicked wave quantities.
Lines
array, required
Represents the list of Sales Order lines where quantity cancellation is required.
SoLineId
integer, required
Unique Sales Order Line ID.
CancelQty
integer, required
Quantity to cancel for the specified Sales Order line.
Cancellation Logic
Unallocated quantity is cancelled first
If additional quantity needs to be cancelled and AutoCancelWaveQty = true, the system cancels allocated wave quantities
The API also uses Delta Quantity logic when updating cancellations.
Delta Qty = API Cancel Qty -' Existing SO Line Cancel Qty
Only the delta quantity is processed during the update.
Validations
Over-cancellation is not allowed
CancelQty must be less than or equal to the remaining quantity to ship
If AutoCancelWaveQty = false, allocated quantities cannot be cancelled
If the requested quantity exceeds available unpicked quantity in a wave, the API returns an error
Request body for Cancel Sales Order Items.
Represents the Sales Order number for which the cancellation request is made.
Determines whether wave-allocated quantities can be cancelled. false cancels only unallocated quantities. true allows cancellation of allocated but unpicked wave quantities.
Determines whether wave-allocated quantities can be cancelled. false cancels only unallocated quantities. true allows cancellation of allocated but unpicked wave quantities.
Unique Sales Order Line ID.
Quantity to cancel for the specified Sales Order line.
OK
POST /api/xerp/salesorder/cancelqty HTTP/1.1
Host: res.xorosoft.io
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 147
{
"SoEstimateHeader": {
"ThirdPartyRefNo": "SO-EXT-1001",
"CustomerName": "Example Customer"
},
"SoEstimateItemLineArr": [
{
"ItemNumber": "SKU-001",
"Qty": 1
}
]
}OK
{
"Data": [
{
"SoEstimateHeader": {
"CurrencyCode": "USD",
"CustomerName": "12363",
"OrderNumber": "PK172-S015032",
"StatusName": "Released",
"TotalAmount": 100,
"TotalCancelQty": 5
},
"SoEstimateItemLineArr": [
{
"CancelQty": 5,
"Id": 197202,
"ItemNumber": "Plastic body",
"QtyAllocated": 5,
"QtyOrdered": 10,
"QtyRemainingToShip": 5
}
]
}
],
"IsForwardRequest": false,
"Message": "1 order(s) updated successfully.",
"MessageTitle": null,
"Result": true
}Last updated
Was this helpful?