Audience:
Add digital cards
Learn how cardholders can add your card to Apple Wallet and Google Wallet.
A complete provisioning guide can't be published on this site due to privacy policies from Google and Apple. Swan will provide one after you've certified your digital card integration.
Add a digital card
Cardholders can also go digital by entering their card numbers directly into Apple Wallet or Google Wallet. If they start manual provisioning but don't complete it, you can help them transition to in-app provisioning.
- Call the
addDigitalCardmutation. When you call the mutation, make sure you're authenticated with a user access token using the name of the card's account member. - Make sure to choose the
walletProviderthat corresponds to the cardholder's mobile device. - The mutation returns a consent with a
consentUrl, inviting the user to start Strong Customer Authentication with the Swan app. - Then the Swan app proposes adding the card to Apple Wallet or Google Wallet depending on the brand of the account member's mobile device.
Mutation
Open in API Explorermutation DigitalApplePay {
addDigitalCard(
input: {
cardId: "$YOUR_CARD_ID"
walletProvider: ApplePay
consentRedirectUrl: "$YOUR_REDIRECT_URL"
}
) {
... on AddDigitalCardSuccessPayload {
__typename
digitalCard {
id
statusInfo {
... on DigitalCardConsentPendingStatusInfo {
__typename
consent {
consentUrl
}
}
}
}
}
}
}
Payload
{
"data": {
"addDigitalCard": {
"__typename": "AddDigitalCardSuccessPayload",
"digitalCard": {
"id": "$YOUR_DIGITAL_CARD_ID",
"statusInfo": {
"__typename": "DigitalCardConsentPendingStatusInfo",
"consent": {
"consentUrl": "$YOUR_CONSENT_URL"
}
}
}
}
}
}
Add multiple digital cards
Add several digital cards at once with the addDigitalCards mutation.
It works like addDigitalCard, but it requires only a single consent flow for the entire batch.
- Call the
addDigitalCardsmutation with the list ofcardIdsto digitize. Make sure you're authenticated with a user access token: the user must be the cardholder for each card, and all cards must belong to the same account. - Choose the
walletProviderthat corresponds to the cardholder's mobile device. - The mutation returns one consent for the batch; the consent is available in each digital card's status information.
Digital cards are only valid for 1 hour after consent validation.
Mutation
Open in API Explorermutation AddDigitalCards {
addDigitalCards(
input: {
cardIds: ["$YOUR_CARD_ID_1", "$YOUR_CARD_ID_2"]
walletProvider: ApplePay
consentRedirectUrl: "$YOUR_REDIRECT_URL"
}
) {
... on AddDigitalCardsSuccessPayload {
__typename
digitalCards {
id
statusInfo {
... on DigitalCardConsentPendingStatusInfo {
__typename
consent {
consentUrl
}
}
}
}
}
}
}