Creating a customer

How to create a customer and how to add their details to the system.

Overview

The first thing your customer will need to do is submit their details like their name and address in your onboarding flow. After your customer enters this information, you'll see that a Customer resource has been created. This Customer resource gives you a way to reference and call customer accounts, and to facilitate account management.

Creating a customer

To create an instance of a customer object, use the POST /customers/ operation and provide the parameters as shown in the table below.

▶ Run in Postman

ParameterTypeDescription
brand_person_idstringCustomer ID in UUID format provided by your brand.
dob
required
dateBirthday in YYYY-MM-DD format, for example 1994-03-20.
first_name
required
stringFirst name, between 2 and 50 characters. Must start with a letter and can only be letters, spaces, and apostrophes.
middle_namestringMiddle name, between 2 and 50 characters. Must start with a letter and can only be letters, spaces, and apostrophes.
last_name
required
stringLast name, between 2 and 50 characters. Must start with a letter and can only be letters, spaces, and apostrophes.
phonestringUser's phone number. Must be only numbers or dash-separated.
phone_country_codestringCountry dialing code. Between one and three digits.
emailstringUser's valid email address.
addresses
At least one primary address required
arrayArray of one or more physical or mailing addresses (see address Object table below).

The addresses array within the Customer object has the following structure.

address ObjectTypeDescription
address_type
required
stringEither MAILING or PHYSICAL.
street
required
stringFreeform name between 1 and 40 characters. May contain only alphanumeric and these special characters . , _ - #
street2stringFreeform name maximum 40 characters.
city
required
stringCity name, freeform between 2 and 40 characters.
state
required
stringTwo-character US state code. Non-US state code maximum 20 characters.
zip_code
required
stringFive-digit US zip code, (for example 12345) or nine-digit US zip code, (for example 12345-1234).
Non-US state code between 2 and 20 characters.
country
required
stringISO 3166-1 alpha-2 country code, maximum two characters.
is_primary
required
booleanIs this the primary address; either true or false.

An example of a request to create a customer is shown below.

curl --request POST \
  --url https://sandbox.bond.tech/api/v0/customers/ \
  --header 'Identity: YOUR-IDENTITY' \
  --header 'Authorization: YOUR-AUTHORIZATION' \
  --header 'Content-Type: application/json' \
  --data '{
    "brand_person_id": "YOUR-USER-ID",
    "dob":"1999-12-25",
    "last_name":"Smith",
    "first_name":"Christine",
    "phone": "6505148972",
    "email": "[email protected]",
    "addresses":[
      {
        "address_type":"PHYSICAL",
        "street":"345 California Ave.",
        "street2": "Suit 600",
        "city": "San Francisco",
        "state": "CA",
        "zip_code": "12345-1234",
        "country": "US",
        "is_primary": true
      },
      {
        "address_type":"MAILING",
        "street":"101 Lake Tahoe Rd.",
        "street2": "Suit 01",
        "city": "San Francisco",
        "state": "CA",
        "zip_code": "12345",
        "country": "US",
        "is_primary": false
      }
    ]
  }'
import requests

url = "https://sandbox.bond.tech/api/v0/customers/"

payload = {
    "brand_person_id": "1ecc76ed-d0ac-446c-b13a-480b4b042c28",
    "dob": "1968-04-13",
    "first_name": "James",
    "middle_name": "Herbert",
    "last_name": "Bond",
    "phone": "555-111-2222",
    "phone_country_code": "1",
    "email": "[email protected]",
    "addresses": [
        {
            "address_id": "9f62fd5b-95cc-4ec7-93f2-43da75aac5fe",
            "address_type": "MAILING",
            "street": "345 California Ave.",
            "street2": "Suite 600",
            "city": "San Francisco",
            "state": "CA",
            "zip_code": "12345-1234",
            "country": "US",
            "is_primary": True
        }
    ]
}
headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Identity": "YOUR-IDENTITY"
}

response = requests.request("POST", url, json=payload, headers=headers)

print(response.text)
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://sandbox.bond.tech/api/v0/customers/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/json'
request["Content-Type"] = 'application/json'
request["Identity"] = 'YOUR-IDENTITY'
request.body = "{\"brand_person_id\":\"1ecc76ed-d0ac-446c-b13a-480b4b042c28\",\"dob\":\"1968-04-13\",\"first_name\":\"James\",\"middle_name\":\"Herbert\",\"last_name\":\"Bond\",\"phone\":\"555-111-2222\",\"phone_country_code\":\"1\",\"email\":\"[email protected]\",\"addresses\":[{\"address_id\":\"9f62fd5b-95cc-4ec7-93f2-43da75aac5fe\",\"address_type\":\"MAILING\",\"street\":\"345 California Ave.\",\"street2\":\"Suite 600\",\"city\":\"San Francisco\",\"state\":\"CA\",\"zip_code\":\"12345-1234\",\"country\":\"US\",\"is_primary\":true}]}"

