# P2P Transfer
source: https://developer.mastercard.com/mastercard-send-account-info/documentation/use-cases/p2p-transfer/index.md

This example shows how the API can be used when a funds transfer app user sends money from their card to an app contact's card. It is based on the graphical [Send money by app to a contact](https://developer.mastercard.com/mastercard-send-experience-design-guide/documentation/design/payment-transfers/send-money-by-app-to-contact/) flow in the Mastercard Send Experience Design Guide.

### Scenario {#scenario}

* Ali Young (the Sender) is using a mobile funds transfer app to send $20 USD to Roger Quest (the Recipient), who is one of her app contacts.
* Ali adds her default card account to her app profile. She will send the funds from that card.
* Ali adds Roger's receiving card account when initiating the transfer.
* You (the Transaction Initiator) provide the app and use the Mastercard Send APIs to do the funds transfer. You are not one of the card issuers.

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}

When Ali adds her 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-p2p-1

Example request payload:
* JSON
* XML

```JSON
{
  "account_info": {
    "account_uri": "pan:5102589999999913;exp=2077-08;cvc=123",
    "payment_type": "P2P",
    "enhanced_response": "true"
  }
}
```

```XML
<account_info>
   <account_uri>pan:5102589999999913;exp=2077-08;cvc=123</account_uri>
   <payment_type>P2P</payment_type>
   <enhanced_response>true</enhanced_response>
</account_info>
```

These success response fields show that Ali's card can send funds transfers but not receive them:
* JSON
* XML

```JSON
    "sending_eligibility": {
      "eligible": true
    },
    "receiving_eligibility": {
      "eligible": false,
      "reason_code": "ACCOUNT_NOT_ELIGIBLE",
      "reason_description": "Account not eligible"
    },
```

```XML
   <sending_eligibility>
      <eligible>true</eligible>
   </sending_eligibility>
   <receiving_eligibility>
      <eligible>false</eligible>
      <reason_code>ACCOUNT_NOT_ELIGIBLE</reason_code>
      <reason_description>Account not eligible</reason_description>
   </receiving_eligibility>
```

Using the response information, your transfer app can:

* Notify Ali whether the card can be used to send and/or receive funds and, if eligible to send, display a **Send funds from this card** button so she can initiate a transfer.
* 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 funds transfer {#check-a-funds-transfer}

When Ali initiates the $20 USD transfer and provides details of Roger's receiving card account, use [Account Info PUT](https://developer.mastercard.com/mastercard-send-account-info/documentation/api-reference/index.md) requests to check that both card accounts are eligible for that transfer. Example sequence:
Diagram mastercard-send-sequence-account-info-p2p-2

### Checking Ali's sending eligibility {#checking-alis-sending-eligibility}

Example request payload:
* JSON
* XML

```JSON
{
  "account_info": {
    "account_uri": "pan:5102589999999913;exp=2077-08",
    "amount": "2000",
    "currency": "USD",
    "payment_type": "P2P"
  }
}
```

```XML
<account_info>
   <account_uri>pan:5102589999999913;exp=2077-08</account_uri>
   <amount>2000</amount> 
   <currency>USD</currency>
   <payment_type>P2P</payment_type>
</account_info>
```

These success response fields show that Ali's card can send these funds:
* JSON
* XML

```JSON
    "sending_eligibility": {
      "eligible": true
    },
```

```XML
   <sending_eligibility>
      <eligible>true</eligible>
   </sending_eligibility>
```

### Checking Roger's receiving eligibility {#checking-rogers-receiving-eligibility}

Example request payload:
* JSON
* XML

```JSON
{
  "account_info": {
    "account_uri": "pan:5102589999999921;exp=2079-04",
    "amount": "2000",
    "currency": "USD",
    "payment_type": "P2P"
  }
}
```

```XML
<account_info>
   <account_uri>pan:5102589999999921;exp=2079-04</account_uri>
   <amount>2000</amount> 
   <currency>USD</currency>
   <payment_type>P2P</payment_type>
</account_info>
```

These success response fields show that Roger's card can receive these funds and also the estimated funds availability time frame following the transfer:
* JSON
* XML

```JSON
    "receiving_eligibility": {
      "eligible": true
    },
    "funds_availability": "IMMEDIATE",
```

```XML
   <receiving_eligibility>
      <eligible>true</eligible>
   </receiving_eligibility>
   <funds_availability>IMMEDIATE</funds_availability>
```

### Outcome {#outcome}

Using the response information, your transfer app can:

* Notify Ali that Roger's card can receive this funds transfer, and enable Ali to continue with the transfer flow.
* Provide the estimated funds availability time frame so that Ali can tell Roger when he is likely to see the funds in his account (timing driven by Receive Network and issuer).

<br />

To do the transfer, you can use these services:

* [Mastercard Send Funding](https://developer.mastercard.com/mastercard-send-funding/documentation/) to secure the funds from Ali's sending account.
* [Mastercard Send Person-to-Person](https://developer.mastercard.com/mastercard-send-person-to-person/documentation/) to send the funds to Roger's receiving account.
