Cards
Delete Token
This endpoint deletes or deactivates a previously created token_id.
Once deleted, the card token can no longer be used to create new payments.
⚠️ If the token is already used in an in-progress transaction, it will not affect that transaction but will prevent future usage.
DELETE
/
v2
/
cards
/
{token_id}
Delete Token
curl --request DELETE \
--url https://sandbox-api.lightningpay.me/api/v2/cards/{token_id} \
--header 'app-id: <api-key>' \
--header 'secret-key: <api-key>'import requests
url = "https://sandbox-api.lightningpay.me/api/v2/cards/{token_id}"
headers = {
"app-id": "<api-key>",
"secret-key": "<api-key>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'app-id': '<api-key>', 'secret-key': '<api-key>'}};
fetch('https://sandbox-api.lightningpay.me/api/v2/cards/{token_id}', 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://sandbox-api.lightningpay.me/api/v2/cards/{token_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"app-id: <api-key>",
"secret-key: <api-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"
"net/http"
"io"
)
func main() {
url := "https://sandbox-api.lightningpay.me/api/v2/cards/{token_id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("app-id", "<api-key>")
req.Header.Add("secret-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://sandbox-api.lightningpay.me/api/v2/cards/{token_id}")
.header("app-id", "<api-key>")
.header("secret-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.lightningpay.me/api/v2/cards/{token_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["app-id"] = '<api-key>'
request["secret-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "Ok"
}{
"errors": {
"code": "REQUIRE_LOGIN",
"message": "Not Authorised"
}
}{
"errors": {
"message": "Token ID not found."
}
}Authorizations
A unique identifier assigned to each application.
A secure token associated with the app-id.
Path Parameters
The unique card token ID to delete (e.g., tok_abcd1234)
Response
Card token deleted
Example:
"Ok"
⌘I
Delete Token
curl --request DELETE \
--url https://sandbox-api.lightningpay.me/api/v2/cards/{token_id} \
--header 'app-id: <api-key>' \
--header 'secret-key: <api-key>'import requests
url = "https://sandbox-api.lightningpay.me/api/v2/cards/{token_id}"
headers = {
"app-id": "<api-key>",
"secret-key": "<api-key>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'app-id': '<api-key>', 'secret-key': '<api-key>'}};
fetch('https://sandbox-api.lightningpay.me/api/v2/cards/{token_id}', 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://sandbox-api.lightningpay.me/api/v2/cards/{token_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"app-id: <api-key>",
"secret-key: <api-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"
"net/http"
"io"
)
func main() {
url := "https://sandbox-api.lightningpay.me/api/v2/cards/{token_id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("app-id", "<api-key>")
req.Header.Add("secret-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://sandbox-api.lightningpay.me/api/v2/cards/{token_id}")
.header("app-id", "<api-key>")
.header("secret-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.lightningpay.me/api/v2/cards/{token_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["app-id"] = '<api-key>'
request["secret-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "Ok"
}{
"errors": {
"code": "REQUIRE_LOGIN",
"message": "Not Authorised"
}
}{
"errors": {
"message": "Token ID not found."
}
}