Toripe API v1.0 • Bangladesh MFS Gateway

Developer API Documentation

Connect your eCommerce store, SaaS, or mobile application to automate bKash, Nagad, and Rocket payments with 3-second SMS verification and instant webhooks.

Overview & Base URL

The Toripe API enables automated payment processing for bKash, Nagad, and Rocket in Bangladesh. All requests use HTTP JSON over TLS/HTTPS and return response objects with a boolean success status.

PRODUCTION BASE URL
HTTPShttps://toripe.com/api

All API endpoints documented below are relative to this root URL (for example: /create-payment → https://toripe.com/api/create-payment).

HOW INTEGRATION WORKS
01

Create Order: Send a POST /api/create-payment with your API key, amount, and order ID.

02

Redirect Customer: Send customer to the returned payment_url checkout page to pay.

03

Auto-Reconciliation: The Toripe Android app reads the confirmation SMS and verifies the payment in ~3s.

04

Webhook Notification: Toripe triggers a payment.confirmed POST to your server to fulfill the order.

Authentication

Authenticate your API requests by passing your API Key in the JSON request body as api_key, or via the Authorization: Bearer trp_live_sk_... HTTP header.

Secret API Keys (trp_live_sk_...) are generated exclusively for active paid subscribers inside the private Toripe Merchant Dashboard (Premium Account Required).

Security Notice: Secret API Keys provide complete administrative authority to generate MFS payment orders and query transaction logs. Always store keys securely in server environment variables (process.env.TORIPE_API_KEY).
POST

Create Payment Order

/api/create-payment

Generates a new payment transaction and returns a hosted checkout URL (payment_url). Redirect your customer to this URL to complete payment via bKash, Nagad, or Rocket.

REQUEST BODY PARAMETERS
ParameterTypeRequiredDescription
api_keystringRequiredYour merchant secret API Key
amountnumberRequiredAmount in BDT (e.g. 1250)
gatewaystringOptionalPre-select gateway: "bKash" | "Nagad" | "Rocket"
order_idstringOptionalYour custom internal order/invoice reference
descriptionstringOptionalOrder description displayed on checkout
customer_namestringOptionalCustomer's full name
customer_emailstringOptionalCustomer email for instant receipts
customer_phonestringOptionalCustomer contact phone number
redirect_successstringOptionalURL customer is redirected to upon success
redirect_failstringOptionalURL customer is redirected to if payment fails
webhook_urlstringOptionalWebhook endpoint to receive instant status POSTs
Request Example
curl -X POST https://toripe.com/api/create-payment \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "trp_live_sk_YOUR_SECRET_KEY",
    "amount": 1250,
    "gateway": "bKash",
    "order_id": "INV-2026-9041",
    "description": "2x Premium Headphones",
    "customer_name": "Rahim Uddin",
    "customer_email": "rahim@example.com",
    "redirect_success": "https://yourshop.com/checkout/success",
    "redirect_fail": "https://yourshop.com/checkout/cancel",
    "webhook_url": "https://yourshop.com/api/toripe-webhook"
  }'
Response 200 OK
{
  "success": true,
  "payment_id": "TRP9041X78A",
  "payment_url": "https://toripe.com/pay/TRP9041X78A",
  "expires_at": "2026-08-11T12:30:00.000Z",
  "amount": 1250,
  "currency": "BDT"
}
POST

Verify Payment Status

/api/verify-payment

Check or manually verify payment verification state using the payment order ID or customer-submitted Transaction ID (TrxID).

Verify Request
curl -X POST https://toripe.com/api/verify-payment \
  -H "Content-Type: application/json" \
  -d '{
    "orderId": "TRP9041X78A",
    "transactionId": "9B7A2K109X"
  }'
POST

Android SMS Webhook

/api/sms-webhook

Receives real-time payment SMS forwarded by the official Toripe Android Gateway App installed on your personal bKash/Nagad phone.

📱 Instant Mobile Automation
1. Install the Toripe Gateway APK on your bKash/Nagad SIM phone.
2. Connect your device using your account token.
3. Incoming SMS from 16247 (bKash) or 16167 (Nagad) automatically approves merchant orders in under 3 seconds.

Merchant Webhook Events

When an order payment is successfully verified, Toripe triggers an instant HTTP POST request to your specified webhook_url.

Webhook Listener Code
{
  "event": "payment.confirmed",
  "payment_id": "TRP9041X78A",
  "order_id": "INV-2026-9041",
  "status": "confirmed",
  "amount": 1250,
  "currency": "BDT",
  "gateway": "bKash",
  "transaction_id": "9B7A2K109X",
  "customer_phone": "01711234567",
  "confirmed_at": "2026-08-11T09:42:15.000Z"
}

Error Codes & Statuses

HTTP StatusError CodeMeaning & Solution
401 UnauthorizedINVALID_API_KEYYour api_key is missing, invalid, or disabled. Check dashboard keys.
400 Bad RequestINVALID_AMOUNTThe amount must be a positive number.
403 ForbiddenBUSINESS_SUSPENDEDAccount is inactive or trial period has expired.
404 Not FoundORDER_NOT_FOUNDNo payment order matches the provided payment_id.
409 ConflictALREADY_VERIFIEDThis transaction has already been verified and processed.
500 Internal ErrorSERVER_ERRORUnexpected system error. Toripe engineering is automatically notified.