Changing a cards status

How to activate a card and change its status.

Changing the status of a card

To change the status of a card, use the PATCH /cards/{card_id} operation and provide the required status parameter as shown in the following table.

📘

Note

You can only change the status of a physical card after you have activated it.

ParameterTypeDescription
statusstringOne of: Active or Inactive

An example of a request to change the status of a card is shown below.

curl --request PATCH \
     --url https://sandbox.bond.tech/api/v0.1/cards/c8940088-21e8-451c-987c-0a0398db3ee5 \
     --header 'Accept: application/json' \
     --header 'Authorization: YOUR-AUTHENTICATION' \
     --header 'Content-Type: application/json' \
     --header 'Identity: YOUR-IDENTITY' \
     --data '
{
     "status": "inactive"
}
'
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://sandbox.bond.tech/api/v0.1/cards/c8940088-21e8-451c-987c-0a0398db3ee5")

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\":\"inactive\"}"

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

fetch('https://sandbox.bond.tech/api/v0.1/cards/c8940088-21e8-451c-987c-0a0398db3ee5', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import requests

url = "https://sandbox.bond.tech/api/v0.1/cards/c8940088-21e8-451c-987c-0a0398db3ee5"

payload = {"status": "inactive"}
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)
var client = new RestClient("https://sandbox.bond.tech/api/v0.1/cards/c8940088-21e8-451c-987c-0a0398db3ee5");
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\":\"inactive\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"status\":\"inactive\"}");
Request request = new Request.Builder()
  .url("https://sandbox.bond.tech/api/v0.1/cards/c8940088-21e8-451c-987c-0a0398db3ee5")
  .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();

An example of a response to a successful request to change the status of a card is shown below.

{
  "card_id": "057c6074-a02d-4a5a-bad9-bbc64b047df7",
  "date_updated": "2020-08-16T19:39:34Z",
  "date_created": "2020-08-15T19:39:34Z",
  "customer_id": "c8940088-21e8-451c-987c-0a0398db3ee5",
  "account_id": "26bdeb70-157c-4c44-a04a-3727793b9779",
  "business_id": "f65f3ff2-ff5a-46a0-a277-b5892aa5a690",
  "expiry_date": "0331",
  "last_four": "6270",
  "card_number": "tok_live_f65f3ff2-ff5a-46a0-a277-b5892aa5a690",
  "cvv": "tok_live_pc8940088-21e8-451c-987c-0a0398db3ee5",
  "status": "active",
  "card_design_id": "7"
}

For a complete specification and interactive examples, see Update a card status in the Bond API Reference.