Create a Customer

Let's consider the following example. You have a customer in your app and you want to begin the process of creating a switch for that customer. You may show them a screen like the one below where the customer has chosen to begin the switch process.

Create Customer

At this point you need to make sure this customer exists in the ClickSWITCH API. In order to do this you need to send a PUT request to the customers endpoint and either update the existing customer or create the customer record if one does not already exist. Below is an outline of the customers endpoint and what data it expects.

API Endpoint

When you take the customer to this page you need to either create the customer or update the customer by hitting the following API resource:

METHOD ENDPOINT
PUT /customers/{customerKey}

Parameter reference

PARAMETER DESCRIPTION
customerKey
string
A unique identifier for the customer. Can be any string between 1 and 64 characters. It is case sensitive.
email
string
The email for the customer you are creating or updating.
phoneNumber
string
The phone number for the customer you are creating or updating.
accountHolders
array
An array of account holder objects containing the following properties:
  • firstName (string): The account holders first name.
  • middleInitial (string): The account holders middle initial.
  • lastName (string): The account holders last name.
accounts
array
An array of account objects containing the following properties:
  • number (string): The account number for the given account.
  • routingNumber (string): The routing number for the given account.
  • type (string): The type of account (e.g. checking).
  • name (string): A name used to identify the account (e.g. Personal Checking).
addresses
array
An array of address objects containing the following properties:
  • line1 (string): The first line of the street address.
  • line2 (string): The second line of the street address.
  • line3 (string): The third line of the street address.
  • city (string): The name of the city.
  • zip (string): The zip code of the city.
  • state (string): The two digit state code.
  • country (string): The two digit country code.
metadata
object
An object containing any metadata you would like to add to the customer.
context
string
The context value to be returned in the response. This is supplied initially by your app and is returned from the API in the response so that responses can be correlated with requests in JSON-P and batch situations. (This is not required)
*Required field

Example Response Object

{
  "apiVersion": "3.0.1",
  "context": "testing",
  "id": "1",
  "data": {
    "kind": "customer",
    "item": {
      "customerKey": "1283938",
      "email": "joe@gmail.com",
      "metadata": {
        "employee_id": "jsmith",
        "branch": "21"
      },
      "phoneNumber": "string",
      "accountHolders": [
        {
          "firstName": "John",
          "middleInitial": "J",
          "lastName": "Doe"
        },
        {
          "firstName": "Jane",
          "middleInitial": "M",
          "lastName": "Doe"
        }
      ],
      "accounts": [
        [
          {
            "number": "21234567890",
            "type": "checking",
            "name": "Free Checking",
            "routingNumber": "12713873"
          },
          {
            "number": "123123123",
            "type": "savings",
            "name": "Awesome Savings",
            "routingNumber": "12713873"
          }
        ]
      ],
      "addresses": [
        {
          "line1": "129 Main St.",
          "line2": "Apt. 1",
          "line3": "Attn. John",
          "city": "Metropolis",
          "zip": "37484",
          "state": "DE",
          "country": "US"
        }
      ]
    }
  }
}

Once you have created/updated the customer, you will be ready to go onto the next step which is helping the customer select the type.