This API regenerates a wallet token using an existing token, ensuring continued wallet access without requiring new OTP verification.
Environment
Environment | URL |
---|---|
Test | https://test.mobikwik.com/tokengenerate |
Production | https://walletapi.mobikwik.com/tokengenerate |
Method: GET
Note:
This API uses the same endpoint as Token Generate API but with different parameters and method.
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 |
merchantnamemandatory | String Alias for the merchant | TestMerchant |
amountmandatory | Integer Maximum cap amount (not transaction amount) | 200 |
tokenmandatory | String Existing token to be regenerated | MBK_TOKEN_123456789 |
tokentypemandatory | Integer Token type (1 for token generation) | 1 |
checksummandatory | String Calculated checksum for validation | calculated_hash |
aggregatedMerchantIdoptional | String Unique ID for aggregated merchants (For Aggregators Only) | AGG123 |
📘 Important: 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.
Checksum generation
For aggregators
Format: 'amount''cell''merchantname''mid''msgcode''token''tokentype''aggregatedMerchantId'
For direct merchants
Format: 'amount''cell''merchantname''mid''msgcode''token''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
GET https://test.mobikwik.com/tokengenerate?mid=MBK9006&cell=9311032820&msgcode=504&merchantname=TestMerchant&amount=200&token=MBK_TOKEN_123456789&tokentype=1&checksum=calculated_hash_value
Response parameters
Field | Description | Example |
---|---|---|
messagecode |
|
|
status |
|
|
statuscode |
|
|
statusdescription |
|
|
token |
|
|
checksum |
|
|
Response Attributes
The response checksum that will be returned to the users will have the following format:
Status & Status Code | Status Code | Status description |
FAILURE | 22 | Merchant does not Exist |
FAILURE | 50 | Order Id already processed with this merchant |
FAILURE | 53 | Parameter email is invalid |
FAILURE | 54 | Parameter amount must be numeric with max 2 decimal places only |
FAILURE | 55 | Parameter cell is invalid. It must be numeric, have 10 digits and start with 7,8 or 9 |
FAILURE | 99 | Unexpected Error |
FAILURE | 150 | Invalid Message code specified in Input |
FAILURE | 155 | EIther OTP missing or Invalid OTP |
FAILURE | 158 | Please Provide either registered mobikwik Email or Mobile (Not Both) to uniquely identify you |
FAILURE | 181 | Either Email or Mobile is required for OTP generation |
FAILURE | 190 | Token Or OTP missing |
FAILURE | 198 | Either Token missing or Invalid Token or Token Expired |
FAILURE | 200 | Provide Either OTP or Token |
SUCCESS | 0 | Transaction completed successfully |
📘 Note: Always validate the response checksum to ensure data integrity and security.
Sample response
Notes:
- Always validate the response checksum for security
- The old token becomes invalid after successful regeneration
- Implement proper error handling for token regeneration failures
- Consider implementing automatic token refresh mechanisms
Success response
{
"messagecode": "504",
"status": "SUCCESS",
"statuscode": "0",
"statusdescription": "Token regenerated successfully",
"token": "MBK_TOKEN_987654321",
"checksum": "8feac7700a4efd1ef08ea0ec5bf5921c3f1fc3398944421978794b9ada1c2c47"
}
Failure scenarios
- Failure Response - Invalid Token
{
"messagecode": "504",
"status": "FAILURE",
"statuscode": "201",
"statusdescription": "Invalid or expired token provided",
"checksum": "f25ac916fe4806591e16269fc912771456437b784fa144a77fa9842d154920cc"
}
- Failure Response - Token Regeneration Limit Exceeded
{
"messagecode": "504",
"status": "FAILURE",
"statuscode": "202",
"statusdescription": "Token regeneration limit exceeded",
"checksum": "e35bc916fe4806591e16269fc912771456437b784fa144a77fa9842d154920dd"
}