Alif
A customer can make a purchase or top up their balance in the merchant's system using Alif Mobi application, provided the merchant is registered in Alif system.
Payment flow
- The customer selects the merchant from the list of the available merchants in Alif Mobi application and initiates the payment.
- bePaid receives payment information from Alif.
- bePaid requests account verification from the merchant.
- Merchant responds to the bePaid with the verification result. If the customer is registered in their system,
"result": 0
must be sent. If processing the request results in an error, the code other than0
must be sent in theresult
field. The merchant must respond within 14 seconds. Otherwise, the transaction request returns aRequest timeout
error. - bePaid sends a webhook notification to the merchant with the transaction result.
Account verification
- The merchant must accept the requests from bePaid to the endpoint
/account_verification
. - The merchant must send a response to the account verification request in JSON format.
-
The request will contain the following headers:
Accept: application/json
Content-type: application/json
-
The merchant's application needs to support Basic Auth authorization type. The request sent to the merchant system will contain HTTP header
Authorization
with the valueBasic [Base64 encoded login: password]
whereShop ID
is used as a login andSecret Key
is used as a password. For example,Authorization: Basic bG9sOnNlY3VyZQ==
. See how to find Shop ID and Secret key here. - The merchant's application must be able to process HTTP POST requests.
- The response must be sent within a 14-second timeframe. Otherwise, bePaid terminates the connection with a
Request timeout
error. -
The merchant's application must accept HTTPS-requests from the IP addresses of bePaid and on specific TCP ports.
Info
To get an up-to-date list of the IP addresses and TCP ports, contact your manager.
Request
Parameter | Type | Description |
---|---|---|
request | object | |
account * required |
string | Unique customer's idenitifer in the merchant's system, for example, their phone number or account number. |
id * required |
string | Unique transaction identifier in the bePaid system. |
amount * required |
integer | Transaction amount. |
currency *required |
string | Transaction currency in the ISO-4217 alpha-3 code format. For example, TJS . |
info | object | Object with the additional customer identification parameters. The parameters correspond to the ones specified by the merchant when registering with Alif. |
method | object | |
type | string | alif_mobi |
Request example
{
"request":{
"account": "3542-24t24g2424242-234t22-235v8yui",
"id": "g95k8w0gk943l",
"amount":100,
"currency":"TJS",
"info":{
"fieldId1":"value1",
"fieldId2":"value2"
},
"method":{
"type": "alif_mobi"
}
}
}
Response
Parameter | Type | Description |
---|---|---|
response | object | |
id * required |
string | Unique transaction identifier in the bePaid system, id from the request. |
tracking_id * required |
string | Unique transaction identifier in the merchant's system. |
amount * required |
integer | The transaction amount. |
currency * required |
string | Transaction currency sent in the request. |
result * required |
string | Error code. |
description | string | Description of the code. |
Response example
{
"response":{
"id":"3542-24t24g2424242-234t22-235v8yui",
"tracking_id":"your_uniq_number",
"amount":100,
"currency":"TJS",
"result":"0",
"description":"OK"
}
}
Response error codes
Code | Description |
---|---|
0 | OK |
1 | Request timeout error. Try again later. |
4 | Wrong format of the customer account ID. |
5 | Customer account ID not found. Account number error. |
7 | Payment is forbidden by the merchant. |
8 | Payment is forbidden for a technical reason. |
9 | Transaction does not exist. |
10 | Payment rejected. |
11 | Duplicate, status not final. |
12 | Duplicate, successful status. |
90 | Transaction incomplete. |
241 | Transaction amount is too small. |
242 | Transaction amount is too big. |
243 | Unable to check the customer account. |
300 | Unknown error. |