# Funding source: https://developer.mastercard.com/mastercard-send-account-info/documentation/use-cases/funding/index.md This example shows how the API can be used when a digital wallet user adds funds to their wallet account from their card. It is based on the graphical [Top up a digital wallet from a card](https://developer.mastercard.com/mastercard-send-experience-design-guide/documentation/design/funding/top-up-digital-wallet-from-card/) flow in the Mastercard Send Experience Design Guide. ### Scenario {#scenario} * Ali Young (the Sender) is using a mobile wallet app and wants to add money to her wallet ('top up'). She chooses to transfer $100 USD to the wallet. * Ali has already added her card account details to her wallet profile. She will send the funds from that card. * You (the Transaction Initiator) provide the app and use the Mastercard Send APIs to transfer the funds from the card account (the sending account). Successful API requests result in a 200 response. If requests fail API validation, Mastercard Send returns a 4xx error message with the appropriate [error code](https://developer.mastercard.com/mastercard-send-account-info/documentation/code-and-formats/index.md#error-codes). ## Check a new card {#check-a-new-card} If Ali adds a new sending (funding) card to the app, use an [Account Info PUT](https://developer.mastercard.com/mastercard-send-account-info/documentation/api-reference/index.md) request to check that card account. Example sequence: Diagram mastercard-send-sequence-account-info-funding-1 See the endpoint structure: API Reference: `PUT /v1/partners/{partnerId}/accounts/account-info`
Example request payload for checking Ali's card PAN 5102589999999913 for transfers of `payment_type` 'SWL' (Transfer to Own Staged Digital Wallet Account): * JSON * XML ```JSON { "account_info": { "account_uri": "pan:5102589999999913;exp=2077-08;cvc=123", "payment_type": "SWL", "enhanced_response": "true" } } ``` ```XML pan:5102589999999913;exp=2077-08;cvc=123 SWL true ``` These success response fields show that Ali's card can send funds: * JSON * XML ```JSON "sending_eligibility": { "eligible": true }, ``` ```XML true ``` Using the response information, your app can: * Notify Ali that the card can be used to top up the wallet. * Provide textual or graphical information about the card account in the user interface (e.g. brand, type, and institution) to enhance the experience, such as show an issuer-specific card image. ## Check a funding transfer {#check-a-funding-transfer} When Ali initiates the $100 USD top up transfer, use an [Account Info PUT](https://developer.mastercard.com/mastercard-send-account-info/documentation/api-reference/index.md) request to check that her sending card account is eligible for that funding transfer. Example sequence: Diagram mastercard-send-sequence-account-info-funding-2 See the endpoint structure: API Reference: `PUT /v1/partners/{partnerId}/accounts/account-info`
Example request payload for checking Ali's card PAN 5102589999999913 for a $100 USD transfer of `payment_type` 'SWL' (Transfer to Own Staged Digital Wallet Account): * JSON * XML ```JSON { "account_info": { "account_uri": "pan:5102589999999913;exp=2077-08", "amount": "10000", "currency": "USD", "payment_type": "SWL" } } ``` ```XML pan:5102589999999913;exp=2077-08 10000 USD SWL ``` These success response fields show that Ali's card can send these funds: * JSON * XML ```JSON "sending_eligibility": { "eligible": true }, ``` ```XML true ``` Your app can continue with the wallet top up flow. You can use the [Mastercard Send Funding](https://developer.mastercard.com/mastercard-send-funding/documentation/) service to secure the funds from Ali's sending account.