Create or update a client
POST/clients
Mambu allows for creation and updating of client information. This includes client's personal and contact information, custom fields, identification documents and the address. The client is returned as a response.
You can provide some basic information as a request with query parameters and no body, however, if you need to create a client with more complex information, such as custom fields, we recommend posting with a JSON body.
- If the "idDocuments":[],"addresses":[], or "customInformation":[] arrays are not provided, only the client information will be updated/stored
- For JSON update, the developer must specify the client ID in the path ({/api/clients/{id}} and also provide the encodedKey in the JSON body
{
client: {
encodedKey:"someKey"
}
}
If the encoded key/identifier is invalid, an exception code will be returned
In order to remove all custom fields, identification documents or addresses, you can send an empty array:
{
"client": {
"encodedKey":"abc",
//other client information
},
"idDocuments":[],
"addresses":[],
"customInformation":[]
}
- If you are updating only one entry in an array (ID document, Custom Information, Addresses) you must also provide the information for the other members of the array otherwise these will be deleted
- For example :if there are 3 custom fields in database and only one provided in the "customInformation" array for update, the other 2 from the database will get deleted and only the one from the POST request will get stored/updated
- For custom fields - the matching to determine the difference between an updated and a new field is done using customFieldID
- For custom fields - if the custom field ID is invalid or the value is invalid an exception code will be returned
- For custom fields - Date custom fields are currently date only, not date-time. Please follow CIF-22 for updates on the development of this functionality.
- See Custom Fields API for more information about custom fields and custom fields sets
- For identification documents and addresses the encoded key is used for matching
- Only one address can be stored/updated in database, if the addresses array contains more than one address, only the first address will get stored/updated
- Notifications should be sent when a client is created via APIs (If there are templates added for client creation and the client has email address / mobile phone number)
When making a POST request that sends data through query parameters, the Content-Type header must not be set.
Create a client with minimal data using query parameters
POST /api/clients?firstName=Trevor&lastName=Linden&emailAddress=trevor.linden%40mambu.com
Create a client with minimal data using JSON
{
"client":{
"firstName":"Trevor",
"lastName":"Linden",
"middleName":"Good",
"homePhone":"7899221665",
"emailAddress":"trevor.linden@mambu.com",
"mobilePhone1":"211111111",
"mobilePhone2":"122222222",
"gender":"MALE",
"clientRole": {"encodedKey":"d9df8bc78a0234ccc934a845c"}
}
}
Request
Responses
- 200
ok