I’m trying to create a customer using the Epicor REST API. I’m using the “Erp.BO.CustomerSvc” service to create the customer.
But I’m getting this error about “Object reference not set to an instance of an object.”
Below is the full response of the error
{
"HttpStatus": 500,
"ReasonPhrase": "REST API Exception",
"ErrorMessage": "Object reference not set to an instance of an object.",
"ErrorType": "System.NullReferenceException",
"CorrelationId": "76f5b59f-c92d-4139-9c53-fd3becdd5a7a"
}
And here is what I’m passing as the payload :
{
"Company": "xxx",
"FirstName": "John",
"LastName": "Doe",
"ContactName": "John Doe",
"CustNum": 0,
"CustID": "12345",
"CustomerName": "Light Company",
"ContactCustomers": [
{
"Company": "xxx",
"CustID": "1234",
"CustNum": 0,
"Name": "John Doe",
"Address1": "22 man entrance",
"City": "Ontario",
"State": "Ontario",
"Zip": "9093",
"Country": "CA"
}
]
}