CARDS
Terminate Card
Permanently close a card. This cannot be undone.
POST /v1/cards/:tracking_id/terminate
Use this endpoint to
- Permanently close a card the customer no longer needs
- Shut down a compromised card for good, rather than just freezing it
Request
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
tracking_id |
string | Yes | Card id from Issue Card |
Important: This action is irreversible. Consider withdrawing any remaining balance first.
Code Samples
const response = await fetch(
"https://sandbox.hitchpay.ng/v1/cards/EXTCARD123456/terminate",
{
method: "POST",
headers: { Authorization: "Bearer YOUR_ACCESS_TOKEN" }
}
);
const data = await response.json();
console.log(data);<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => "https://sandbox.hitchpay.ng/v1/cards/EXTCARD123456/terminate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_ACCESS_TOKEN"
]
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;import requests
url = "https://sandbox.hitchpay.ng/v1/cards/EXTCARD123456/terminate"
headers = {"Authorization": "Bearer YOUR_ACCESS_TOKEN"}
response = requests.post(url, headers=headers)
print(response.json())Response
{
"status": "success",
"message": "Card terminated successfully.",
"data": {
"tracking_id": "EXTCARD…",
"customer_uuid": "…",
"card_id": "…",
"label": "John Doe USD Card",
"brand": "visa",
"card_type": "virtual",
"currency": "USD",
"masked_pan": "539983******1234",
"last4": "1234",
"exp_month": "08",
"exp_year": "2029",
"cardholder_name": "JOHN DOE",
"balance": 0.00,
"status": "terminated",
"date_created": "1782947655"
}
}Fields
Returns the full card object. See the card object shape in the Overview page, with status: "terminated".
Errors
| Code | Meaning |
|---|---|
UNAUTHORIZED |
Business not found or inactive |
NOT_FOUND |
Card not found |
CARD_TERMINATED |
The card is already terminated |
Questions? Email [email protected]. Also on GitBook.