Closing a card
How to close a card account.
To close a card, use the POST /cards/{card_id}
endpoint and provide the card_id
of the card account to be closed as a path parameter.
Note
To close a card, the Account the card is associated with must have a $0 balance.
An example close account request is shown below.
curl --request POST \
--url https://sandbox.bond.tech/api/v0.1/cards/close/card_id \
--header 'Authorization: <YOUR_AUTHORIZATION>' \
--header 'Identity: <YOUR_IDENTITY>'
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://sandbox.bond.tech/api/v0.1/cards/close/card_id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Identity"] = '<YOUR_IDENTITY>'
request["Authorization"] = '<YOUR_AUTHORIZATION>'
response = http.request(request)
puts response.read_body
const options = {
method: 'PATCH',
headers: {
Identity: '<YOUR_IDENTITY>',
Authorization: '<YOUR_AUTHORIZATION>'
}
};
fetch('https://sandbox.bond.tech/api/v0.1/cards/close/card_id', options)
.then(response => console.log(response))
.catch(err => console.error(err));
import requests
url = "https://sandbox.bond.tech/api/v0.1/cards/close/card_id"
headers = {
"Identity": "<YOUR_IDENTITY>",
"Authorization": "<YOUR_AUTHORIZATION>"
}
response = requests.request("PATCH", url, headers=headers)
print(response.text)
var client = new RestClient("https://sandbox.bond.tech/api/v0.1/cards/close/card_id");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Identity", "<YOUR_IDENTITY>");
request.AddHeader("Authorization", "<YOUR_AUTHORIZATION>");
IRestResponse response = client.Execute(request);
var client = new RestClient("https://sandbox.bond.tech/api/v0.1/cards/close/card_id");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Identity", "<YOUR_IDENTITY>");
request.AddHeader("Authorization", "<YOUR_AUTHORIZATION>");
IRestResponse response = client.Execute(request);
A successful 200
response shows that the card account status has been updated to Closed
as shown in the example below.
{
"card_id": "057c6074-a02d-4a5a-bad9-bbc64b047df7",
"customer_id": "c8940088-21e8-451c-987c-0a0398db3ee5",
"account_id": "26bdeb70-157c-4c44-a04a-3727793b9779",
"card_number": "tok_live_q7kwTYb5YCYznpgRHHTs9p",
"cvv": "tok_live_c94od3AsFWYQ1ecaaMYtFU",
"expiry_date": "tok_live_7g3eARzeEBJw89rJRCHqHv",
"last_four": "6270",
"status": "closed",
"card_design_id": null,
"date_updated": "2020-08-16T19:39:34Z",
"date_created": "2020-08-16T19:39:34Z"
}
For a complete specification and interactive examples, see Closing a card in the Bond API Reference.
Updated 3 days ago