response = http.request(request)
puts response.read_body
const options = {
  method: 'POST',
  headers: {
    Accept: 'application/json',
    'Content-Type': 'application/json',
    Identity: 'YOUR-IDENTITY'
  },
  body: JSON.stringify({
    brand_person_id: '1ecc76ed-d0ac-446c-b13a-480b4b042c28',
    dob: '1968-04-13',
    first_name: 'James',
    middle_name: 'Herbert',
    last_name: 'Bond',
    phone: '555-111-2222',
    phone_country_code: '1',
    email: '[email protected]',
    addresses: [
      {
        address_id: '9f62fd5b-95cc-4ec7-93f2-43da75aac5fe',
        address_type: 'MAILING',
        street: '345 California Ave.',
        street2: 'Suite 600',
        city: 'San Francisco',
        state: 'CA',
        zip_code: '12345-1234',
        country: 'US',
        is_primary: true
      }
    ]
  })
};

fetch('https://sandbox.bond.tech/api/v0/customers/', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
var client = new RestClient("https://sandbox.bond.tech/api/v0/customers/");
var request = new RestRequest(Method.POST);
request.AddHeader("Accept", "application/json");
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Identity", "YOUR-IDENTITY");
request.AddParameter("application/json", "{\"brand_person_id\":\"1ecc76ed-d0ac-446c-b13a-480b4b042c28\",\"dob\":\"1968-04-13\",\"first_name\":\"James\",\"middle_name\":\"Herbert\",\"last_name\":\"Bond\",\"phone\":\"555-111-2222\",\"phone_country_code\":\"1\",\"email\":\"[email protected]\",\"addresses\":[{\"address_id\":\"9f62fd5b-95cc-4ec7-93f2-43da75aac5fe\",\"address_type\":\"MAILING\",\"street\":\"345 California Ave.\",\"street2\":\"Suite 600\",\"city\":\"San Francisco\",\"state\":\"CA\",\"zip_code\":\"12345-1234\",\"country\":\"US\",\"is_primary\":true}]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"brand_person_id\":\"1ecc76ed-d0ac-446c-b13a-480b4b042c28\",\"dob\":\"1968-04-13\",\"first_name\":\"James\",\"middle_name\":\"Herbert\",\"last_name\":\"Bond\",\"phone\":\"555-111-2222\",\"phone_country_code\":\"1\",\"email\":\"[email protected]\",\"addresses\":[{\"address_id\":\"9f62fd5b-95cc-4ec7-93f2-43da75aac5fe\",\"address_type\":\"MAILING\",\"street\":\"345 California Ave.\",\"street2\":\"Suite 600\",\"city\":\"San Francisco\",\"state\":\"CA\",\"zip_code\":\"12345-1234\",\"country\":\"US\",\"is_primary\":true}]}");
Request request = new Request.Builder()
  .url("https://sandbox.bond.tech/api/v0/customers/")
  .post(body)
  .addHeader("Accept", "application/json")
  .addHeader("Content-Type", "application/json")
  .addHeader("Identity", "YOUR-IDENTITY")
  .build();

Response response = client.newCall(request).execute();

The JSON response contains all the information related to the newly created customer. It also includes the customer_id which is a unique Bond platform identifier for your customer. The customer_id is used in subsequent API calls to retrieve and update the customer resource, initiate KYC, and issue cards. An example of a response to a successful request to create a customer is shown below.

{
    "customer_id": "f637cca2-c070-453d-b2eb-8c74f8640c7b",
    "brand_person_id": "8dd4e2de-33be-4bb3-9a19-25069033a5e0",
    "bond_brand_id": "fa538529-9396-4f47-b442-4092227b7477",
    "date_created": "2020-10-23T22:18:09.327165",
    "dob": "1999-12-25",
    "first_name": "Christine",
    "middle_name": "",
    "last_name": "Smith",
    "phone": "6504359109",
    "email": "[email protected]",
    "addresses": [
        {
            "address_id": "091c79fe-d197-4720-9f8b-5eb6757b971b",
            "address_type": "PHYSICAL",
            "street": "345 California St.",
            "street2": "STE 600",
            "city": "San Francisco",
            "state": "CA",
            "zip_code": "94104-2657",
            "country": "US",
            "is_primary": true,
            "deliverability": "deliverable",
            "date_created": "2020-10-23T22:18:09.340601"
        },
        {
          "address_id": "ba5572e6-bb16-46a5-a95f-fb8aba019aff",
          "address_type": "MAILING",
          "street": "101 Lake Tahoe Rd.",
          "street2": "Suit 01",
          "city": "San Francisco",
          "state": "CA",
          "zip_code": "12345",
          "country": "US",
          "is_primary": false,
          "deliverability": "undeliverable",
          "date_created": "2020-10-23T22:18:09.340601"
        } 
    ]
}

For a complete specification and interactive examples, see Creating a customer in the Bond API Reference.

Trying to create a customer with a missing field

If you try to create a customer with a missing field, you receive a JSON error message similar to the one shown below.

400
{
       'Message': {'last_name': ['Missing data for required field.']},
       'Status': 400,
       'Code': 'create_customer_schema',0
       'Type': 'Request Error'
}

Creating a customer using the same brand_person_id

The brand_person_id is a unique number that you use to identify your customer and is one of the fields that must be provided when you create a customer.

📘

Note

This is not the same as the customer_id which is generated by the API and returned to you in the response.

If you try to create a new customer using an existing brand_person_id that belongs to another customer, you receive an error message similar to the one shown below.

400
{
       'Message': 'A person with this ID already exists. Please choose another',
       'Status': 400,
       'Code': 'person_id_dup',
       'Type': 'Request Error'
}

For a complete specification and interactive examples, see Creating a customer in the Bond API Reference.