For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

Name
Data Type
Description

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

post
Authorizations
AuthorizationstringRequired
Body

Request body for Cancel Sales Order Items.

OrderNumberstringRequired

Represents the Sales Order number for which the cancellation request is made.

AutoCancelWaveQtybooleanOptional

Determines whether wave-allocated quantities can be cancelled. false cancels only unallocated quantities. true allows cancellation of allocated but unpicked wave quantities.

CancelWaveQtyCodeintegerRequired

Determines whether wave-allocated quantities can be cancelled. false cancels only unallocated quantities. true allows cancellation of allocated but unpicked wave quantities.

SoLineIdintegerRequired

Unique Sales Order Line ID.

CancelQtyintegerRequired

Quantity to cancel for the specified Sales Order line.

Other propertiesanyOptional
Responses
200

OK

application/json
IsForwardRequestbooleanOptional
MessagestringOptional
MessageTitlestring · nullableOptional
ResultbooleanOptional
post/api/xerp/salesorder/cancelqty
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
    }
  ]
}
200

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?