For the longest time I was using a POST to the “Erp.BO.SalesOrderSvc/SalesOrder” endpoint to create SalesOrders via REST. However after a particular update that endpoint began expierencing a bug where it would create blank releases with 0 quantity even though I never specified to. When I brought this up to Epiccare they said to use the “Erp.BO.SalesOrderSvc/SubmitNewOrder” endpoint instead and this is the recommended way to do this. However I keep getting an InvalidSoldTo error when trying to just create a SalesOrder header this way and cannot figure out why. I’m wondering if anyone else has come across this? I can create a sales order using this information in the client just fine. Any insight would be greatly appreciated.
URL: https://xxx.epicorsaas.com/xxx/api/v2/odata/xxx/Erp.BO.SalesOrderSvc/SubmitNewOrder
Payload:
{
“ds”: {
“OrderHed”: [
{
“OpenOrder”: true,
“VoidOrder”: false,
“Company”: “14281”,
“CustNum”: 5510,
“PONum”: “25867”,
“ReadyToCalc”: true,
“ReadyToFulfill”: true,
“Reference_c”: “”,
“EntryPerson”: “test”,
“ShipToNum”: “”,
“ShipViaCode”: “TSM”,
“FOB”: “ORIGIN”,
“ShipOrderComplete”: true,
“NeedByDate”: “2023-02-23T00:00:00+00:00”,
“WebOrder”: true,
“BTCustNum”: 5510,
“CreditCardOrder”: false,
“OrderSource_c”: “SS”,
“UseOTS”: true,
“OTSName”: “Redacted”,
“OTSAddress1”: “Redacted”,
“OTSAddress2”: “”,
“OTSAddress3”: “”,
“OTSCity”: “Cary”,
“OTSState”: “NC”,
“OTSZIP”: “27519”,
“OTSCountryNum”: 1,
“OrderComment”: “Redacted”,
“InvoiceComment”: “Redacted”,
“Plant”: “104”,
“FreightTerms_c”: “Collect”
}
]
}
}
Error:
{
“HttpStatus”: 400,
“ReasonPhrase”: “REST API Exception”,
“ErrorMessage”: “Order not processed.The following error occurred: Invalid Sold To.”,
“ErrorType”: “Ice.BLException”,
“ErrorDetails”: [
{
“Message”: “Order not processed.The following error occurred: Invalid Sold To.”,
“Type”: “Error”,
“Program”: “Erp.Services.BO.SalesOrder.dll”,
“Method”: “SubmitNewOrder”,
“ColumnNumber”: 21,
“LineNumber”: 33049
}
],
“CorrelationId”: “1ddd84a0-f658-4edb-9c3d-09517eb18130”
}