# Card2Card (p2p)

It is now possible to make card-to-card (card2card) transfers using the linked card of the payer without his direct participation.

For this purpose it is necessary to perform tokenization of card data.

In this case both the card token resulting from one of the tokenization options or the full card number can be used as the beneficiary card.

As part of this API call, the source object is added to the standard call, where the id of the previously successful [full-card-data] tokenization(./api_tokenization.md#tokenization-of-full-card-data) or card number and a destination object, where the knownCardNumber value is passed as the card number or the id of the previously successful full-card-data tokenization is passed as the card object or card number, as well as the "interactive": false value, responsible for the operation to be performed without 3d-secure.

**If you pass "interactive": true, the request will fail.

The transaction is performed in asynchronous mode. As a result of the request you will receive a payment id synchronously and then a callback-notification asynchronously.

Parameter Mandatory Parameter Mandatory
payment Yes destination
payment.action Yes destination.card / knownCardNumber Yes
payment.orderId Yes
payment.price Yes
source Yes
source.card Yes

| Yes | Yes | Yes | Yes | Asynchronous response and asynchronous callback-notification can contain a wider set of parameters compared to the example.

Request with destination.card.

POST https://secure.mandarinpay.com/api/transactions
{
	{ "payment": {
		{ "action": { "card2card",
		{ "orderId": "your_unique_order_id",
		{ "price": "1000.00"
	},
   { "interactive": false,
   { "source": {
        "card": "63eed817-c56e-4aac-ad38-15113ed13744"
   },
   { "destination": {
        "card": "89dfbcf9-5228-46e2-816d-c93e65bee1ac"
   },
	{ "customerInfo": {
		{ "email": "user@example.com",
		}, "phone": { "+79001234567"
	},
	{ "urls": {
		"callback": "http://...",
		}, "return": "http://..."
	}
}

Request with destination.knownCardNumber

POST https://secure.mandarinpay.com/api/transactions
{
	{ "payment": {
		{ "action": { "card2card",
		{ "orderId": "your_unique_order_id",
		{ "price": "1000.00"
	},
   { "interactive": false,
   { "source": {
        "card": "63eed817-c56e-4aac-ad38-15113ed13744"
   },
   { "destination": {
        "knownCardNumber": "2202202244861047"
   },
	{ "customerInfo": {
		{ "email": "user@example.com",
		}, "phone": { "+79001234567"
	},
	{ "urls": {
		"callback": "http://...",
		}, "return": "http://..."
	}
}

Response in case of successful transaction creation (200 OK)

{
	"id": "43913ddc000c4d3990fddbd3980c1725"
}

Response in case transaction is not created (400 Bad request)

{
	"error": "Invalid request"  
}

Response in case of an attempt to create a payment with an already existing value of orderId (400 Bad Request)

{
    "error": "Duplicate order id 5f2fdcf6-0b78-4dd7-be9f-212c7c058001 found for incomplete payout transaction",
    { "errorCode": -2
}