Pay OUT H2H Integration
In this document, you may find the API methods for Payouts H2H integration of Pear2Payear2.
(Authorization) Signatures
To authenticate requests securely, Pear2Pay requires
signatures included in the pear2pay-signature header.
Here's how it works:
-
Generate API Key and Secret:
- Create an API Key (Terminal) in the Merchant panel.
- Copy both the API Key and Secret immediately, as they are displayed only once.
-
Signature Verification:
- A signature is generated by hashing the request body using HMAC with your Secret Key.
-
The client sends the signature in the
pear2pay-signatureheader, and the server verifies it by re-computing and comparing signatures.
How to get signature from secret key:
Step 1: Retrieve the List of available Banks (Payment Methods)
Endpoint:
GET https://api.pear2pay.com/api/payments/common/list_banks/
Query Parameters:
-
currency: The currency code (e.g.,RUB).
-
by_payout_offer: If you want to get only banks supported for the active payout offer.(e.g.,True).
Response:
[
{
"id": 20,
"name": "СБП",
"icon_url": "",
"payment_types": [
"PHONE_NUMBER"
],
"purposes": [
"SENDER",
"RECIPIENT"
],
"is_enabled": true,
"required_fields": {
"payout_fields": [
{
"label": "Email of the payee",
"props": {
"type": "email",
"required": true
},
"field_name": "email",
"is_required": true
},
{
"label": "Receiver Name",
"props": {
"required": false
},
"field_name": "name",
"is_required": false
},
{
"label": "Payout Card Number",
"props": {
"required": true
},
"field_name": "payout_card_number",
"is_required": true
}
],
"invoice_fields": [
{
"label": "Email of the payer",
"props": {
"type": "email",
"required": false # This prop only used for frontend form
},
"field_name": "email",
"is_required": false # If true, this field must be provided when creating an invoice.
},
{
"label": "Last 4 digits of phone number"
"props": {
"required": true
},
"field_name": "last_n_digits",
"is_required": true
}
]
}
}
]
Response Body Description
Each object in the response represents a bank and contains the following fields:
- id: Unique identifier of the bank.
- name: Name of the bank.
- icon_url: URL of the bank's icon (can be used for displaying on the frontend).
- payment_types: List of supported payment types.
- purposes: List of purposes for which the bank can be used (e.g., SENDER, RECIPIENT).
- is_enabled: Indicates if the bank is currently enabled.
-
required_fields: Contains information about
additional fields required for payouts and invoices.
- payout_fields: Fields required for payout operations (not used for invoice creation).
-
invoice_fields: Fields required for invoice
creation. Each field includes:
- label: Field label for display.
- props: Additional properties (e.g., type, required).
- field_name: Name of the field to be sent in the request.
-
is_required: If
true, this field must be provided when creating an invoice. Iffalse, the field is optional and should not be sent unless filled by the user.
Note:
When creating an invoice, use the fields listed in
payout_fields. Only send values for fields where
is_required is true. Optional fields (is_required: false) can be omitted if not filled by the user.
Step 2: Generate Payout Invoice
To generate a payout invoice, use the following API method:
Endpoint:
POST https://api.pear2pay.com/api/v2/payments/merchant/generate_payout_invoice/
Headers:
{
"Content-Type": "application/json",
"Authorization": "string", // API key
"pear2pay-signature": "signature"
}
Payload:
{
"currency": "RUB", // Currency (ISO currency code)
"order_id": "string", // Order ID in your system
"amount": "1234.56", // Amount in currency (string format, separated by dot)
"callback_url": "http://example.com/callback", // Callback URL in your system to receive invoice status
"client_id": "client123", // External client ID provided by the merchant (optional)
"bank_id": 20, // Bank ID
"payout_card_number": "1234 5678 9012 3456", // Card number that the payout will be sent to (optional)
"email": "user@example.com" // User's email (if not provided, use 'user@example.com')
}
Response:
{
"payout_invoice": {
"created_at": "2025-04-09T08:21:27.892Z",
"created_by": 0,
"updated_at": "2025-04-09T08:21:27.892Z",
"updated_by": 0,
"id": 0,
"uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"status": "CREATED",
"amount": "1234.56",
"currency": "RUB",
"crypto_amount": "string",
"order_id": "string",
"rate": "string",
"fee": "0.",
"success_url": "string",
"fail_url": "string",
"is_sum_changed": true,
"payout_from_crypto": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
},
"card_holder_name": "string",
"payout_card_number": "string"
},
"paymentURL": "string"
}
Step 3: Approve Payout
To approve the payout invoice, use the following API method:
Endpoint:
POST
https://api.pear2pay.com/api/v2/payments/client/approve_payout_invoice/:uuid/
URL Parameters:
-
uuid: The unique identifier for the payout invoice.
Headers:
{
"Content-Type": "application/json",
"Authorization": "string", // API key
"pear2pay-signature": "signature"
}
Response:
{
"created_at": "2025-04-09T08:36:13.726Z",
"created_by": 0,
"updated_at": "2025-04-09T08:36:13.726Z",
"updated_by": 0,
"id": 0,
"uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"status": "CREATED",
"amount": "1234.56",
"currency": "RUB",
"crypto_amount": "string",
"order_id": "string",
"rate": "string",
"fee": "0.12",
"success_url": "string",
"fail_url": "string",
"is_sum_changed": true,
"payout_from_crypto": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
},
"card_holder_name": "string",
"payout_card_number": "string"
}
Callback
When the status of invoice is changed, the callback is sent to
callback_url
POST callback_url
Payload:
{
"id": 326,
"uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"status": "CONFIRMED",
"amount": 1234.56,
"currency": "RUB",
"crypto_amount": 123.4,
"order_id": "test_order",
"rate": 100.0000,
"fee": 0.0600,
"success_url": "https://example.com/success",
"fail_url": "https://example.com/fail",
"is_sum_changed": false,
"payout_from_crypto": true,
"card_holder_name": "SOME NAME",
"payout_card_number": "4174 5566 7788 9911",
"created_at": "2014-10-16T15:11:52.135372Z",
"created_by": 58,
"updated_at": "2015-01-21T06:50:00.025354Z",
"updated_by": 58,
"signature": "signature"
}
Possible statuses for invoice:
Extra:
Check Payout Status
To check the current status of a payout, use the following API method:
Endpoint:
GET
https://api.pear2pay.com/api/payments/client/get_payout_invoice/:uuid/
URL Parameters:
-
uuid: The unique identifier for the payout invoice.
Response:
{
"created_at": "2025-04-09T08:37:41.828Z",
"created_by": 0,
"updated_at": "2025-04-09T08:37:41.828Z",
"updated_by": 0,
"id": 0,
"uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"email": "user@example.com",
"name": "string",
"status": "CREATED",
"payout_card_number": "string",
"currency": "RUB",
"amount": "-1234.56",
"crypto_amount": "-1902811451674344592.906",
"expires_at": "2025-04-09T08:37:41.828Z",
"success_url": "string",
"fail_url": "string",
"card_holder_name": "string",
"comment": "string"
}