# P2P Card Credit

> For the complete documentation index, see [llms.txt](https://docs.fondy.io/llms.txt).

This endpoint allows a merchant to perform a peer-to-peer (P2P) card credit transaction, transferring funds directly to a recipient's card number or a stored receiver token. The request must include either `receiver_card_number` or `receiver_rectoken`, along with transaction details such as `order_id`, `order_desc`, and `amount`.

To secure this request, the merchant must generate a signature using their Credit private key specifically for `p2pcredit` operations.

**POST** `/p2pcredit`

Base URL: `https://pay.fondy.eu/api`

This endpoint allows a merchant to perform a peer-to-peer (P2P) card credit transaction, transferring funds directly to a recipient's card number or a stored receiver token. The request must include either `receiver_card_number` or `receiver_rectoken`, along with transaction details such as `order_id`, `order_desc`, and `amount`.

To secure this request, the merchant must generate a signature using their Credit private key specifically for `p2pcredit` operations.

## Header parameters

- `Content-Type` (string, required)
  Specifies the format for the request. Response will be in the same format.

## Body

Content type: `application/json`

- `request` (object)
  - `order_id` (string, required)
    A unique identifier for the order. This can be any value defined by the merchant, allowing you to use any internal order identification system your business employs.
  - `merchant_id` (integer, required)
    A unique identifier assigned to the merchant by Fondy upon account registration. This ID is required for authenticating requests and associating transactions with the merchant's account.
  - `order_desc` (string, required)
    A brief description of the order, encoded in UTF-8. This description will appear in payment records and can provide details for customer reference.
  - `signature` (string, required)
    Signature for request verification, generated according to Fondy’s algorithm. Required to verify merchant request consistency and authenticity.
    Learn how to use Fondy’s algorithm at the [Signature Generation for Request and Response](doc:signatures) page.
  - `amount` (integer, required)
    Total order amount in minor currency units (e.g., cents). For example, 1020 in EUR represents 10 euros and 20 cents. Separators or decimal points aren't allowed.
  - `currency` ("AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BRL" | "BSD" | "BTN" | "BWP" | "BZD" | "CAD" | "CDF" | "CHF" | "CLP" | "CNY" | "COP" | "CRC" | "CUP" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "IQD" | "IRR" | "ISK" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LTL" | "LVL" | "LYD" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MUR" | "MVR" | "MWK" | "MXN" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RWF" | "SAR" | "SBD" | "SCR" | "SDG" | "SEK" | "SGD" | "SHP" | "SLL" | "SOS" | "SRD" | "STD" | "SVC" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "UYU" | "UZS" | "VEF" | "VND" | "VUV" | "WST" | "XAF" | "XCD" | "XOF" | "XPF" | "YER" | "ZAR" | "ZMW" | "ZWD", required)
    Currency for the transaction (e.g., GBP, EUR, USD). Refer to the [Currencies](doc:supported-currencies) page for a full list of available currencies.
  - `version` (string)
    Specifies the protocol version. Use version '1.0.1' to ensure that the `additional_info` parameter is included in the callback response.
  - `response_url` (string)
    The URL where the customer is redirected after completing the payment. Typically used to display the transaction status or next steps.
  - `server_callback_url` (string)
    URL for server-to-server callback post payment. See [Receiving Callbacks](doc:callbacks) for more details on callbacks.
  - `payment_systems` (string)
    A list of allowed payment systems for processing this order, separated by commas or semicolons. If not specified, the default allowed payment systems set in the Fondy merchant portal will be used.

    Supported Values:

    | Payment system code | Description             |
    |---------------------|-------------------------|
    | `card`              | Visa/MasterCard/Maestro |
    | `banklinks_pl`      | Polland bank links      |
    | `banklinks_eu`      | European countries bank links |
    | `installments`      | Installments            |
  - `default_payment_system` (string)
    Specifies the preferred payment system to be displayed first to the customer. Supported values match those available in the `payment_systems` parameter.
  - `lifetime` (integer)
    The duration for which the order is valid, in seconds. Default is 36000 seconds (10 hours), with a maximum of 69120000 seconds (8 days).
  - `merchant_data` (string)
    Custom data provided by the merchant in the request. You can include any arbitrary string data relevant to your business needs, such as user IDs, session information, or notes. The data must be in string format and must not contain the '|' (pipe) character.
  - `preauth` ("Y" | "N")
    Pre-authorisation parameter for Visa/MasterCard payments to determine the timing of the charge.
  - `sender_email` (string)
    Your customer's email address. Fondy will send an email regarding the payment to this address.
  - `descriptor` (string)
    Dynamic descriptor appearing on the customer's bank statement to indicate transaction details.
  - `delayed` ("Y" | "N")
    Flag controlling the behavior of delayed payments, which impacts retry attempts if the initial payment fails.
  - `lang` ("az" | "cs" | "da" | "de" | "en" | "es" | "fi" | "fr" | "hu" | "it" | "ka" | "ko" | "lv" | "nl" | "pl" | "ro" | "ru" | "sk" | "uk" | "zh")
    Specifies the main language displayed to users during the payment process. Refer to the [Language Support](doc:checkout-language) page for more details.
  - `product_id` (string)
    Unique identifier assigned by the merchant for the product or service being purchased.
  - `required_rectoken` ("Y" | "N")
    Indicates if a card token should be generated by Fondy to facilitate recurring payments without cardholder re-entry. Set to 'Y' to request a card token for future payments. Refer to the [Recurring Payments](ref:recurring-payment) documentation for more details.
  - `verification` ("Y" | "N")
    Indicates whether Fondy should automatically reverse the payment after a successful approval, primarily used for card verification. Refer to the [Verification](doc:card-verification-guide) guide for more information.
  - `rectoken` (string)
    A reusable token generated by Fondy to facilitate card payments without cardholder re-entry for future transactions.
  - `receiver_rectoken` (string, required)
    Token used for crediting funds to a card without requiring the full card number. Primarily for use cases where the cardholder is a recipient.
  - `design_id` (integer)
    The unique identifier for a custom checkout page design as configured in the Fondy merchant portal.
  - `subscription` ("Y" | "N")
    Enables or disables scheduled (recurring) payments for this order. Set to 'Y' to activate scheduled payments for a subscription service, or 'N' to process a one-time payment.
  - `subscription_callback_url` (string)
    The URL for server callbacks triggered after each scheduled (recurring) payment is processed.
  - `recurring_data` (string<byte>)
    A Base64-encoded JSON string that configures the details of a recurring payment plan. When decoded, the JSON object specifies the schedule, amount, and start/end times for the recurring payments. 

    **Decoded JSON Structure:**
    ```json
    {
      "every": 1,
      "period": "month",
      "amount": 10000,
      "start_time": "2024-04-26",
      "end_time": "2025-04-26"
    }
    ```

    - **`every`** *(integer)*: Interval between payments. Defaults to `1` if not provided. Example: `1` represents one period (e.g., one month if `period` is "month").
    - **`period`** *(string)*: Unit of time for the payment interval. Defaults to `"month"` if not specified.
      - Accepted Values: `"day"`, `"week"`, `"month"`, `"year"`.
    - **`amount`** *(integer)*: Payment amount in minor currency units (e.g., cents). Example: `10000` represents $100.00 for currencies with two decimal places.
    - **`start_time`** *(string)*: Start date for the recurring payments in ISO 8601 format (e.g., `"2024-04-26"`). Defaults to the current date or the calculated start date if not provided.
    - **`end_time`** *(string)*: End date for the recurring payments in ISO 8601 format. Defaults to the system-defined end date if not provided.

Example:

```json
{
  "request": {
    "order_id": "ORDER_12345678",
    "merchant_id": 1,
    "order_desc": "Hotel booking №1234 Antalya Resort",
    "signature": "1773cf135bd89656131134b98637894dad42f808",
    "amount": 1020,
    "currency": "AED",
    "version": "1.0.1",
    "response_url": "http://site.com/responseurl",
    "server_callback_url": "http://site.com/callbackurl",
    "payment_systems": "card,banklinks_eu",
    "default_payment_system": "card",
    "lifetime": 600,
    "merchant_data": "string",
    "preauth": "N",
    "sender_email": "string",
    "descriptor": "string",
    "delayed": "Y",
    "lang": "en",
    "product_id": "string",
    "required_rectoken": "N",
    "verification": "N",
    "rectoken": "544d3f86237886b6404d8b000f6a7d71c45410b7",
    "receiver_rectoken": "string",
    "design_id": 123,
    "subscription": "N",
    "subscription_callback_url": "http://site.com/subscriptioncallback",
    "recurring_data": "eyJldmVyeSI6MSwicGVyaW9kIjoibW9udGgiLCJhbW91bnQiOjEwMDAwLCJzdGFydF90aW1lIjoiMjAyNC0wNC0yNiJ9"
  }
}
```

## Responses

### 200

The response for a successful transaction.

- `response` (object)
  Parameters of the final response
  - `order_id` (string)
    A unique identifier for the order. This can be any value defined by the merchant, allowing you to use any internal order identification system your business employs.
  - `merchant_id` (integer)
    A unique identifier assigned to the merchant by Fondy upon account registration. This ID is required for authenticating requests and associating transactions with the merchant's account.
  - `amount` (integer)
    Order amount in cents without separator.
  - `currency` ("AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BRL" | "BSD" | "BTN" | "BWP" | "BZD" | "CAD" | "CDF" | "CHF" | "CLP" | "CNY" | "COP" | "CRC" | "CUP" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "IQD" | "IRR" | "ISK" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LTL" | "LVL" | "LYD" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MUR" | "MVR" | "MWK" | "MXN" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RWF" | "SAR" | "SBD" | "SCR" | "SDG" | "SEK" | "SGD" | "SHP" | "SLL" | "SOS" | "SRD" | "STD" | "SVC" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "UYU" | "UZS" | "VEF" | "VND" | "VUV" | "WST" | "XAF" | "XCD" | "XOF" | "XPF" | "YER" | "ZAR" | "ZMW" | "ZWD")
    Currency for the transaction (e.g., GBP, EUR, USD). Refer to the [Currencies](doc:supported-currencies) page for a full list of available currencies.
  - `order_status` ("created" | "processing" | "declined" | "approved" | "expired" | "reversed")
    Order processing status indicating the current state of the transaction.
  - `response_status` (string)
    Request processing status (e.g., 'success' or 'failure').
  - `signature` (string)
    Order signature for request verification.
  - `tran_type` ("purchase" | "verification" | "p2p credit" | "p2p transfer" | "settlement" | "reverse")
  - `sender_cell_phone` (string)
    Customer's mobile phone number.
  - `sender_account` (string)
    Customer payment account.
  - `masked_card` (string)
    Masked card number.
  - `card_bin` (integer)
    First 6 digits of the card number.
  - `card_type` ("VISA" | "MasterCard")
  - `rrn` (string)
    Bank transaction ID, often not unique.
  - `approval_code` (string)
    Authorisation code returned by the bank.
  - `response_code` (integer)
    Order decline response code.
  - `response_description` (string)
    Description of the response code.
  - `reversal_amount` (integer)
    Total reversal amount for the current order.
  - `settlement_amount` (integer)
    Settlement amount for the current order.
  - `settlement_currency` ("AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BRL" | "BSD" | "BTN" | "BWP" | "BZD" | "CAD" | "CDF" | "CHF" | "CLP" | "CNY" | "COP" | "CRC" | "CUP" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "IQD" | "IRR" | "ISK" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LTL" | "LVL" | "LYD" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MUR" | "MVR" | "MWK" | "MXN" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RWF" | "SAR" | "SBD" | "SCR" | "SDG" | "SEK" | "SGD" | "SHP" | "SLL" | "SOS" | "SRD" | "STD" | "SVC" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "UYU" | "UZS" | "VEF" | "VND" | "VUV" | "WST" | "XAF" | "XCD" | "XOF" | "XPF" | "YER" | "ZAR" | "ZMW" | "ZWD")
    Currency for the transaction (e.g., GBP, EUR, USD). Refer to the [Currencies](doc:supported-currencies) page for a full list of available currencies.
  - `order_time` (string<date-time>)
    Order creation date in DD.MM.YYYY hh:mm:ss format.
  - `settlement_date` (string<date>)
    Settlement date in DD.MM.YYYY format.
  - `eci` (5 | 6 | 7)
    Ecommerce Indicator for 3DSecure authentication status.
  - `fee` (integer)
    Fee charged by Fondy.
  - `payment_system` (string)
    Payment system used for the transaction.
  - `sender_email` (string)
    Your customer's email address. Fondy will send an email regarding the payment to this address.
  - `payment_id` (integer)
    Unique payment ID generated by Fondy.
  - `actual_amount` (integer)
    Actual amount held or charged from the card.
  - `actual_currency` ("AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BRL" | "BSD" | "BTN" | "BWP" | "BZD" | "CAD" | "CDF" | "CHF" | "CLP" | "CNY" | "COP" | "CRC" | "CUP" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "IQD" | "IRR" | "ISK" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LTL" | "LVL" | "LYD" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MUR" | "MVR" | "MWK" | "MXN" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RWF" | "SAR" | "SBD" | "SCR" | "SDG" | "SEK" | "SGD" | "SHP" | "SLL" | "SOS" | "SRD" | "STD" | "SVC" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "UYU" | "UZS" | "VEF" | "VND" | "VUV" | "WST" | "XAF" | "XCD" | "XOF" | "XPF" | "YER" | "ZAR" | "ZMW" | "ZWD")
    Currency for the transaction (e.g., GBP, EUR, USD). Refer to the [Currencies](doc:supported-currencies) page for a full list of available currencies.
  - `product_id` (string)
    Merchant's product or service ID.
  - `merchant_data` (string)
    Custom data provided by the merchant in the request. You can include any arbitrary string data relevant to your business needs, such as user IDs, session information, or notes. The data must be in string format and must not contain the '|' (pipe) character.
  - `verification_status` ("verified" | "incorrect" | "failed" | "created")
    Code verification result.
  - `rectoken` (string)
    Token for accessing card funds without cardholder interaction.
  - `rectoken_lifetime` (string<date-time>)
    Token expiration date in DD.MM.YYYY hh:mm:ss format.
  - `additional_info` (object)
    Additional information in JSON format.
    - `bank_name` (string)
      Bank name.
    - `bank_country` (string)
      Bank country.
    - `bank_response_code` (string)
      Response code from the bank.
    - `card_product` (string)
      Type of card product.
    - `card_category` (string)
      Category of the card.
    - `settlement_fee` (number)
      Settlement fee.
    - `capture_status` (string)
      Status of the capture.
    - `client_fee` (number)
      Fee charged to the client.
    - `ipaddress_v4` (string)
      IP address in IPv4 format.
    - `capture_amount` (integer)
      Amount captured.
    - `card_type` ("VISA" | "MasterCard")
      Type of the card used.
    - `reservation_data` (string)
      Reservation data.
    - `bank_response_description` (string)
      Description of the bank's response.
    - `transaction_id` (integer)
      Transaction ID from the bank.
    - `timeend` (string<date-time>)
      End time for the transaction.
    - `card_number` (string)
      Card number used.
    - `payment_method` ("apple" | "googlepay" | "card")
      Payment method used.

Example:

```json
{
  "response": {
    "order_id": "ORDER_12345678",
    "merchant_id": 1,
    "amount": 0,
    "currency": "AED",
    "order_status": "created",
    "response_status": "string",
    "signature": "string",
    "tran_type": "purchase",
    "sender_cell_phone": "string",
    "sender_account": "string",
    "masked_card": "string",
    "card_bin": 0,
    "card_type": "VISA",
    "rrn": "string",
    "approval_code": "string",
    "response_code": 0,
    "response_description": "string",
    "reversal_amount": 0,
    "settlement_amount": 0,
    "settlement_currency": "AED",
    "order_time": "1970-01-01T00:00:00.000Z",
    "settlement_date": "2024-01-01",
    "eci": 5,
    "fee": 0,
    "payment_system": "string",
    "sender_email": "string",
    "payment_id": 0,
    "actual_amount": 0,
    "actual_currency": "AED",
    "product_id": "string",
    "merchant_data": "string",
    "verification_status": "verified",
    "rectoken": "string",
    "rectoken_lifetime": "1970-01-01T00:00:00.000Z",
    "additional_info": {
      "bank_name": "string",
      "bank_country": "string",
      "bank_response_code": "string",
      "card_product": "string",
      "card_category": "string",
      "settlement_fee": 0,
      "capture_status": "string",
      "client_fee": 0,
      "ipaddress_v4": "string",
      "capture_amount": 0,
      "card_type": "VISA",
      "reservation_data": "string",
      "bank_response_description": "string",
      "transaction_id": 0,
      "timeend": "1970-01-01T00:00:00.000Z",
      "card_number": "string",
      "payment_method": "apple"
    }
  }
}
```