Deposit
Overview
Pay2Local offers flexible deposit flows to accommodate different merchant needs and customer preferences. Service types (p2p_agent and p2c_qr) work with both H2H (Host-to-Host) and Redirect flows, giving merchants complete control over the payment experience. While p2c_api only works with Redirect Flow.
Service Types & Flow Choices
p2p_agent and p2c_qr service types support both H2H and Redirect flows. The merchant decides which flow to use after receiving the API response.
p2c_api Only Supports redirect Flow.
Service Types Explained
| Service Type | Description | Best For |
|---|---|---|
| p2p_agent | Person-to-Agent payment | All scenarios, most flexible |
| p2c_qr | Person-to-Consumer via QR | In-store payments, QR code scanning |
| p2c_api | Person-to-Consumer via API | Web applications, API integrations |
Flow Options for Each Service
| Service Type | H2H Flow | Redirect Flow |
|---|---|---|
| p2p_agent | ✅ Supported | ✅ Supported |
| p2c_qr | ✅ Supported | ✅ Supported |
| p2c_api | ❌ Not Supported | ✅ Supported |
Flow Decision: H2H vs Redirect
Option 1: H2H Flow (Merchant-Controlled)
Process: Customer pays directly to agent_number via their mobile banking app.
agent_number from response and show it to Customer.Option 2: Redirect Flow (Pay2Local-Controlled)
Process: Redirect customer to redirect_url where Pay2Local handles payment
Key Differences: H2H vs Redirect
| Aspect | H2H Flow | Redirect Flow |
|---|---|---|
| Control | Merchant-controlled | Pay2Local-controlled |
| Customer Interface | Merchant Managed | Pay2Local payment page |
| Merchant Responsibility | Collect TRX ID, submit via API | Just redirect customer |
| Additional API Calls | Required (H2H submit) | None required |
| User Experience | Merchant Managed | Standardized payment page |
Authorization
ApiKeyAuth ApiPublicKey Access Key value shared by Pay2Local during on-boarding
In: header
Public Key value shared by Pay2Local during on-boarding
In: header
Request Body
application/json
The exact amount customer will deposit
URL where the customer will be redirected after attempting payment
uriUnique payment number identifier generated by the merchant
The transaction currency
"BDT"Defines how the deposit will be processed
"p2p_agent" | "p2c_qr" | "p2c_api"Specifies which wallet/bank to use
"Nagad" | "Bkash" | "Upay" | "Rocket"Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://api.pay2local.com/api/v1/payment/deposits" \ -H "Content-Type: application/json" \ -d '{ "amount": 5.5, "redirect_url": "https://abc.com/example", "merchant_payment_id": "100058130003", "currency": "BDT", "service_type": "p2p_agent", "bank_type": "Bkash" }'{
"requested_amount": 50,
"merchant_payment_id": "100058130003",
"request_type": "Deposit",
"bank_type": "Bkash",
"service_type": "p2p_agent",
"currency": "BDT",
"redirect_url": "https://pay2bd.com/deposit/69caaa2e-b785-43d0-b632-b0aa5e46b722",
"request_id": "236a4d5f-884a-4934-90af-04306146c328",
"message": "Success",
"status": 200
}{
"message": "Bad Request",
"status": 400
}{
"message": "Bad Request",
"status": 400
}{
"message": "Bad Request",
"status": 400
}Notes
Callback URL
Ensure that the callback_url is accessible, as it will receive the response after the payment is processed.