Skip to main content

Add digital cards

Learn how cardholders can add your card to Apple Wallet and Google Wallet.

Provisioning guide

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 digital cards to Apple Wallet and Google Wallet​

Manual Provisioning

Cardholders can also go digital by entering their card numbers directly into Apple Wallet or Google Wallet.

  1. Call the addDigitalCard mutation. When you call the mutation, make sure you are authenticated with an user access token using the name of the card's account member.
  2. Make sure to choose the walletProvider that corresponds to the cardholder's mobile device.
  3. This returns a consent.
  4. The mutation returns a consentUrl, inviting the user to start Strong Customer Authentication with the Swan app.
  5. 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 Explorer
mutation 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"
}
}
}
}
}
}

Transitioning from manual to in-app provisioning​

When cardholders start manually adding a card to their digital wallet but don't complete the process (for example, they don't enter the OTP or encounter an error during verification), they can activate the digital card using your app or the Swan app. This eliminates the need for cardholders to restart the entire provisioning process.

This process is particularly useful for Google Wallet, where cardholders might begin manual provisioning but need assistance completing it.

Retrieve pending digital card​

First, retrieve the digitalCardId of the digital card in Pending status:

Open in API Explorer
query GetPendingDigitalCard {
card(cardId: "$YOUR_CARD_ID") {
digitalCards(filters: { walletId: "$YOUR_WALLET_ID", status: "Pending" }) {
edges {
node {
... on PendingDigitalCard {
id
}
}
}
}
}
}

Activate the digital card​

Certification Required

Please contact us through our Partner Support Request form available on your Dashboard before integrating activateDigitalCard into your app. This mutation requires Apple Pay and/or Google Pay certification.

Use the activateDigitalCard mutation to activate the pending digital card:

Open in API Explorer
mutation ActivateDigitalCard {
activateDigitalCard(
input: {
digitalCardId: "$YOUR_DIGITAL_CARD_ID"
}
) {
... on ActivateDigitalCardSuccessPayload {
__typename
digitalCard {
id
statusInfo {
... on DigitalCardEnabledStatusInfo {
__typename
}
}
}
}
... on Rejection {
__typename
message
}
}
}

Implementation notes​

  • Manual provisioning: Does not require additional app certification.
  • In-app provisioning: Using your app requires a certification process. Please use our Partner Support Request form available on your Dashboard to get started.
  • Reference implementation: Swan's Banking app handles this process and can serve as a model for your integration.