OrderMscs not setting via REST API

Building out code to create orders from our online store, into epicor and I’m almost there.

Problem is, Misc charges aren’t getting added. We use misc charges for shipping costs.

I’ve tried everything but it’s not coming across. Everything else is.

I’m using this call: /{currentCompany}/Erp.BO.SalesOrderSvc/SalesOrders

My Json (edited out details)
{
“OpenOrder”: true,
“VoidOrder”: false,
“Company”: “11111”,
“CustNum”: 1111,
“PONum”:“11111”,
“OrderHeld”: false,
“EntryPerson”: “111111”,
“ShipToNum”: “11111”,
“RequestDate”: “2021-03-05T16:07:01.918Z”,
“OrderDate”: “2021-03-05T16:07:01.918Z”,
“ShipViaCode”: “”,
“TermsCode”: “PP”,
“OrderComment”: “ORDER 11111”,
“ShipComment”: “test”,
“ShortChar01”:“Ship”,
“WebOrder”:false,
“EntryProcess”: “API”,
“SalesRepCode1”:“EComm”,
“TermsCodeDescription”:“Prepay”,
“ShortChar10”:“OL2”,
“TotalTax”:4.99000,
“DocTotalTax”:4.9900,
“TaxRegionCode”:“NT”,
“OrderDtls”: [
{
“Company”: “111111”,
“OrderLine”: 1,
“LineType”: “PART”,
“PartNum”: “111111111”,
“DocUnitPrice”:39.99000,
“IUM”:“EA”,
“OrderQty”:4.00,
“DocDiscount”:1.000,
“DocMiscCharges”: 10,
“MiscCharges”: 10,
“ProdCode”:“MERCH”,
“SalesRepName1”: “ECommerce”,
“Warranty”:false,
“SalesUM”:“EA”,
“SellingQuantity”:1.00000000,
“OrderMscs”: [
{
“MiscAmt”: 10.00,
“MiscCode”:“FRT”,
“Description”:“FREIGHT”,
“DocMiscAmt”:10.000,
“FreqCode”:“F”,
“Quoting”:"",
“Linked”:false,
“MiscCodeDescription”:“FREIGHT”
}
]
}
]
}

Any ideas? Everything else makes it through but it skips the Misc order information.

Maybe because there is no OrderLine, try to pass all the fields and see what happens.

I did that. No go. I tired the orderline, thinking the same, got nothing. I’ve sent all the fields and it didn’t effect anything.

Dtls and SalesOrder, all that makes it. Just the OrderMscs doesn’t.

Another thing worth noting, when I’ve already created the sales order, using the above JSON. I can then send another request to post the Mscs info. And it works. But if I send the same json chunk inserted into the Salesorder call, I get nothing. Missing something. Just don’t know what.

Sending a call to:
/{currentCompany}/Erp.BO.SalesOrderSvc/OrderMscs

JSON:
{
“Company”: “11111”,
“OrderNum”: 1111,
“OrderLine”: 1,
“MiscAmt”: 10.00,
“MiscCode”:“FRT”,
“Description”:“FREIGHT”,
“DocMiscAmt”:10.000,
“FreqCode”:“F”,
“Quoting”:"",
“Linked”:false,
“MiscCodeDescription”:“FREIGHT”
}

If it is meant to be an Header Misc charge, the OrderLine should be 0 (zero).

I did try 0 too. No go. It’s a line misc charge.

Oddly enough, if I add these two lines to the Salesorder Json, it will show the misc charges but still nothing shows on the misc charges tab on the sales order.

“TotalMisc”: 10,
“DocTotalMisc”: 10,

Maybe that is what we’ll do or I’ll just do a secondary call for all sales orders to post the misc charges. Prefer to do one call but I can’t seem to get it to work.

I’m not sure if it is a bug or not but since there is no direct relationship between OrderHed and OrderMsc it is not processed, putting it at the same level as OrderDtls throws an error, and within OrderDtls it seems it is not recognized. Maybe there is no logic to process so many levels of child tables and only the first level is processed.

I’d recommend creating a simple header using the SalesOrders endpoint and lines/charges using the OrderDtls endpoint.

For header charges you would use the SalesOrders endpoint.

Makes sense. Seems to be what I’m seeing as well. I’m thinking of just making two calls at this point.

Create everything on the first call and add the second call to handle the misc charges for freight.

I wouldn’t think much of it but the main call (/{currentCompany}/Erp.BO.SalesOrderSvc/SalesOrders) shows it all combined as one post call. Was hoping that would be the case. Oh well.