Skip to main content

Audience:

Developers

Update card settings using the API

Update a card's transaction settings and spending limits with the updateCard mutation. Card settings are valid for all payments linked to the card, including all virtual, physical, and digital cards. For all available options, review the card settings reference.

Prerequisites
  • You're authenticated with a user access token associated with the correct account member.
  • The account member has the membership permission canManageCards. The permission canManageAccountMembership is optional.

Guide

  1. Call the updateCard mutation.
  2. Add the cardId for the card you're updating (line 4).
  3. Update the transaction settings as needed (lines 5-8).
  4. To update the spending limit, including switching between rolling and calendar periods, use the spendingLimit field to set the period, amount, and mode.
  5. Add your consentRedirectUrl (line 9).
  6. Add the success payload, including the consent (line 14).
  7. Add rejections (not shown).

The mutation returns a newly created consent resource containing the consentUrl, which allows you to redirect the user making the modification to Swan's Strong Customer Authentication. After the consent process is completed, the card is updated.

suspicion of fraud

At the slightest suspicion of fraud, block all eCommerce payments temporarily by updating eCommerce to false for the concerned card product. Additionally, you can temporarily or permanently block physical cards and permanently cancel virtual cards.

The cardholder then needs to submit a support request, after which Swan can issue a new card.

Mutation

Open in API Explorer
mutation UpdateCardTransactionSettings {
updateCard(
input: {
cardId: "$YOUR_CARD_ID"
withdrawal: false
international: false
nonMainCurrencyTransactions: false
eCommerce: false
consentRedirectUrl: "$YOUR_REDIRECT_URL"
}
) {
... on UpdateCardSuccessPayload {
__typename
consent {
consentUrl
id
}
}
}
}

Payload

Open the consentUrl returned by the mutation to consent to the update.

{
"data": {
"updateCard": {
"__typename": "UpdateCardSuccessPayload",
"consent": {
"consentUrl": "$YOUR_CONSENT_URL",
"id": "$YOUR_CONSENT_ID"
}
}
}
}