Managing customers

Use the operations shown below to manage customers.

Retrieving customers

To retrieve all customers, use the GET /customers operation and provide the optional query parameters from the table below.

Query parameter

Type

Description

page

int32

The required page number to return.

per_page

int32

Number of customers to return per page. One of:
1, 2, 5, 10, 20, 50

An example of a request to retrieve all customers is shown below.

curl --request GET \
     --url 'https://sandbox.bond.tech/api/v0/customers?page=1&per_page=5' \
     --header 'Authorization: YOUR-AUTHORIZATION' \
     --header 'Identity: YOUR-IDENTITY'
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://sandbox.bond.tech/api/v0/customers?page=1&per_page=5")

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

request = Net::HTTP::Get.new(url)
request["Identity"] = 'YOUR-IDENTITY'
request["Authorization"] = 'YOUR-AUTHORIZATION'

response = http.request(request)
puts response.read_body
const options = {
  method: 'GET',
  headers: {Identity: 'YOUR-IDENTITY', Authorization: 'YOUR-AUTHORIZATION'}
};

fetch('https://sandbox.bond.tech/api/v0/customers?page=1&per_page=5', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import requests

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

querystring = {"page":"1","per_page":"5"}

headers = {
    "Identity": "YOUR-IDENTITY",
    "Authorization": "YOUR-AUTHORIZATION"
}

response = requests.request("GET", url, headers=headers, params=querystring)

print(response.text)
var client = new RestClient("https://sandbox.bond.tech/api/v0/customers?page=1&per_page=5");
var request = new RestRequest(Method.GET);
request.AddHeader("Identity", "YOUR-IDENTITY");
request.AddHeader("Authorization", "YOUR-AUTHORIZATION");
IRestResponse response = client.Execute(request);
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://sandbox.bond.tech/api/v0/customers?page=1&per_page=5")
  .get()
  .addHeader("Identity", "YOUR-IDENTITY")
  .addHeader("Authorization", "YOUR-AUTHORIZATION")
  .build();

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

An example of a response to a successful request to retrieve all customers is shown below.

[
{
       "customer_id":"931e2341-c3eb-4681-97d4-f6e09d90da14"
       "bond_brand_id":"e0cb152c-51dc-44b0-af3c-5c68341068da"
       "brand_person_id":"8dd4e2de-33be-4bb3-9a19-25069033a5e2"
       "date_created":"2021-02-11T13:26:50.553841+00:00"
       "dob":"1961-03-03"
       "first_name":"sam"
       "middle_name":"amazed"
       "last_name":"smith"
       "kyc_requests_available":3
       "addresses":[...]
}
{
       "customer_id":"4eeb1626-4870-4ff8-9b48-9b1b4386b6cf"
       "bond_brand_id":"e0cb152c-51dc-44b0-af3c-5c68341068da"
       "brand_person_id":"8de4e2de-33be-4bb3-9a19-25069033a5e0"
       "date_created":"2021-02-14T07:58:31.101750+00:00"
       "dob":"1979-03-30"
       "first_name":"Caomhin"
       "middle_name":"Amazing"
       "last_name":"Keller"
       "kyc_requests_available":3
       "addresses":[...]
}
]

To retrieve a single customer, use the GET /customers/{customer_id} operation with no other parameters, as shown in the example below.

curl --request GET \
     --url https://sandbox.bond.tech/api/v0/customers/931e2341-c3eb-4681-97d4-f6e09d90da14 \
     --header 'Authorization: YOUR-AUTHORIZATION' \
     --header 'Identity: YOUR-IDENTITY'
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://sandbox.bond.tech/api/v0/customers/931e2341-c3eb-4681-97d4-f6e09d90da14")

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

request = Net::HTTP::Get.new(url)
request["Identity"] = 'YOUR-IDENTITY'
request["Authorization"] = 'YOUR-AUTHORIZATION'

response = http.request(request)
puts response.read_body
const options = {
  method: 'GET',
  headers: {Identity: 'YOUR-IDENTITY', Authorization: 'YOUR-AUTHORIZATION'}
};

fetch('https://sandbox.bond.tech/api/v0/customers/931e2341-c3eb-4681-97d4-f6e09d90da14', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import requests

url = "https://sandbox.bond.tech/api/v0/customers/931e2341-c3eb-4681-97d4-f6e09d90da14"

headers = {
    "Identity": "YOUR-IDENTITY",
    "Authorization": "YOUR-AUTHORIZATION"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
var client = new RestClient("https://sandbox.bond.tech/api/v0/customers/931e2341-c3eb-4681-97d4-f6e09d90da14");
var request = new RestRequest(Method.GET);
request.AddHeader("Identity", "YOUR-IDENTITY");
request.AddHeader("Authorization", "YOUR-AUTHORIZATION");
IRestResponse response = client.Execute(request);
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://sandbox.bond.tech/api/v0/customers/931e2341-c3eb-4681-97d4-f6e09d90da14")
  .get()
  .addHeader("Identity", "YOUR-IDENTITY")
  .addHeader("Authorization", "YOUR-AUTHORIZATION")
  .build();

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

An example of a response to a successful request to retrieve a customer is shown below.

{
       "customer_id":"931e2341-c3eb-4681-97d4-f6e09d90da14",
       "bond_brand_id":"e0cb152c-51dc-44b0-af3c-5c68341068da",
       "brand_person_id":"8dd4e2de-33be-4bb3-9a19-25069033a5e2",
       "date_created":"2021-02-11T13:26:50.553841+00:00"
       "dob":"1961-03-03",
       "first_name":"sam",
       "middle_name":"amazed",
       "last_name":"smith",
       "kyc_requests_available":3,
       "addresses":[{
              "address_id":"ea1c9454-aa65-46d7-b644-aa757bdc7b2c",
              "address_type":"PHYSICAL",
              "street":"345 California st",
              "street2":"Suit 6002",
              "city":"San Francisco",
              "state":"CA",
              "zip_code":"12345-1234",
              "country":"US",
              "is_primary":true,
              "deliverability":"undeliverable",
              "date_created":"2021-02-11T13:26:50.563963+00:00"
       }]
}

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

Deleting a customer

To delete a customer, use the DELETE /customers/{customer_id} operation with no other parameters, as shown in the example below.

curl --request DELETE \
     --url https://sandbox.bond.tech/api/v0/customers/931e2341-c3eb-4681-97d4-f6e09d90da14 \
     --header 'Authorization: YOUR-AUTHORIZATION' \
     --header 'Identity: YOUR-IDENTITY'
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://sandbox.bond.tech/api/v0/customers/931e2341-c3eb-4681-97d4-f6e09d90da14")

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

request = Net::HTTP::Delete.new(url)
request["Identity"] = 'YOUR-IDENTITY'
request["Authorization"] = 'YOUR-AUTHORIZATION'

response = http.request(request)
puts response.read_body
const options = {
  method: 'DELETE',
  headers: {Identity: 'YOUR-IDENTITY', Authorization: 'YOUR-AUTHORIZATION'}
};

fetch('https://sandbox.bond.tech/api/v0/customers/931e2341-c3eb-4681-97d4-f6e09d90da14', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import requests

url = "https://sandbox.bond.tech/api/v0/customers/931e2341-c3eb-4681-97d4-f6e09d90da14"

headers = {
    "Identity": "YOUR-IDENTITY",
    "Authorization": "YOUR-AUTHORIZATION"
}

response = requests.request("DELETE", url, headers=headers)

print(response.text)
var client = new RestClient("https://sandbox.bond.tech/api/v0/customers/931e2341-c3eb-4681-97d4-f6e09d90da14");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Identity", "YOUR-IDENTITY");
request.AddHeader("Authorization", "YOUR-AUTHORIZATION");
IRestResponse response = client.Execute(request);
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://sandbox.bond.tech/api/v0/customers/931e2341-c3eb-4681-97d4-f6e09d90da14")
  .delete(null)
  .addHeader("Identity", "YOUR-IDENTITY")
  .addHeader("Authorization", "YOUR-AUTHORIZATION")
  .build();

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

If the request is successful, you receive the following response:
Customer resource deleted

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

Updating a customer

To update a customer, use the PATCH /customers/{customer_id} operation and provide the relevant, optional parameters that you want to update, as shown in the table below.

Parameter

Type

Description

brand_person_id

String

Customer ID in UUID format provided by your brand.

dob

Date

Birthday in YYYY-MM-DD format, for example 1994-03-20.

first_name

String

First name, between 1 and 20 characters. Must start with a letter and can only be letters, spaces, and apostrophes.

middle_name

String

Middle name, maximum 20 characters. Must start with a letter and can only be letters, spaces, and apostrophes.

last_name

String

Last name, between 2 and 20 characters. Must start with a letter and can only be letters, spaces, and apostrophes.

addresses
At least one primary address required

Array

Array of one or more physical or mailing addresses (see address Object table below).

The addresses array within customer_id has the following structure.

address Object

Type

Description

address_id
required

String

Address ID in UUID format corresponding to the address to be updated.

address_type
required

String

Either MAILING or PHYSICAL.

street
required

String

Freeform name between 8 and 30 characters. May contain only alphanumeric and these special characters . , _ - #

street2

String

Freeform name between 3 and 20 characters.

city
required

String

Two-character US city code or non-US city code, maximum 20 characters.

state
required

String

Two-character US state code or non-US state code, maximum 20 characters.

zip_code
required

String

Five-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

String

ISO 3166-1 alpha-2 country code, maximum two characters.

is_primary
required

Boolean

Is this the primary address; either true or false.

An example of a request to update a customer's state is shown below.

curl --request PATCH \
     --url https://sandbox.bond.tech/api/v0/customers/customer_id \
     --header 'Authorization: YOUR-AUTHORIZATION' \
     --header 'Content-Type: application/json' \
     --header 'Identity: YOUR-IDENTITY' \
     --data '
{
     "addresses": [
          {
               "address_type": "MAILING",
               "street": "345 California Ave.",
               "state": "WA"
          }
     ]
}
require 'uri'
require 'net/http'
require 'openssl'

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

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

request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request["Identity"] = 'YOUR-IDENTITY'
request["Authorization"] = 'YOUR-AUTHORIZATION'
request.body = "{\"addresses\":[{\"address_type\":\"MAILING\",\"street\":\"345 California Ave.\",\"state\":\"WA\"}]}"

response = http.request(request)
puts response.read_body
const options = {
  method: 'PATCH',
  headers: {
    'Content-Type': 'application/json',
    Identity: 'YOUR-IDENTITY',
    Authorization: 'YOUR-AUTHORIZATION'
  },
  body: JSON.stringify({
    addresses: [{address_type: 'MAILING', street: '345 California Ave.', state: 'WA'}]
  })
};

fetch('https://sandbox.bond.tech/api/v0/customers/customer_id', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import requests

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

payload = {"addresses": [
        {
            "address_type": "MAILING",
            "street": "345 California Ave.",
            "state": "WA"
        }
    ]}
headers = {
    "Content-Type": "application/json",
    "Identity": "YOUR-IDENTITY",
    "Authorization": "YOUR-AUTHORIZATION"
}

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

print(response.text)
var client = new RestClient("https://sandbox.bond.tech/api/v0/customers/customer_id");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Identity", "YOUR-IDENTITY");
request.AddHeader("Authorization", "YOUR-AUTHORIZATION");
request.AddParameter("application/json", "{\"addresses\":[{\"address_type\":\"MAILING\",\"street\":\"345 California Ave.\",\"state\":\"WA\"}]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"addresses\":[{\"address_type\":\"MAILING\",\"street\":\"345 California Ave.\",\"state\":\"WA\"}]}");
Request request = new Request.Builder()
  .url("https://sandbox.bond.tech/api/v0/customers/customer_id")
  .patch(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Identity", "YOUR-IDENTITY")
  .addHeader("Authorization", "YOUR-AUTHORIZATION")
  .build();

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

An example of a response to a successful request to update a customer is shown below.

{
       "customer_id":"931e2341-c3eb-4681-97d4-f6e09d90da14",
       "bond_brand_id":"e0cb152c-51dc-44b0-af3c-5c68341068da",
       "brand_person_id":"8dd4e2de-33be-4bb3-9a19-25069033a5e2",
       "date_created":"2021-02-11T13:26:50.553841+00:00"
       "dob":"1961-03-03",
       "first_name":"sam",
       "middle_name":"amazed",
       "last_name":"McKorkindale",
       "kyc_requests_available":3,
       "addresses":[...]
}

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


Did this page help you?