Pay2bd APIs Documentation

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 TypeDescriptionBest For
p2p_agentPerson-to-Agent paymentAll scenarios, most flexible
p2c_qrPerson-to-Consumer via QRIn-store payments, QR code scanning
p2c_apiPerson-to-Consumer via APIWeb applications, API integrations

Flow Options for Each Service

Service TypeH2H FlowRedirect 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.

Grab 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

AspectH2H FlowRedirect Flow
ControlMerchant-controlledPay2Local-controlled
Customer InterfaceMerchant ManagedPay2Local payment page
Merchant ResponsibilityCollect TRX ID, submit via APIJust redirect customer
Additional API CallsRequired (H2H submit)None required
User ExperienceMerchant ManagedStandardized payment page


POST
/payment/deposits

Authorization

ApiKeyAuth ApiPublicKey

X-Authorization-Access<token>

Access Key value shared by Pay2Local during on-boarding

In: header

X-Authorization-Public<token>

Public Key value shared by Pay2Local during on-boarding

In: header

Request Body

application/json

amount*string

The exact amount customer will deposit

redirect_url*string

URL where the customer will be redirected after attempting payment

Formaturi
merchant_payment_id*string

Unique payment number identifier generated by the merchant

currency*string

The transaction currency

Value in"BDT"
service_type*string

Defines how the deposit will be processed

Value in"p2p_agent" | "p2c_qr" | "p2c_api"
bank_type*string

Specifies which wallet/bank to use

Value in"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.

On this page