Managing accounts

How to manage accounts, for example close an account.

Overview

This article describes how to:

Activating and deactivating accounts

To activate and deactivate an account, use the PATCH /accounts/{account_id} operation and provide the parameter as shown in the table below.

Parameter

Type

Description

status

string

Either active or inactive.

An example of an account status change request is shown below.

curl --request PATCH \
     --url https://sandbox.bond.tech/api/v0.1/accounts/7c45101a-82de-49e5-b01d-50151b54312d \
     --header 'Accept: application/json' \
     --header 'Authorization: YOUR-AUTHENTICATION' \
     --header 'Content-Type: application/json' \
     --header 'Identity: YOUR-IDENTITY' \
     --data '{"status":"active"}'
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://sandbox.bond.tech/api/v0.1/accounts/7c45101a-82de-49e5-b01d-50151b54312d")

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

request = Net::HTTP::Patch.new(url)
request["Accept"] = 'application/json'
request["Content-Type"] = 'application/json'
request["Identity"] = 'YOUR-IDENTITY'
request["Authorization"] = 'YOUR-AUTHENTICATION'
request.body = "{\"status\":\"active\"}"

response = http.request(request)
puts response.read_body
import requests

url = "https://sandbox.bond.tech/api/v0.1/accounts/7c45101a-82de-49e5-b01d-50151b54312d"

payload = {"status": "active"}
headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Identity": "YOUR-IDENTITY",
    "Authorization": "YOUR-AUTHENTICATION"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'PATCH',
  headers: {
    Accept: 'application/json',
    'Content-Type': 'application/json',
    Identity: 'YOUR-IDENTITY',
    Authorization: 'YOUR-AUTHENTICATION'
  },
  body: JSON.stringify({status: 'active'})
};

fetch('https://sandbox.bond.tech/api/v0.1/accounts/7c45101a-82de-49e5-b01d-50151b54312d', 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.1/accounts/7c45101a-82de-49e5-b01d-50151b54312d");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Accept", "application/json");
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Identity", "YOUR-IDENTITY");
request.AddHeader("Authorization", "YOUR-AUTHENTICATION");
request.AddParameter("application/json", "{\"status\":\"active\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"status\":\"active\"}");
Request request = new Request.Builder()
  .url("https://sandbox.bond.tech/api/v0.1/accounts/7c45101a-82de-49e5-b01d-50151b54312d")
  .patch(body)
  .addHeader("Accept", "application/json")
  .addHeader("Content-Type", "application/json")
  .addHeader("Identity", "YOUR-IDENTITY")
  .addHeader("Authorization", "YOUR-AUTHENTICATION")
  .build();

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

Examples of responses to successful account status change requests are shown below.

{
  "account_id": "057c6074-a02d-4a5a-bad9-bbc64b047df7",
  "date_updated": "2020-08-16T19:39:34Z",
  "date_created": "2020-08-15T19:39:34Z",
  "program_id": "e242686d-3bb7-4543-8438-0aa682e14696",
  "customer_id": "1114ae62-5fe1-4b21-b4fb-f2b158d8e21e",
  "type": "deposit",
  "status": "active",
  "description": "string",
  "routing_number": "547897762",
  "account_number": "574771265",
  "balance": {
    "current_balance": 1000,
    "available_balance": 950,
    "previous_statement_balance": 17312,
    "currency": "USD"
  },
  "cards": [
    "7c45101a-82de-49e5-b01d-50151b54312d"
  ],
  "deposit": {}
}
{
    "account_id": "057c6074-a02d-4a5a-bad9-bbc64b047df7",
    "date_updated": "2020-08-16T19:39:34Z",
    "date_created": "2020-08-16T19:39:34Z",
    "program_id": "e242686d-3bb7-4543-8438-0aa682e14696",
    "customer_id": "1114ae62-5fe1-4b21-b4fb-f2b158d8e21e",
    "type": "deposit",
    "status": "inactive",
    "routing_number": "0",
    "account_number": "61286758183945",
    "description": "My First Deposit Account",
    "balance": {
        "previous_statement_balance": 97495,
        "available_balance": 97495,
        "current_balance": 97495,
        "currency": "USD"
    },
    "cards": [],
    "deposit": {}
}

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

Closing an account

Use the POST /accounts/{account_id}/close operation with no further parameters to close an account.

🚧

Warning

Once an account is closed it cannot be reactivated.

An example of a response to a request to close an account is shown below.

curl --request POST \
     --url https://sandbox.bond.tech/api/v0.1/accounts/7c45101a-82de-49e5-b01d-50151b54312d/close \
     --header 'Accept: application/json' \
     --header 'Authorization: YOUR-AUTHENTICATION' \
     --header 'Identity: YOUR-IDENTITY'
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://sandbox.bond.tech/api/v0.1/accounts/7c45101a-82de-49e5-b01d-50151b54312d/close")

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

request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/json'
request["Identity"] = 'YOUR-IDENTITY'
request["Authorization"] = 'YOUR-AUTHENTICATION'

response = http.request(request)
puts response.read_body
import requests

url = "https://sandbox.bond.tech/api/v0.1/accounts/7c45101a-82de-49e5-b01d-50151b54312d/close"

headers = {
    "Accept": "application/json",
    "Identity": "YOUR-IDENTITY",
    "Authorization": "YOUR-AUTHENTICATION"
}

response = requests.post(url, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {
    Accept: 'application/json',
    Identity: 'YOUR-IDENTITY',
    Authorization: 'YOUR-AUTHENTICATION'
  }
};

fetch('https://sandbox.bond.tech/api/v0.1/accounts/7c45101a-82de-49e5-b01d-50151b54312d/close', 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.1/accounts/7c45101a-82de-49e5-b01d-50151b54312d/close");
var request = new RestRequest(Method.POST);
request.AddHeader("Accept", "application/json");
request.AddHeader("Identity", "YOUR-IDENTITY");
request.AddHeader("Authorization", "YOUR-AUTHENTICATION");
IRestResponse response = client.Execute(request);
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://sandbox.bond.tech/api/v0.1/accounts/7c45101a-82de-49e5-b01d-50151b54312d/close")
  .post(null)
  .addHeader("Accept", "application/json")
  .addHeader("Identity", "YOUR-IDENTITY")
  .addHeader("Authorization", "YOUR-AUTHENTICATION")
  .build();

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

An example of successful account close request is shown below.

{
  "account_id": "057c6074-a02d-4a5a-bad9-bbc64b047df7",
  "date_updated": "2020-08-16T19:39:34Z",
  "date_created": "2020-08-15T19:39:34Z",
  "program_id": "e242686d-3bb7-4543-8438-0aa682e14696",
  "customer_id": "1114ae62-5fe1-4b21-b4fb-f2b158d8e21e",
  "type": "deposit",
  "status": "closed",
  "description": "string",
  "routing_number": "547897762",
  "account_number": "574771265",
  "balance": {
    "current_balance": 1000,
    "available_balance": 950,
    "previous_statement_balance": 17312,
    "currency": "USD"
  },
  "cards": [
    "7c45101a-82de-49e5-b01d-50151b54312d"
  ],
  "deposit": {}
}

For a complete specification and interactive examples, see Closing an account in the Bond API Reference.

Freezing an account

Freezing accounts is managed by Bond's fraud controls. Please contact our support team for further details.


Next Steps
Did this page help you?