How to Ensure the Failure of the Entire Create ASN Process if Any Line Data Is Incorrect?
I am currently in the process of creating an ASN using the Rest API, and I have a query regarding the handling of incorrect data in the payload.
In my payload, there are two lines, and I would like to ensure that if any of the line data is incorrect, the entire creation process fails. Is there a way to do this?
This is my sample payload:
{
"ReceiptSourceCode": "",
"ASNType": "",
"ShipmentNumber": "",
"ShippedDate": "",
"ExpectedReceiptDate": "",
"FreightCarrierName": "",
"NumberOfPackingUnits": "",
"PackagingCode": "",
"VendorName": "",
"Comments": "",
"EmployeeId": "",
"lines": [
{
"ReceiptSourceCode": "",
"SourceDocumentCode": "",
"OrganizationCode": "",
"DocumentNumber": "",
"ItemNumber": "",
"DocumentLineNumber": "",
"Quantity": "",
"DocumentShipmentLineNumber": "",
"UnitOfMeasure": "",
"UOMCode": "",
"SecondaryQuantity": "",
"SecondaryUOMCode": "",
"CountryOfOriginCode": "",
"ASNPackingUnits": [
""
],
"lotItemLots": [
{
"LotNumber": "",
"LotExpirationDate": "",
"TransactionQuantity": "",
"SecondaryTransactionQuantity": "",
}
]
},
{
"ReceiptSourceCode": "",
"SourceDocumentCode": "",