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.
https://toripe.com/apiAll API endpoints documented below are relative to this root URL (for example: /create-payment → https://toripe.com/api/create-payment).
Create Order: Send a POST /api/create-payment with your API key, amount, and order ID.
Redirect Customer: Send customer to the returned payment_url checkout page to pay.
Auto-Reconciliation: The Toripe Android app reads the confirmation SMS and verifies the payment in ~3s.
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).
process.env.TORIPE_API_KEY).Create Payment Order
/api/create-paymentGenerates 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | string | Required | Your merchant secret API Key |
| amount | number | Required | Amount in BDT (e.g. 1250) |
| gateway | string | Optional | Pre-select gateway: "bKash" | "Nagad" | "Rocket" |
| order_id | string | Optional | Your custom internal order/invoice reference |
| description | string | Optional | Order description displayed on checkout |
| customer_name | string | Optional | Customer's full name |
| customer_email | string | Optional | Customer email for instant receipts |
| customer_phone | string | Optional | Customer contact phone number |
| redirect_success | string | Optional | URL customer is redirected to upon success |
| redirect_fail | string | Optional | URL customer is redirected to if payment fails |
| webhook_url | string | Optional | Webhook endpoint to receive instant status POSTs |
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"
}'{
"success": true,
"payment_id": "TRP9041X78A",
"payment_url": "https://toripe.com/pay/TRP9041X78A",
"expires_at": "2026-08-11T12:30:00.000Z",
"amount": 1250,
"currency": "BDT"
}Verify Payment Status
/api/verify-paymentCheck or manually verify payment verification state using the payment order ID or customer-submitted Transaction ID (TrxID).
curl -X POST https://toripe.com/api/verify-payment \
-H "Content-Type: application/json" \
-d '{
"orderId": "TRP9041X78A",
"transactionId": "9B7A2K109X"
}'Android SMS Webhook
/api/sms-webhookReceives real-time payment SMS forwarded by the official Toripe Android Gateway App installed on your personal bKash/Nagad 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.
{
"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 Status | Error Code | Meaning & Solution |
|---|---|---|
| 401 Unauthorized | INVALID_API_KEY | Your api_key is missing, invalid, or disabled. Check dashboard keys. |
| 400 Bad Request | INVALID_AMOUNT | The amount must be a positive number. |
| 403 Forbidden | BUSINESS_SUSPENDED | Account is inactive or trial period has expired. |
| 404 Not Found | ORDER_NOT_FOUND | No payment order matches the provided payment_id. |
| 409 Conflict | ALREADY_VERIFIED | This transaction has already been verified and processed. |
| 500 Internal Error | SERVER_ERROR | Unexpected system error. Toripe engineering is automatically notified. |