REST API getting error 400 when using different credentials

Hello All,

I am new to REST API and just using PostMan to do some basic GET and POST functions. I wanted to use a different set of credentials to create Sales Order so I created a new Epicor username with the same access as the “manager” user. However, when I try to use it, it gives out a 400 error.

“HttpStatus”: 400,

"ReasonPhrase": "REST API Exception",

"ErrorMessage": "FOB is required.\r\nTerms Code is required.",

"ErrorType": "Ice.Common.BusinessObjectException",

"ErrorDetails": [

    {

        "Message": "FOB is required.\r\nTerms Code is required.",

        "Type": "Error",

        "Table": "OrderHed",

        "Program": "Epicor.RESTApi.dll",

        "Method": "ThrowUpdateExtRESTApiException",

        "ColumnNumber": 17,

        "LineNumber": 184

    }

Again, it works if I use the “manager” username. is there some area that I need to add the new user to?

Thanks.

Hi Jeffrey,

What happens if you use the new user ID in the regular UI?

it works using Epicor UI Order Entry, if that’s what you’re asking.

Yes. And you’re duplicating all of the methods in your REST client that the trace shows the regular UI is doing?

I log in to E10 using the new user and create a new order. i only have to put the customer ID and the PO Num (required on our side) and then save the order with no issues. on this particular case, FOB is automatically filled be default from the customer record.
This is the PostMan Body:
{
“OpenOrder”: true,
“Company”: “TWG-OK”,
“OrderNum”: 0,
“PONum”: “TESTEC5”,
“ShipToNum”: “WEL1”,
“CustNum”: 581,
“PrcConNum”: 8,
“ShpConNum”: 8,
“WebOrder”: true,
“ShipOrderComplete”: false
}

Is it possible that Territory Security is preventing the customer retrieval and therefore the defaults?

I don’t see why Territory Security would cause this error. How do i check this anyway?

If a user doesn’t have access to a customer’s territory, it will not retrieve the customer record. But now I’m remembering you saying that it worked in the UI so that’s probably not it.

Are you using a scope in your API-Key?

Sorry. I really don’t know much about REST APIs but I didn’t use any (or seen something for that matter) API-key.

Ah, you’re using v1 so no API-Keys required. This is strange Jeffrey…

See if you can test the service with the same user account that’s causing the problem and swagger, just so you can compare the request URLs.

Both Postman and Swagger both would not work and gives out the same error.
Additional info:

  • POST SalesOrderSvc - it works on our test box which is on 10.2.500
  • SalesOrderSvc - will not work on our 2 other test boxes and production which is 10.2.200
  • GET works on all boxes.
  • POST ShipToSvc/ShipToes - works on all boxes