Create Customer Contact
This API is used to create one or more customer contacts for an existing single account. When sending a request to create multiple contacts in a single call, the result treats them as a single instance so that the result is either All Succeed, or All Fail.
| HTTP URL | |
|---|---|
| POST | /api/v2/customer/{id}/contact |
Eligibility
The Requester is eligible to request to create contacts for its own sub-customers only (one level). The Requester is not allowed to create customer contacts on its own account level or for any other customers.
API Request
Request Structure
| Element | Type | M/O/CM | Description |
|---|---|---|---|
| contact | Object | M | Array of customer contacts object. |
Contact data objects
| Element | Type | M/O/CM | Description |
|---|---|---|---|
| emailAddress | String | M | Contact email address; validated via Regular Expression |
| type | String | O | Contact type, whether owner of the customer or a member. ENUM: OWNER, MEMBER |
| role | String | O | Eligible to enter the self-care application. ENUM: SELFCARE, NONE.Default = NONE |
| salutation | String | O | Contact salutation. ENUM: MR, MS |
| firstName | String | O | Contact first name |
| middleName | String | O | Contact middle name |
| lastName | String | O | Contact last name |
| identity | Object | O | Array of contact identity numbers. |
| gender | String | M | Contact gender.ENUM: MALE, FEMALE |
| birthdate | Date | O | Contact date of birth. Format: DDMMYYYY |
| landlinePhoneNumber | String | CM | CBR, can be reached phone number. Mandatory if mobilePhoneNumber is not provided. |
| mobilePhoneNumber | String | CM | CBR, can be reached phone number. Mandatory if landlinePhoneNumber is not provided. Format: International E.164 |
| additionalPhoneNumber | String | O | Additional phone number where the contact can be reached |
| picture | String | O | Contact photograph (future feature) |
| remarks | String | O | General remarks |
| isPrimary | Boolean | O |
Determines whether the contact is primary or not.
|
Identity data objects
| Element | Type | M/O/CM | Description |
|---|---|---|---|
| idType | String | M | Identity type: ENUM: ID, PASSPORT, DRIVER_LICENSE |
| idNumber | String | M | ID number |
API Response
Response Structure
| Parameter | Type | M/O/CM | Description |
|---|---|---|---|
| errorCode | String | O | Failure code. |
| errorMessage | String | O | Failure message. |
| content | Object | O | Array of main response body object displayed when an API call was successful. For a failure, it will be empty. |
| pageable | Object | O | Paging information object displayed when an API call was successful. For a failure, it will be empty. |
Content data objects
| Element | Type | M/O/CM | Description |
|---|---|---|---|
| requestId | UUID | M |
Request instance ID. To be used by external systems to query the call (operation) status:
|
Pageable data objects
| Element | Type | M/O/CM | Description |
|---|---|---|---|
| page | Numeric | M | Page number |
| size | Numeric | M | Page size. Number of requested elements per page |
| totalPages | Numeric | M | Total amount of available pages per requested page size |
| totalElements | Numeric | M | Total amount of retrieved elements |
Error Codes
In addition to the general success and failure codes, the following error codes are possible.
| Code | Message |
|---|---|
| GLOBAL_1001 | Service unavailable. Please try again |
Examples
Request Body
{
"contact": [
{
"emailAddress": "shaul.cohen@flolive.net",
"type": "OWNER",
"role": "NONE",
"salutation": "MR",
"firstName": "Shaul",
"middleName": "",
"lastName": "Cohen",
"identity": [
{
"idType": "passport",
"idNumber": "123456789"
},
{
"idType": "nationalId",
"idNumber": "987654321"
}
],
"gender": "MALE",
"birthdate": "28122000",
"landlinePhoneNumber": "",
"mobilePhoneNumber": "972542265160",
"additionalPhoneNumber": "",
"picture": "",
"remarks": "",
"isPrimary": true
},
{
"emailAddress": "eyal.cohen@flolive.net",
"type": "MEMBER",
"role": "NONE",
"salutation": "MR",
"firstName": "Eyal",
"middleName": "",
"lastName": "Cohen",
"identity": [
{
"idType": "nationalId",
"idNumber": "52946587"
}
],
"gender": "MALE",
"birthdate": "28062002",
"landlinePhoneNumber": "",
"mobilePhoneNumber": "972542265116",
"additionalPhoneNumber": "",
"picture": "",
"remarks": "",
"isPrimary": false
}
]
}
}
Response Body: Success ACK
{
"errorCode": "",
"errorMessage": "",
"content": [
{
"requestId": "ff74dca6-8e7f-4b85-a42b-13860913b370"
}
],
"pageable": {
"page": 0,
"size": 10,
"totalPages": 1,
"totalElements": 1
}
}
Response Body: Failure NAK
{
"errorCode": "GLOBAL_1001",
"errorMessage": "Service unavailable. Please try again",
"content": "",
"pageable": ""
}