1020: Create account with children

Creates a new user entity and child entities in a single request. This endpoint is a combination of endpoints 1001: Create account and 1005: Create child.

When parent or child contractIDs should be explicitly set, they are passed in as JSON properties, rather than URL segments (as in endpoints 1001 and 1005).

Endpoint ID:

1020

MethodPOST
URL:

/entity/create

Request body:

The entity property is the only required property. The children array is optional, as are the entityContractID and childrenContractID properties.

The entity property is the same as the body of endpoint 1001: Create account

The children property is an array of objects, each of which are the same as the body of endpoint 1005: Create child

entity and children object properties are dependent on the associated contracts.

{
    "entityContractID": 1,
    "entity": {
        "firstName": "John",
        "lastName": "Doe",
        "email": "mailbox@mailserver.com"
    },
    "childrenContractID": 2,
    "children": [
        {
            "firstName": "William",
            "lastName": "Doe",
            "gender": "Male"
        },
        {
            "firstName": "Mary",
            "lastName": "Doe",
            "gender": "Female"
        }
    ]
}


Response body:

A JSON object containing the new entity and children, including id for the newly created entities.

{
    "entity": {
        "id": 123456,
        "firstName": "John",
        "lastName": "Doe",
        "email": "mailbox@mailserver.com"
    },
    "children": [
        {
            "id": 123457,
            "firstName": "William",
            "lastName": "Doe",
            "gender": "Male"
        },
        {
            "id": 123458,
            "firstName": "Mary",
            "lastName": "Doe",
            "gender": "Female"
        }
    ]
}

 

Status codes:201

The entity and children were created with success


303

The entity already exists


400

Request is valid but data validation failed

See 1001: Create account and 1005: Create child for possible errors.