创建非活动帐户

Create inactive account

我想与另一个系统、帐户同步,如果该实体在该系统中处于非活动状态,我想创建处于非活动状态的帐户。一些非常简单的东西,比如:

{       
    "accountnumber": "InactiveAcct",
    "name": "Account that should be created as inactive",
    "description": "demo",
    
    "statecode": 1,
    "statuscode": 2
}

我正在执行 POST 请求,但作为回复我得到:

{
    "error": {
        "code": "0x80048408",
        "message": "2 is not a valid status code for state code AccountState.Active on account with Id e2d0f844-313e-eb11-a813-000d3a795762."
    }
}

很遗憾,您无法创建 (POST) 非活动记录,您必须先创建它,然后进行更新 (PATCH) 调用以标记为非活动记录。这是设计使然,这是一个限制。 Read more

statecode field is not available for create. Record will be always created as active. The only way for you is to do 2 steps operation - create and set as inactive after.

换句话说,statecode=0 被系统设置为默认值,当您在创建负载中传递 statuscode=2 时 - 平台验证开始并说这是无效的对。