API reference
Charging as a Service
Monetize your app with frictionless micro-payments. Charge an amount directly to a subscriber's Banglalink bill, approved by an OTP they enter. No cards, no wallets.
- Base URL
- https://api.applink.com.bd
- Content type
- application/json;charset=utf-8
- Endpoints
- 3
OTP Generation
https://api.applink.com.bd/caas/direct/debitThis service is used by the developer to initiate a one time charging for the subscriber on his/her mobile account. Upon the request, Applink will generate and send an OTP to the subscriber's MSISDN. This OTP must be entered by the subscriber into the mobile/web application to authorize the one time charge.
Request body
application/json;charset=utf-8
applicationIdstringRequired- Used to identify the application. This is a unique identifier generated while provisioning an application. Only a single value can be sent per request.Example
APP_999999 passwordstringRequired- This API key will be sent to your registered email address on the platform upon application approval.Example
a07118cda5215fc6d01db5b2ab848edd externalTrxIdstringRequired- This is the transaction ID generated by the application to map the request with the response. This is needed to provide information when there are inquiries related to a transaction. Only a single value can be sent per request.Example
256091232 amountstringRequired- Amount to be reserved for charging. Only a single value can be sent per request.Example
5.00 paymentInstrumentNamestringRequired- The name of the payment instrument. Only a single value can be sent per request.Example
Mobile Account subscriberIdstringRequired- This is the MSISDN of the subscriber to be charged. This is a unique identifier. Eg: tel: 8801959979376 Note: This can be a masked number depending on the type of the application. Only a single value can be sent per request.Example
tel:8801973579363 CurrencystringRequired- Currency unit of the amount. Only a single value can be sent per request. Only ‘BDT’ is allowed.Example
BDT
curl -X POST https://api.applink.com.bd/caas/direct/debit \
-H "Content-Type: application/json;charset=utf-8" \
-d '{
"applicationId": "APP_999999",
"password": "a07118cda5215fc6d01db5b2ab848edd",
"externalTrxId": "256091232",
"amount": "5.00",
"paymentInstrumentName": "Mobile Account",
"subscriberId": "tel:8801973579363",
"Currency": "BDT"
}'Response
timeStampstringRequired- The time that the request was sentExample
2023-11-08T08:02:16.913Z externalTrxIdstringRequired- This is the transaction ID generated by the application to map the request with the response. Only a single value can be sent per request.Example
256091232 statusDetailstringRequired- Human-readable description of the status. See the status code table.Example
Request successfully proceed. OTP will send to user. requestCorrelatorstringRequired- The unique identifier used internally within the system to identify the transactionExample
8801442233146169943053700500040 internalTrxIdstringRequired- The transaction ID generated by the service provider which can be used to track the transactionExample
9110808020001876 statusCodestringRequired- Status code for the request. S = success, E = error, P = partial. See the status code table.Example
P1003
{
"timeStamp": "2023-11-08T08:02:16.913Z",
"externalTrxId": "256091232",
"statusDetail": "Request successfully proceed. OTP will send to user.",
"requestCorrelator": "8801442233146169943053700500040",
"internalTrxId": "9110808020001876",
"statusCode": "P1003"
}OTP Verification
https://api.applink.com.bd/caas/otp/verifyThis service is used by the developer to verify an OTP entered by a subscriber into the application. Upon a successful verification, one time charging will be deducted from the subscriber's mobile account.
Request body
application/json;charset=utf-8
applicationIdstringRequired- Used to identify the application. This is a unique identifier generated while provisioning an application. Only a single value can be sent per request.Example
APP_999999 passwordstringRequired- This API key will be sent to your registered email address on the platform upon application approval.Example
Your API Key referenceNostringRequired- The value returned for parameter 'requestCorrelator' in the response of the CaaS OTP generation request must be used here as the reference of the transactionExample
8801442233146169943053700500040 otpstringRequired- Specify the OTP entered by the subscriber on the developer application.Example
123456 sourceAddressstringRequired- Source Address shows the MSISDN that requested the OTPExample
tel:8801973579363
curl -X POST https://api.applink.com.bd/caas/otp/verify \
-H "Content-Type: application/json;charset=utf-8" \
-d '{
"applicationId": "APP_999999",
"password": "Your API Key",
"referenceNo": "8801442233146169943053700500040",
"otp": "123456",
"sourceAddress": "tel:8801973579363"
}'Response
The published specification does not define a response body for this endpoint: it repeats the request fields in its place. Read statusCode and statusDetail in the reply, as with the other CaaS calls.
Charging Notification
your endpoint · /caas/chargingNotificationCharging notification is returned to the developer application upon a charging attempt. It will denote whether the charging is successful or not. Charging notification is returned to the endpoint you have configured under the 'charging notification URL' section in CaaS API when creating the application
Request
application/json;charset=utf-8
There is no request to be triggered in order to obtain this charging notification. It will be automatically returned as a callback to the initial charging request once the transaction is completed within the system.
Notification AppLink sends you
timeStampstringRequired- The time which the request was sentExample
15-Nov-2023 11:55 TotalAmountstringRequired- Amount deducted from the subscriber as the one time chargeExample
5.00 externalTrxIdstringRequired- This is the transaction ID generated by the application to map the request with the response. This is needed to provide information when there are inquiries related to a transaction. Only a single value can be sent per request.Example
256091234 balanceDuestringRequired- The amount that is due will be displayed if there is any, if not it will show 0Example
0 statusDetailstringRequired- Human-readable description of the status. See the status code table.Example
Request was Successfully processed, Due amount fully paid. currencystringRequired- Currency unit of the amount. Only a single value can be sent per request. Only ‘BDT’ is allowed.Example
BDT versionstringRequired- API version shall be numbered as 1.0, 2.0 etc. If version is specified in the request, same version must be sent in the response. If version is not specified in the request, the latest version will be specified in the response.Example
1.0 internalTrxIdstringRequired- The unique identifier used to track the request at the developer application endExample
9111511550014764 paidAmountstringRequired- The amount that is paid by the subscriber.Example
5.00 referenceIdstringRequired- The unique reference used to identify the transaction within the systemExample
8801422222550170004932307900016 statusCodestringRequired- Status code for the request. S = success, E = error, P = partial. See the status code table.Example
S1000
{
"timeStamp": "15-Nov-2023 11:55",
"TotalAmount": "5.00",
"externalTrxId": "256091234",
"balanceDue": "0",
"statusDetail": "Request was Successfully processed, Due amount fully paid.",
"currency": "BDT",
"version": "1.0",
"internalTrxId": "9111511550014764",
"paidAmount": "5.00",
"referenceId": "8801422222550170004932307900016",
"statusCode": "S1000"
}