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.
Subscribe to card.deleted to reconcile card deletions. The event identifies the card, its Prava customer and your original user_id. Repeated deletion requests do not create another logical event.
Body
The card to delete — the same identifier as the
enrollmentId from the SDK’s collectPAN and the card_id in List Cards.Why the card is being deleted:
CUSTOMER_CONFIRMED, LOST, STOLEN, SUSPECTED_FRAUD, CLOSED_ACCOUNT, or OTHER.Response
Whether the deleted card was the customer’s default. If
true, the oldest remaining active card is preselected until a new default is set with Set Default Card.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
Body
application/json