Updating Customer with REST API

2019-08-27 17:12发布

I am attempting to to update the Status field of an A/R Customer using the REST API. More specifically I am using OAuth2 authentication, have successfully obtained a token, and am attempting to update the Status field of a single customer record selected by using a $filter.

Here's the request I'm using:

PUT /entity/Default/17.200.001/Customer?$filter=CustomerID%20eq%20ABC HTTP/1.1 Content-Type: application/json; charset=utf-8 Authorization: Bearer 44243e3a1393348480857be1ebc34ff9

with the body of the request:

{"Status": {"value": "Inactive"}}

This returns a 500 error. I am new at integrating with Acumatica. What am I doing wrong?

标签: acumatica
2条回答
\"骚年 ilove
2楼-- · 2019-08-27 17:26

You are missing the single quotes for the 'ABC' parameter value.

For customer ABCHOLDING I get the same error when I try:

/entity/Default/17.200.001/Customer?$filter=CustomerID%20eq%20ABCHOLDING

If I enclose 'ABCHOLDING' in quotes then it works:

/entity/Default/17.200.001/Customer?$filter=CustomerID%20eq%20'ABCHOLDING'

查看更多
Luminary・发光体
3楼-- · 2019-08-27 17:36

Since you are using the key field of the Customer screen, the CustomerID field, have you tried just adding the ID directly in the URL without using the filter parameter?

PUT /entity/Default/17.200.001/Customer/ABC

查看更多
登录 后发表回答