Skip to main content
Skip table of contents

API Sign up customers / Create a customer

Step 1: Generate an OAuth token

See Create an OAuth token for details.

Step 2. Sign up a customer by using the "create CRM account" API operation

The following Postman and cURL code sample performs the following tasks:

  • Creates an account with account number CLASSIC-C00 and owned by "John Smith"

  • Creates a check payment method associated with the account

Postman example:

CODE
{{opencell.url}}/account/accountHierarchy/createOrUpdateCRMAccountHierarchy
CODE
{
  "crmAccountType" : "C_UA",
  "crmParentCode" : "{{seller.code}}",
  "code" : "{{account.code}}",
  "description": "{{account.description}}",
  "name" : {
    "title" : "MR",
    "firstName" : "{{account.firstname}}",
    "lastName" : "{{account.lastname}}"
  },
  "isCompany": true,
  "subscriptionDate": "2018-01-10",
  "jobTitle": "CEO",
  "vatNo": "12345678901234",
  "registrationNo": "12354678901234",
  "address" : {
    "address1" : "{{$randomStreetAddress}}",
    "address2" : null,
    "address3" : null,
    "zipCode" : "{{$randomInt}}",
    "city" : "{{$randomCity}}",
    "country" : "FR"
  },
  "contactInformation" : {
    "email" : "qa@opencellsoft.com",
    "mobile" : "+33123546789"
  },
  "email" : "qa@opencellsoft.com",
  "language" : "FRA",
  "paymentMethod" : "CHECK",
  "customerCategory" : "CLIENT",
  "currency" : "EUR",
  "billingCycle" : "BC_MONTHLY_1ST",
  "country" : "FR",
  "electronicBilling" : "true",
  "customFields": null
}

cURL example:

CODE
curl --location 'https://sandbox.oc-sb.eu/opencell/api/rest/account/accountHierarchy/createOrUpdateCRMAccountHierarchy' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{access_token}}' \
--data-raw '{
  "crmAccountType" : "C_UA",
  "crmParentCode" : "MAIN_SELLER",
  "code" : "CLASSIC-C00",
  "description": "John Smith",
  "name" : {
    "title" : "MR",
    "firstName" : "John",
    "lastName" : "Smith"
  },
  "isCompany": true,
  "subscriptionDate": "2018-01-10",
  "jobTitle": "CMO",
  "vatNo": "12345678901234",
  "registrationNo": "12354678901234",
  "address" : {
    "address1" : "673 Eugene Points",
    "zipCode" : "92136",
    "city" : "New Taryn",
    "country" : "FR"
  },
  "contactInformation" : {
    "email" : "qa@opencellsoft.com",
    "mobile" : "+33123546789"
  },
  "email" : "qa@opencellsoft.com",
  "language" : "FRA",
  "paymentMethod" : "CHECK",
  "customerCategory" : "CLIENT",
  "currency" : "EUR",
  "billingCycle" : "BC_MONTHLY_1ST",
  "country" : "FR",
  "electronicBilling" : "true",
  "customFields": null
}'

Answer: Code 200 with the following body

CODE
{
    "status": "SUCCESS",
    "message": ""
}
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.