Add new customer for different company using REST API

Hi all,

I am trying to import new customer using REST API. I am not able to change the company name.
It takes a default company name only. Even I am passing different company name that exists but it inserted into the default company only.

Can anyone please help me.

Thanks in advance.

Pinkesh

You cannot do it from Swagger, it does not allow switching companies, it is for test purposes only.
In the tools like PostMan you can set up CallSettings header with the value of the company you want to use, for example: {“Company”:“EPIC03”,“Plant”:“MfgSys”}

2 Likes

Hi Olga,

Thanks for the reply. I tried using code also but unable to change. Can you please advice? What other fields must be changed to apply company change?

Thanks,
Pinkesh

All you need to do is add the CallSettings header like @Olga suggested and set that to the "right’ company.

What postman tells you? any error?

No, I does not give me any error but it goes to default company only.

Can you screenshot what your headers for the call look like in Postman?

1 Like

You are not passing in the CallSettings header we mentioned … that’s the only way to “change” companies in REST

It should be entered here, replace AAA with your company id

5 Likes

@tkoch @Olga and @josecgomez,

Thanks, It works for me. I am really really very thankful. I was searching for this solution for three days.

Thanks a lot.
Pinkesh

1 Like

There is also documentation in the Epicor Help

4 Likes

For me on 10.2.200, I had to use this format:
image

The user you are using for your authorization/credentials needs to be a user in both companies in order to make the change/update.