Managing customer addresses

Use the operations shown below to manage customer addresses.

Adding an address to a customer

To add an address to a customer, use the POST /customers/{customer_id}/addresses operation and provide parameters as shown in the table below.

Parameter

Type

Description

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 create a customer address is shown below.

curl --request POST \
     --url https://sandbox.bond.tech/api/v0/customers/931e2341-c3eb-4681-97d4-f6e09d90da14/addresses \
     --header 'Authorization: YOUR-AUTHORIZATION' \
     --header 'Content-Type: application/json' \
     --header 'Identity: YOUR-IDENTITY' \
     --data '
{
     "address_type": "MAILING",
     "street": "770 Central Parkway Ave.",
     "city": "San Francisco",
     "state": "CA",
     "zip_code": "12345-4321",
     "country": "US",
     "is_primary": false
}
require 'uri'
require 'net/http'
require 'openssl'

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

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Identity"] = 'YOUR-IDENTITY'
request["Authorization"] = 'YOUR-AUTHORIZATION'
request.body = "{\"address_type\":\"MAILING\",\"street\":\"770 Central Parkway Ave.\",\"city\":\"San Francisco\",\"state\":\"CA\",\"zip_code\":\"12345-4321\",\"country\":\"US\",\"is_primary\":false}"

response = http.request(request)
puts response.read_body
const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Identity: 'YOUR-IDENTITY',
    Authorization: 'YOUR-AUTHORIZATION'
  },
  body: JSON.stringify({
    address_type: 'MAILING',
    street: '770 Central Parkway Ave.',
    city: 'San Francisco',
    state: 'CA',
    zip_code: '12345-4321',
    country: 'US',
    is_primary: false
  })
};

fetch('https://sandbox.bond.tech/api/v0/customers/931e2341-c3eb-4681-97d4-f6e09d90da14/addresses', 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/addresses"

payload = {
    "address_type": "MAILING",
    "street": "770 Central Parkway Ave.",
    "city": "San Francisco",
    "state": "CA",
    "zip_code": "12345-4321",
    "country": "US",
    "is_primary": False
}
headers = {
    "Content-Type": "application/json",
    "Identity": "YOUR-IDENTITY",
    "Authorization": "YOUR-AUTHORIZATION"
}

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

print(response.text)
var client = new RestClient("https://sandbox.bond.tech/api/v0/customers/931e2341-c3eb-4681-97d4-f6e09d90da14/addresses");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Identity", "YOUR-IDENTITY");
request.AddHeader("Authorization", "YOUR-AUTHORIZATION");
request.AddParameter("application/json", "{\"address_type\":\"MAILING\",\"street\":\"770 Central Parkway Ave.\",\"city\":\"San Francisco\",\"state\":\"CA\",\"zip_code\":\"12345-4321\",\"country\":\"US\",\"is_primary\":false}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"address_type\":\"MAILING\",\"street\":\"770 Central Parkway Ave.\",\"city\":\"San Francisco\",\"state\":\"CA\",\"zip_code\":\"12345-4321\",\"country\":\"US\",\"is_primary\":false}");
Request request = new Request.Builder()
  .url("https://sandbox.bond.tech/api/v0/customers/931e2341-c3eb-4681-97d4-f6e09d90da14/addresses")
  .post(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 successful request to create a customer address is shown below.

{
    "customer_id": "8559dec0-2edb-4c3c-a3c5-32de10174c34",
    "brand_person_id": "7b18da9e-0217-4ecb-8454-8c0ab8bedc14",
    "bond_brand_id": "e2b37ab8-5e6e-4538-bbe0-35121b481845",
    "date_created": "2020-10-26T21:48:57.287919",
    "dob": "1997-12-25",
    "first_name": "Christine",
    "middle_name": "J",
    "last_name": "Smith",
    "kyc_requests_available": 3,
    "addresses": [{
        "address_id": "9e8241d2-ac5e-41c6-8b38-b3fe44387266",
        "address_type": "PHYSICAL",
        "street": "345 California St.",
        "street2": "Suit 600",
        "city": "San Francisco",
        "state": "CA",
        "zip_code": "94104-2657",
        "country": "US",
        "is_primary": true,
        "deliverability": "deliverable",
        "date_created": "2020-10-26T21:48:57.287919"
    },
    {
        "address_id": "242c459e-6bd5-4158-89ee-550f0bdd133d",
        "address_type": "MAILING",
        "street": "111 Lake Tahoe Rd.",
        "street2": "",
        "city": "San Francisco",
        "state": "CA",
        "zip_code": "12345",
        "country": "US",
        "is_primary": false,
        "deliverability": "undeliverable",
        "date_created": "2020-10-26T21:48:57.287919"
    }]
}

For a complete specification and interactive examples, see Add an address to a customer in the Bond API Reference.

Deleting a customer address

To delete a customer address, use the DELETE /{customer_id}/addresses/{address_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/addresses/12348579-5d05-4e3e-a5e3-e61e3a5b1234 \
     --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/addresses/12348579-5d05-4e3e-a5e3-e61e3a5b1234")

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/addresses/12348579-5d05-4e3e-a5e3-e61e3a5b1234', 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/addresses/12348579-5d05-4e3e-a5e3-e61e3a5b1234"

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/addresses/12348579-5d05-4e3e-a5e3-e61e3a5b1234");
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/addresses/12348579-5d05-4e3e-a5e3-e61e3a5b1234")
  .delete(null)
  .addHeader("Identity", "YOUR-IDENTITY")
  .addHeader("Authorization", "YOUR-AUTHORIZATION")
  .build();

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

If your request to delete a customer address was successful, you receive the following message:
Customer resource deleted

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


Did this page help you?