curl -X POST https://sandbox.api.prava.space/v1/deleteCard \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{ "customer_id": "user_123", "card_id": "card_1", "reason": "CUSTOMER_CONFIRMED" }'
import requests
resp = requests.post(
"https://sandbox.api.prava.space/v1/deleteCard",
headers={"Authorization": "Bearer sk_test_..."},
json={"customer_id": "user_123", "card_id": "card_1", "reason": "CUSTOMER_CONFIRMED"},
)
const resp = await fetch("https://sandbox.api.prava.space/v1/deleteCard", {
method: "POST",
headers: {
Authorization: "Bearer sk_test_...",
"Content-Type": "application/json",
},
body: JSON.stringify({
customer_id: "user_123",
card_id: "card_1",
reason: "CUSTOMER_CONFIRMED",
}),
});
{ "success": true, "card_id": "card_1", "was_default": false, "network_token_deleted": true }
{
"error": { "code": "INVALID_REQUEST", "message": "Missing customer_id or card_id" }
}
{
"error": { "code": "NOT_FOUND", "message": "Card not found" }
}
Server-Side API
Delete Card
Delete a customer’s enrolled card and retire its network token
POST
/
v1
/
deleteCard
curl -X POST https://sandbox.api.prava.space/v1/deleteCard \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{ "customer_id": "user_123", "card_id": "card_1", "reason": "CUSTOMER_CONFIRMED" }'
import requests
resp = requests.post(
"https://sandbox.api.prava.space/v1/deleteCard",
headers={"Authorization": "Bearer sk_test_..."},
json={"customer_id": "user_123", "card_id": "card_1", "reason": "CUSTOMER_CONFIRMED"},
)
const resp = await fetch("https://sandbox.api.prava.space/v1/deleteCard", {
method: "POST",
headers: {
Authorization: "Bearer sk_test_...",
"Content-Type": "application/json",
},
body: JSON.stringify({
customer_id: "user_123",
card_id: "card_1",
reason: "CUSTOMER_CONFIRMED",
}),
});
{ "success": true, "card_id": "card_1", "was_default": false, "network_token_deleted": true }
{
"error": { "code": "INVALID_REQUEST", "message": "Missing customer_id or card_id" }
}
{
"error": { "code": "NOT_FOUND", "message": "Card not found" }
}
Delete an enrolled card. Deletion also retires the card’s network token (the tokenized stand-in for the card at the card network) where one exists.
POST /v1/deleteCard · Authenticated with your secret key.
Body
string
required
The customer whose card to delete (the
user_id used at session creation).string
required
The card to delete — the same identifier as the
enrollmentId from the SDK’s collectPAN and the card_id in List Cards.string
default:"OTHER"
Why the card is being deleted:
CUSTOMER_CONFIRMED, LOST, STOLEN, SUSPECTED_FRAUD, CLOSED_ACCOUNT, or OTHER.Response
boolean
Whether the card was deleted.
string
The deleted card id.
boolean
Whether the deleted card was the customer’s default. If
true, the customer picks a new default on their next payment.boolean
Whether a card-network token was retired as part of the deletion.
Error responses
| Status | Code | Cause | Resolution |
|---|---|---|---|
| 401 | AUTH_1001 | Invalid API key | Check your secret key |
| 400 | INVALID_REQUEST | Missing customer_id or card_id | Include both fields |
| 404 | CUSTOMER_NOT_FOUND | No customer for the given identifier | Verify customer_id |
| 404 | NOT_FOUND | Card not found | Verify card_id via List Cards |
| 502 | NETWORK_DELETE_FAILED | Card-network deletion failed | Retry the request |
curl -X POST https://sandbox.api.prava.space/v1/deleteCard \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{ "customer_id": "user_123", "card_id": "card_1", "reason": "CUSTOMER_CONFIRMED" }'
import requests
resp = requests.post(
"https://sandbox.api.prava.space/v1/deleteCard",
headers={"Authorization": "Bearer sk_test_..."},
json={"customer_id": "user_123", "card_id": "card_1", "reason": "CUSTOMER_CONFIRMED"},
)
const resp = await fetch("https://sandbox.api.prava.space/v1/deleteCard", {
method: "POST",
headers: {
Authorization: "Bearer sk_test_...",
"Content-Type": "application/json",
},
body: JSON.stringify({
customer_id: "user_123",
card_id: "card_1",
reason: "CUSTOMER_CONFIRMED",
}),
});
{ "success": true, "card_id": "card_1", "was_default": false, "network_token_deleted": true }
{
"error": { "code": "INVALID_REQUEST", "message": "Missing customer_id or card_id" }
}
{
"error": { "code": "NOT_FOUND", "message": "Card not found" }
}
Authorizations
Your secret key: sk_test_* (sandbox) or sk_live_* (production).
Body
application/json
The customer whose card to delete (the user_id used at session creation)
The card to delete (same as enrollmentId from the SDK's collectPAN())
Why the card is being deleted
Available options:
CUSTOMER_CONFIRMED, LOST, STOLEN, SUSPECTED_FRAUD, CLOSED_ACCOUNT, OTHER