INTEGRATE YOUR APPLICATION TO DIGIMART SUBSCRIPTION CHARGING SDK NOW
Subscription Charging Without Header Enrichment
Subscription Charging With Header Enrichment
Step 1 After the admin has approved your Digimart application, you can copy and save the 'API Key' and 'API Secret' allocated for your application. (See below to identify the place where these details are shown on your application)
If you have not created your Digimart application yet, please follow the tutorial for provisioning your Digimart application
Step 2
After you've got your application ready on Digimart, now you can prepare the subscription charging SDK request as instructed below.
Endpoint:
API Key | - | Displayed in the application you have created on Digimart. See step 1 in this tutorial. |
Request Id | - | A unique 15-digit identifier based on your preference. This value will be used to correlate the response and subscription charging notification received at the endpoint. |
Request Time | - |
Current time in UTC format (Eg: 20240227113053). • The request time is crucial for validating our end system. If you're using third-party libraries or different time zones, please ensure that the time is secured in the correct time zone: Asia/Dhaka (UTC+06:00). |
Request Signature | - | SHA 256 encrypted combination of API Key | API Secret | Request Time. |
Redirect URL | - | Page for the subscribers to be redirected upon successful/failure subscription. |
MSISDN | - | Mobile number belonging to the subscriber (Optional). |
Sample format with MSISDN is as shown below.
Sample format without MSISDN is as shown below.
Step 3 Once you evoke this GET request after preparing it as above, you should be able to load the below page on a web view in your mobile/web application.
Note : If msisdn is inserted in the URL, above mentioned UI will be skipped, Leading directly to the OTP UI.
Step 4 End user of your application can now request for an OTP by entering and submitting the mobile number from this page.
Step 5 Once the OTP is submitted on the above page, end user on your application will be charged for the subscription through his Grameenphone mobile account and upon a successful charge below page will be shown.
Step 6 If there is any error during the transaction processing journey, below page will be shown to the end user on your application.
Step 7 After clicking the 'Back to Application' button, end user on your application will be redirected to the URL you have mentioned under the parameter 'redirectUrl' in the initial subscription charging SDK GET request.
Step 8
Once the end user on your application has clicked on 'Back to Application' button, you will receive the below as the response for the subscription charging SDK GET request.
subscriptionStatus | - | Status code for the subscription (Success or Error code). |
subscriberId | - | Masked number corresponding to the subscriber |
requestId | - | The initial request ID allocated when transaction from Charging SDK is triggered for a particular user |
Note: You must store the mapping between the masked msisdn (referred to as subscriberId in the response) and the request id. This mapping is crucial for identifying the subscriber in subsequent operations or communications
Step 9
Further to that, you will receive a notification to the endpoint you have configured under the 'Subscription Notification URL' section while you were creating the application on Digimart. Below is a sample JSON response you will receive on the endpoint you have configured.
{
"timeStamp": "20240801044105",
"subscriberId": "ZmQ5YmRmMDA5NzdlZTzM5NjJjNjRkNWNiMjkzOWYxMzk4MzI3ZjYyM2UwMmJmYzY3YzpncmFtZWVucGhvbmU\u003d",
"subscriberRequestId": "123456789012100",
"123456789012100": "APP_000186",
"version": "2.0",
"frequency": "daily",
"status": "REGISTERED"
}
Note: From the subscription notification URL response, you can map the information based on the ‘masked msisdn‘ previously saved from the redirect URL response. This enables you to correlate the notification data with the correct subscriber identity securely and efficiently.
Code | Description |
---|---|
S1000 | Success |
E1001 | Error Occurred. Please Try Again. |
E1002 | Invalid Signature |
E1003 | Invalid Time Format |
E1004 | Request Timeout |
E1005 | Invalid Request Id |
E1006 | Invalid Api Key |
E1007 | Unauthorized |
E1008 | This Service Is Not Allowed For The Application. Please Contact Administrator. |
E1009 | Invalid Request |
E1010 | This Service Is Not Allowed For The SP. Please Contact Administrator |
E1011 | SDK Is Not Enabled For This Application. Please Contact Administrator |
E1012 | Please Start From The Beginning |
Code | Description |
---|---|
E1013 | Internal Error Occurred. Please Try Again. |
E1014 | Sorry, your number of verification attempts exceeded. Please try again in (xx) minutes. |
E1330 | Charging amount too low |
E1329 | Charging amount too high |
E2001 | Request OTP Failed Due to an Internal Error |
E2002 | You Have Exceeded Resend Attempts |
E2003 | OTP Verification Failed Due to an Internal Error |
E2004 | Subscriber MSISDN validation Failed Due to an Internal Error |
E3001 | User Already Registered |
E3002 | Authentication Failure. |
E3003 | Maximum Number of OTP Requests Reached |
E3004 | This Service Is Not Allowed for Your Operator |
E3005 | Your Mobile Number Is Not Whitelisted to Use This Application |
E3006 | Your Mobile Number Is Blacklisted to Use This Application |
E3007 | Your Mobile Number Has Reached Maximum Number of OTP Attempts |
E3009 | Your account balance is too low, recharge and try again |
E3008 | Invalid Mobile Number Format |
E4001 | Invalid OTP, please try again |
For the unsubscription, subscriber charging info and subscriber list APIs please visit the
API documentation
For any clarifications please do not hesitate to contact us
Copyrights © 2023. hSenid Mobile Solutions. All Rights Reserved.