Create a client record
Create
| Parameter | Mandatory | Description | Examples | More Info |
|---|---|---|---|---|
| API | Yes | The API area | clients.json | |
| General | Yes | Parameters described in overview | Authorization: Bearer <access_token> header — see Synergist API Authentication | Structure of an API call |
| Action | Yes | The action to perform | action=create | |
| Input | Yes | JSON string | See below |
| JSON Input | Mandatory | Description | Examples |
|---|---|---|---|
| clientCategory | Yes | Client category | "clientCategory":3 |
| clientCode | Yes/No | Client code. Only pass a client code if the company setting "Own client account numbers" is unchecked | "clientCode":"1/BLOGG1" |
| clientName | Yes | Client name | "clientName":"Bloggs Ltd" |
| clientCompanyNumber | Yes | Client company number | "clientCompanyNumber":1 |
Client category is either 1 (lead) 2 (prospect) or 3 (client).
Note: if a lead is created yous should also make a second call to create a related client contact for the lead
Example request (OAuth 2.0):
Authorization: Bearer <access_token>
http://<SERVER>/jsonapi/clients.json?&version=6&action=create&input={
"data": [
{
"clientCategory": 3,
"clientCode": "1/BLOGG1",
"clientName": "Bloggs Ltd",
"clientCompanyNumber": 1
}
]
}
Example request (legacy username/password):
http://<SERVER>/jsonapi/clients.json?&version=6&action=create&input={
"data": [
{
"clientCategory": 3,
"clientCode": "1/BLOGG1",
"clientName": "Bloggs Ltd",
"clientCompanyNumber": 1
}
]
}&user=<username>&password=<password>
Example response:
{
"responsecode": 1,
"responsestatus": "OK",
"errorcode": 0,
"errormessage": "",
"responsemessage": "data processed successfully.",
"warningmessage": "",
"success": true,
"data": [
{
"clientUuid": "AC80A6A24CB212439157C8DFD4F9AC5A",
"clientCode": "1/P2027",
"clientTimeStampModified": 1532593065,
"clientRecordVersionNumber": 0
}
]
}