Skip to main content

Audience:

Developers

Cancel virtual cards using the API

Cancel virtual cards with the cancelCard mutation.

Cancelation is irreversible

Canceling a virtual card is an irreversible action that immediately and permanently invalidates the card. All physical and digital cards associated to the virtual card are also canceled. Consent isn't required to cancel cards.

Guide

  1. Call the cancelCard mutation.
  2. Add the virtual cardId for the card you're canceling (line 2).
  3. Add the success payload, including any information you'd like to review (line 3).
  4. Add rejections (not shown).

Mutation

Open in API Explorer
mutation CancelVirtualCard {
cancelCard(input: { cardId: "$YOUR_CARD_ID" }) {
... on CancelCardSuccessPayload {
__typename
card {
statusInfo {
status
}
}
}
}
}

Payload

The payload confirms that the virtual card is Canceled.

{
"data": {
"cancelCard": {
"__typename": "CancelCardSuccessPayload",
"card": {
"statusInfo": {
"status": "Canceled"
}
}
}
}
}