Create Customer

The CreateCustomer API in OCS.io streamlines the process of adding new customer records by offering flexible customization options.

API Overview

Fields Required for Customer Creation

The following table lists and describes the fields required to create a customer through the CreateCustomer API:

Field Description

customerProfile

Profile of the Customer to be used for creation. Customer Profile must be configured.

externalId

External ID of the Customer.

customerSegment

Segment of the Customer. Customer Segment must be configured.

customName

Custom Customer name.

customAttributes

Custom attributes, Key - Value (String) Map.

state

Initial State of the Customer.

testCustomer

Indicates whether Customer is a Test Customer.

Detailed API documentation and endpoint specifics are available here.

Request Validations

The following validations are performed when creating a customer:

Create Customer Examples

1. Create Customer by Profile

Creating a customer in OCS.io is most straightforward when using a pre-configured customer profile. For more information on setting up customer profiles, see the configuration guide here.

The following example illustrates how to create a customer using this method:

{
  "requestId": "{{$guid}}",
  "externalId": "customer_external_id",
  "customerProfile": "b2b"
}

2. Extend Customer Creation with Additional Attributes

To enhance a basic customer profile with additional attributes, such as a custom name, you can modify the initial request as shown below:

{
  "requestId": "{{$guid}}",
  "externalId": "customer_external_id",
  "customerProfile": "b2b",
  "customAttributes": {
    "key1": "value 1",
    "key2": "value 2"
  },
  "customName": "Demo Customer"
}

3. Create Customer by Specifying All Attributes

For complete customization, create a customer by providing all necessary attributes directly:

{
  "requestId": "{{$guid}}",
  "externalId": "customer_external_id",
  "customerSegment": "b2b",
  "customAttributes": {
    "key1": "value 1",
    "key2": "value 2"
  },
  "state" : {
    "state": "ACTIVE",
    "stateReason": "active"
  },
  "customName": "Demo Customer"
}