This API generates an OTP for linking Mobikwik wallet account during checkout, enabling seamless wallet payments.
Environment
Environment | URL |
---|---|
Test | https://test.mobikwik.com/otpgenerate |
Production | https://walletapi.mobikwik.com/otpgenerate |
HTTP Method: POST
Request parameters
Parameter | Description | Example |
---|---|---|
midmandatory | String Unique parent merchant ID | MBK9006 |
cellmandatory | String Mobile number of the user | 9311032820 |
msgcodemandatory | String Message code to be sent | 504 |
merchantnameoptional | String Alias for the merchant | TestMerchant |
amountmandatory | Integer Maximum cap amount (not transaction amount) | 200 |
tokentypemandatory | Integer Token type (1 for token generation) | 1 |
checksummandatory | String Calculated checksum for validation | calculated_hash |
aggregatedMerchantIdoptional | String Unique ID for aggregateId merchants (For Aggregators Only) | AGG123 |
Notes:
- The
amount
parameter represents the maximum cap amount, not the actual transaction amount. The debit API will work for amounts less than or equal to this value.- The mobile number must be numeric, have 10 digits, and start with 7, 8, or 9
- Always validate the response checksum for security
- Use test environment for integration testing before going live
- The generated OTP is required for the Token Generate API
Checksum generation
For aggregators
Format: 'amount''cell''merchantname''mid''msgcode''tokentype''aggregatedMerchantId'
For direct merchants
Format: 'amount''cell''merchantname''mid''msgcode''tokentype'
Algorithm: HMAC SHA256
Secret Key: Provided by Mobikwik during merchant onboarding
Note:
For merchant
MBK9006
, the secret key isju6tygh7u7tdg554k098ujd5468o
. Each merchant will receive their unique secret key.
Sample request
POST https://test.mobikwik.com/otpgenerate
Content-Type: application/x-www-form-urlencoded
mid=MBK9006&checksum=0750ff30340013701841399ce85179e90fb186d747d828dbe1d9360d394b9cbc&cell=9311032820&msgcode=504&tokentype=1&amount=200&merchantname=TestMerchant
URL Format:
https://test.mobikwik.com/otpgenerate?mid=MBK9006&checksum=0750ff30340013701841399ce85179e90fb186d747d828dbe1d9360d394b9cbc&cell=9311032820&msgcode=504&tokentype=1&amount=200&merchantname=TestMerchant
Response parameters
Field | Description | Example |
---|---|---|
messagecode |
|
|
status |
|
|
statuscode |
|
|
statusdescription |
|
|
checksum |
|
|
Response attributes
The response checksum that will be returned to the users will have the following format:
Note:
Always validate the response checksum to ensure data integrity and security.
Status & Status Code | Status Code | Status description |
FAILURE | 20 | User Blocked |
FAILURE | 21 | Merchant Blocked |
FAILURE | 23 | Merchant not registered on MobiKwik |
FAILURE | 33 | User does not have sufficient balance in his wallet |
FAILURE | 51 | Length of parameter orderid must be between 8 to 30 characters |
FAILURE | 55 | Parameter cell is invalid. It must be numeric, have 10 digits and start with 7, 8 or 9 |
FAILURE | 120 | User does not exist |
FAILURE | 422 | User not allowed to do Transaction. Please fle a support ticket |
SUCCESS | 0 | Message Sent to xxxxxx208 |
Sample response
Success response
{
"messagecode": "504",
"status": "SUCCESS",
"statuscode": "0",
"statusdescription": "Message Sent to xxxxxx820",
"checksum": "8feac7700a4efd1ef08ea0ec5bf5921c3f1fc3398944421978794b9ada1c2c47"
}
Failure response
{
"messagecode": "504",
"status": "FAILURE",
"statuscode": "55",
"statusdescription": "Parameter cell is invalid. It must be numeric, have 10 digits and start with 7,8 or 9",
"checksum": "f25ac916fe4806591e16269fc912771456437b784fa144a77fa9842d154920cc"
}