All Classes Pages
CreateIndividualCustomerPage Class Reference

More...

Detailed Description

Create Individual Customer

Overview

This API allows user to create an individual customer. An individual customer can have only one Contact Person, and the Contact Person may have one or more Contact Points.
Only one customer can be created at a time.

Since
11.6.0.3

APIs

Method URL Description
POST /ws/v12/interaction/customer Create individual customer.

Authentication

Authentication is required. The client must be logged in to call this API. Each API request must contain X-egain-session request header returned by Login API.

Permissions

All of the following are required:

  • User must have 'Create Customer' action.
  • If "Customer departmentalization" setting is enabled in the application, then created customer must belong to either the user's home department, or to the department where the user is a foreign user.

Licenses

The logged in user must have the following licenses:

Request

Request headers

Name Description Allowed values Default value
X-egain-session Session ID obtained from Login API response header N/A N/A
Accept Content type accepted by client. application/xml or application/json N/A
Content-Type Media type sent by the client application/xml or application/json N/A
Accept-Language Language locale accepted by client (used for locale specific fields in resource representation and in error responses) Supported 'Accept-Language' header codes default system language

Request Body

The request body is mandatory. Request body can be in either XML or JSON format:

Elements required in request body

Name Description
department.name Name of the department in which the customer should be created. Department name is required only If "Customer departmentalization" setting is enabled in the application.
type.value Must be "individual".
contactPersons.contactPerson Only one contact person can be created for an individual customer. For required and optional elements of contact person, refer Create Contact Person.

Optional elements allowed in request body

Name Description
level Must be one of the values configured in application.
role Must be one of 'Partner', 'Reseller', or 'Customer'.
Pin Must not exceed 255 characters.
howReferred Must be one of 'Website', 'Customer', 'Partner', 'Employee', or 'Reseller'.
industry Must match the value configured in application.
marketSegment Must not exceed 50 characters.
entitlements Must not exceed 1024 characters.
customAttributes Name must match one of the custom attributes configured in application. If the custom attribute is configured as an enumeration, the value must be one of the predefined values.
For string type of custom attribute that is not configured as an enumeration, refer list of Allowed Characters For Custom Attributes.

Request body XML schemas:

  • schema-interaction-Customers

Supported API specific query parameters

None

Supported common query parameters

None

Response

Response headers

Name Description Possible values
X-egain-session Session ID of the current user session N/A
Content-Type Media type of response body application/xml or application/json
Location Location of the new created customer N/A

Response body XML schemas:

  • schema-kb-WSError - used in case of error

HTTP status codes

Success Status codes

201 - Created

  • The request was successfully executed.

Failure Status codes

400 - Bad Request

  • Any query parameter is sent in the request.
  • Request body does not contain the required elements.
  • An unsupported element is present in the request body.
  • Elements provided do not adhere to the rules stated in the Request Body section.
  • Request body is empty.

401 - Unauthorized

  • X-egain-session request header is missing.
  • Session is invalid or expired.

403 - Forbidden

  • The user does not have sufficient permissions. Refer Permissions section for details.

500 - Internal server error

Examples:

Example 1 - Create customer with required elements
Example 2 - Create customer with all elements