Define Users and Customers

You must define a customer for whom the entitlement will be created. Before creating a customer, you need to define users.

For this tutorial, we will define a user named TestUser and a customer named TestSoftware.

Create a User

You can create a user by using the following API endpoint:

POST /ems/api/v5/contacts

To create a user, set the following mandatory parameters in the input:

Parameter

Value

Meaning

name TestUser Name of the user.

password

EMStest@123

Password of the user.

emailId TestUser@example.com E-mail address of the user.

Sample Input

Use the following JSON to create the user:

{
  "contact": {
    "name": "TestUser",
    "password": EMStest@123,
    "emailId": "TestUser@example.com"
  }
}

Sample Response (Success)

Response Body
{
  "contact": {
    "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "name": "TestUser",
    "emailId": "TestUser@example.com",
    "phoneNumber": "",
    "refId1": "",
    "refId2": "",
    "state": "ENABLE",
    "shippingDetails": "",
    "billingDetails": "",
    "customAttributes": {
      "customAttribute": [
        {
          "name": "Address Line 1",
          "value": ""
        },
        {
          "name": "Address Line 2",
          "value": ""
        },
        {
          "name": "City",
          "value": ""
        },
        {
          "name": "Company",
          "value": ""
        },
        {
          "name": "Company Website",
          "value": ""
        },
        {
          "name": "Contact-patch",
          "value": "Contact-patch-DEFAULT-VALUE"
        },
        {
          "name": "Contact-put",
          "value": "Contact-put-DEFAULT-VALUE"
        },
        {
          "name": "ContactCustAttr1",
          "value": ""
        },
        {
          "name": "Country",
          "value": ""
        },
        {
          "name": "Fax",
          "value": ""
        },
        {
          "name": "First Name",
          "value": ""
        },
        {
          "name": "Last Name",
          "value": ""
        },
        {
          "name": "Phone",
          "value": ""
        },
        {
          "name": "State/Province",
          "value": ""
        },
        {
          "name": "Zip/Postal",
          "value": ""
        }
      ]
    }
  }
}
HTTP Status Code

201 (Created)

Response Header

The auto-generated unique identifier (id) of the new user is returned in the response header. For example:

/api/v5/contacts/xxxxx-xxxxx-xxxxx-xxxxx

Create a Customer

You can create a customer by using the following API endpoint:

POST /ems/api/v5/customers

To create a user, set the following mandatory parameters in the input:

Parameter

Value

Meaning

name TestSoftware Name of the customer.
Associated User    
emailId TestUser@example.com E-mail address of the user (created above) associated with the customer.

Sample Input

Use the following JSON to create the customer :

{
  "customer": {
    "name": "TestSoftware",
    "contacts": {
      "contact": {
        "emailId": "TestUser@example.com"
      }
    }
  }
}

Sample Response (Success)

Response Body
{
  "customer": {
    "id": "001298a6-bb01-41c1-94e9-79a42dd0a1bc",
    "name": "TestSoftware",
    "description": "",
    "identifier": "ddbdc677-fcfc-4513-aaae-db240fb907b3",
    "externalId": "",
    "refId": "",
    "crmId": "",
    "state": "ENABLE",
    "contacts": {
      "contact": {
        "id": "cc0c7280-fbd2-4b57-9acb-236955135bc4",
        "emailId": "TestUser@example.com"
      }
    },
    "customAttributes": {
      "customAttribute": {
        "name": "customerAttr1",
        "value": ""
      }
    }
  }
}
HTTP Status Code

201 (Created)

Response Header

The auto-generated unique identifier (id) of the new customer is returned in the response header. For example:

/api/v5/customers/xxxxx-xxxxx-xxxxx-xxxxx