curl --request POST \
--url https://api.sandbox.lead.bank/v0/cards/{id}/deactivate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"status_reason": "dormant"
}
'import requests
url = "https://api.sandbox.lead.bank/v0/cards/{id}/deactivate"
payload = { "status_reason": "dormant" }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({status_reason: 'dormant'})
};
fetch('https://api.sandbox.lead.bank/v0/cards/{id}/deactivate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.lead.bank/v0/cards/{id}/deactivate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'status_reason' => 'dormant'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.lead.bank/v0/cards/{id}/deactivate"
payload := strings.NewReader("{\n \"status_reason\": \"dormant\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.lead.bank/v0/cards/{id}/deactivate")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"status_reason\": \"dormant\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.lead.bank/v0/cards/{id}/deactivate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status_reason\": \"dormant\"\n}"
response = http.request(request)
puts response.read_body{
"id": "card_xyz123",
"client_card_id": "<string>",
"account_id": "account_xyz123",
"entity_id": "entity_xyz123",
"status": "active",
"status_reason": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"details": {
"card_product_name": "<string>",
"is_virtual": true,
"card_type": "hsa",
"expiry_date": "2023-12-25",
"last_four": "1234",
"replacement_for": "card_xyz123",
"closed_at": "2023-11-07T05:31:56Z"
},
"metadata": {}
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "invalid_status_transition",
"title": "Invalid status transition.",
"detail": "Card cannot be deactivated from current status.",
"invalid_parameters": []
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}Deactivate a Card
Beta: This endpoint is in beta and may change before general availability.
Transitions a card from active or closed to inactive status.
Idempotency
The Idempotency-Key header is required.
curl --request POST \
--url https://api.sandbox.lead.bank/v0/cards/{id}/deactivate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"status_reason": "dormant"
}
'import requests
url = "https://api.sandbox.lead.bank/v0/cards/{id}/deactivate"
payload = { "status_reason": "dormant" }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({status_reason: 'dormant'})
};
fetch('https://api.sandbox.lead.bank/v0/cards/{id}/deactivate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.lead.bank/v0/cards/{id}/deactivate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'status_reason' => 'dormant'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.lead.bank/v0/cards/{id}/deactivate"
payload := strings.NewReader("{\n \"status_reason\": \"dormant\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.lead.bank/v0/cards/{id}/deactivate")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"status_reason\": \"dormant\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.lead.bank/v0/cards/{id}/deactivate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status_reason\": \"dormant\"\n}"
response = http.request(request)
puts response.read_body{
"id": "card_xyz123",
"client_card_id": "<string>",
"account_id": "account_xyz123",
"entity_id": "entity_xyz123",
"status": "active",
"status_reason": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"details": {
"card_product_name": "<string>",
"is_virtual": true,
"card_type": "hsa",
"expiry_date": "2023-12-25",
"last_four": "1234",
"replacement_for": "card_xyz123",
"closed_at": "2023-11-07T05:31:56Z"
},
"metadata": {}
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "invalid_status_transition",
"title": "Invalid status transition.",
"detail": "Card cannot be deactivated from current status.",
"invalid_parameters": []
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"status": "<string>",
"invalid_parameters": [
{
"parameter": "transaction_type",
"reason": "<string>"
}
],
"instance": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Unique key to ensure idempotent requests
255Path Parameters
The server-generated Card ID. The server-generated ID of the Card object.
^card_\w+$"card_xyz123"
Body
Request body for deactivating a card.
Valid reasons for deactivating a card.
dormant, frozen, other Response
Card deactivated successfully.
A card object
The server-generated ID of the Card object.
^card_\w+$"card_xyz123"
Client-provided identifier for the card. Optional: present only for cards created via file upload, and omitted for cards created through the API, which are identified solely by their server-generated ID.
The ID of the Account object.
^account_\w+$"account_xyz123"
The ID of your entity.
^entity_[^\s]{1,33}$"entity_xyz123"
Status is system-managed and cannot be set on create; status changes go through the status-transition endpoints.
active, inactive, closed The reason for the card's current status. Empty when the card is active; otherwise
populated. Set via the status-transition endpoints.
Creation timestamp.
Last update timestamp.
Physical and product attributes of the card.
Show child attributes
Show child attributes
A set of key-value pairs that can be used to store additional information related to this object.
Show child attributes
Show child attributes
Was this page helpful?

