I am running into an issue trying to POST invoices to the Epicor REST API.
/api/v1/Erp.BO.ARInvoiceSvc/ARInvoices/
Here’s my payload:
{
"Company": "TST",
"InvoiceNum": 0,
"OrderNum": 12221,
"CustNum": "4262",
"GroupID": "GRP1",
"TermsCode": "PRE",
"FiscalYear": 2023,
"FiscalPeriod": 6,
"FiscalCalendarID": "Main",
"CustomerCustID": "CustN",
"BTCustomerName": "Cust Name",
"SoldToCustomerName": "Cust Name",
"CustomerName": "Cust Name",
"SoldToCustNum": "4244"
}
Here’s the error I’m getting:
{
"HttpStatus": 400,
"ReasonPhrase": "REST API Exception",
"ErrorMessage": "Sales Order is required.",
"ErrorType": "Ice.Common.BusinessObjectException",
"ErrorDetails": [
{
"Message": "Sales Order is required.",
"Type": "Error",
"Table": "InvcHead",
"Program": "Epicor.RESTApi.Common.dll",
"Method": "ThrowUpdateExtException",
"ColumnNumber": 17,
"LineNumber": 27
}
],
"CorrelationId": "7fdb80b3-c096-4b7f-82b3-feba1dfcf128"
}
As you can see, I am passing the OrderNum (which refers to a sales order).
If anyone has run into this issue before and has some knowledge to share, I’d appreciate it.
Thank you!