Initiates a payment request with bKash, returning a payment ID and details for execution.
Request URL: {base_URL}/create
HTTP Method: POST
Request Headers
Header Name |
Value |
Description |
Content-Type |
application/json |
Specifies that the request body is in JSON format. |
Accept |
application/json |
Indicates that the client expects a JSON response. |
apikey |
<Your-API-Key> |
The API key provided by OnePayBD. |
Authorization |
Bearer <id_token> |
Token from Grant Token API. |
Request Parameters
Property |
Presence |
Type |
Description |
mode |
Mandatory |
String |
Payment mode (e.g., 0011 ). |
amount |
Mandatory |
String |
Payment amount (e.g., 50 ). |
currency |
Mandatory |
String |
Currency code (e.g., BDT ). |
intent |
Mandatory |
String |
Payment intent (e.g., sale ). |
merchantInvoiceNumber |
Mandatory |
String |
Unique invoice number (e.g., Inv0124 ). |
payerReference |
Mandatory |
String |
Payer reference (e.g., 0011 ). |
callbackURL |
Mandatory |
String |
Callback URL (e.g., http://yourdomain.com ). |
merchantAssociationInfo |
Optional |
String |
Merchant association info (e.g., MI05MID54RF09123456One ). |
Example Request
curl -X POST https://api.onepaybd.com/create \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "apikey: puqknyhi8cNx2LVdU5vAG0s6tlIoFSE9D3MeTZHfrJBb" \
-H "Authorization: Bearer eyJraWQiOiJEWXd6RU9Fd3h5Q3lkRVwvUnJZU1BOcGk5MENBQkVBeHZ0bUs1QXQ4XC9oaVk9IiwiYWxnIjoiUlMyNTYifQ..." \
-d '{
"mode": "0011",
"payerReference": "0011",
"callbackURL": "http://yourdomain.com",
"merchantAssociationInfo": "MI05MID54RF09123456One",
"amount": "50",
"currency": "BDT",
"intent": "sale",
"merchantInvoiceNumber": "Inv0124"
}'
Example Response
{
"paymentID": "TR0011hBohNSq1745392922876",
"bkashURL": "https://payment.bkash.com/?paymentId=TR0011hBohNSq1745392922876&hash=ZRKA0HXBW8DP!YOn.oNZaX9sZh3dhM5Iu)TMBsJ)rH(x1xahZt2E5uupGuT32V0B_ewIOe4fX1WBRd9AXR9u71(5Tuftibt5!2681745392922876&mode=0011&apiVersion=v1.2.0-beta/",
"callbackURL": "http://yourdomain.com",
"successCallbackURL": "http://yourdomain.com?paymentID=TR0011hBohNSq1745392922876&status=success&signature=zMQ5cPs4Yi",
"failureCallbackURL": "http://yourdomain.com?paymentID=TR0011hBohNSq1745392922876&status=failure&signature=zMQ5cPs4Yi",
"cancelledCallbackURL": "http://yourdomain.com?paymentID=TR0011hBohNSq1745392922876&status=cancel&signature=zMQ5cPs4Yi",
"amount": "50",
"intent": "sale",
"currency": "BDT",
"paymentCreateTime": "2025-04-23T13:22:02:876 GMT+0600",
"transactionStatus": "Initiated",
"merchantInvoiceNumber": "Inv0124",
"statusCode": "0000",
"statusMessage": "Successful"
}
Notes
- Use
paymentID
for Execute Payment and Payment Status APIs.
- Redirect users to
bkashURL
for payment.
merchantAssociationInfo
is optional but may be required by bKash.