ERIP tree API integration
Content
- Requirements for API requests
- Get ERIP tree
- Send required_attributes parameters, received in the response from a final node
- Register a payment, if a merchant has saved the client's final node and personal account ID
- Get a card token
- Void transaction
- Payment authorization and debiting funds from the client
Info
Please note that when paying using ERIP tree parameters you must not use the payment transaction type. Instead, use the authorization transaction type.
Requirements for API requests
All requests should:
- Use HTTP Basic authentication with Shop ID и shop secret key, has headers
Content-Type: application/jsonandAccept: application/json - Use SSL connection with 128-bit (or more complex) encryption
- Use UTF-8 encoding.
Get ERIP tree
Request parameters
To get a ERIP tree, send a POST to https://api.bepaid.by/beyag/gateways/komplat/get_pay_list.
List of the ERIP nodes will be received in the response. To open ERIP node, it is required to send a new request with pay_code of the node, which should be entered.
If a node in the request is final, the parameters that the client should fill out for the payment registration completion will be returned in the response.
|
Request example
{
"terminal_id": "10000002",
"pay_code": "11000000000",
"di_type": "9191"
}
Response parameters, if a node in the request is not final
|
Response example, if a node in the request is not final
[
{
"code":"11000304194",
"name":"Банковские, финансовые услуги",
"di_type":"9120"
},
{
"code":"11000300001",
"name":"БЕЛТЕЛЕКОМ",
"di_type":"9120"
},
{
"code":"11000300002",
"name":"Домофонные системы, Видеонаблюдение",
"di_type":"9120"
},
{
"code":"11000300088",
"name":"Интернет, Телевидение, Телефония",
"di_type":"9120"
},
{
"code":"11000300004",
"name":"Интернет-магазины/сервисы",
"di_type":"9120"
},
{
"code":"11000300005",
"name":"Коммунальные платежи",
"di_type":"9120"
},
{
"code":"11000300006",
"name":"Мобильная связь",
"di_type":"9120"
},
{
"code":"11000304212",
"name":"Налоги",
"di_type":"9120"
},
{
"code":"11000304351",
"name":"Стоянки, гаражи, парковки",
"di_type":"9120"
},
{
"code":"11000304168",
"name":"Суды, Юстиция, Юридические услуги",
"di_type":"9120"
}
]
Response parameters, if a node in the request is final
|
|||||||||||||||||||||||||
Response example, if a node in the request is final
{
"code": "10002642301",
"name": "оплата по номеру телефона",
"di_type": "9191",
"information": "Введите 9 цифр тестового номера телефона",
"customer_name": {
"first_name": null,
"middle_name": null,
"last_name": null
},
"required_attributes": [
{
"code": "1001",
"name": "тестовый номер телефона",
"min_length": "9",
"max_length": "9"
}
],
"information_attributes": [],
"erip_session_id": "00000000000121603908-01-FBBD95"
}
Send required_attributes parameters, received in the response from a final node
Request parameters
Send a POST request to https://api.bepaid.by/beyag/gateways/komplat/get_pay_list with the following parameters:
|
Request example
{
"terminal_id": "10000002",
"pay_code": "10004372291",
"di_type": "9191",
"erip_session_id": "00000000005698332392-01-A7512E",
"attributes": {
"1001": "0291234567"
}
}
Response parameters
|
|||||||||||||||||||||||||||||||||
Response example
{
"code": "10004372291",
"name": "Коммунальные платежи",
"di_type": "9191",
"billed_amount": "122.43",
"fixed_amount": true,
"currency": "BYN",
"information": null,
"information_attributes": [
{
"name": "Дата выставления",
"value": "12.03.2021"
},
{
"name": "Период",
"value": "02.2021"
},
{
"name": "Начислено",
"value": null
},
{
"name": "Начислено",
"value": "122,11 BYN"
},
{
"name": "Долг по пене",
"value": "0,32 BYN"
}
],
"customer_name": {
"first_name": null,
"middle_name": null,
"last_name": null
},
"erip_fine": "0.00",
"erip_commision": "0.00",
"erip_session_id": "00000000005698332392-00-0F0D24"
}
Register a payment, if a merchant has saved the client's final node and personal account ID
The method is used to implement saving the ERIP payment template. Thus, the client does not have to open ERIP tree. The parameters for the request should be stored in the Merchant's database.
Request parameters
Send a POST to https://api.bepaid.by/beyag/gateways/komplat/get_pay_list with the following parameters:
|
|||||||||||||||||||
Request example
{
"terminal_id": "10000002",
"pay_code": "10004345361",
"di_type": "9191",
"customer": {
"personal_account": "28923485423"
}
}
Response parameters
Response parameters are similar to described in the chapter Sending required_attributes parameters, received in the response from a final node.
Response example
{
"code": "10004345361",
"name": "Абонентская плата",
"di_type": "9191",
"billed_amount": "0.00",
"fixed_amount": false,
"currency": "BYN",
"information": "Введите лицевой счет Иван Иванович Иванов г. Минск, ул. Селицкого, д. 1, кв. 11, 1 под., 1 эт.-",
"information_attributes": [
{
"name": "Лицевой счет",
"value": "112233"
},
{
"name": "Период",
"value": "0221"
}
],
"customer_name": {
"first_name": null,
"middle_name": null,
"last_name": null
},
"erip_fine": "0.00",
"erip_commision": "0.00",
"erip_session_id": "00000000005656285468-00-664734"
}
Get a card token
The card token can be obtained beforehand, for example, when registering a client in the application. Then, make ERIP payments with the received token.
The request to getting a card token is similar to described in the chapter Authorization.
Void transaction
The request is used after successful authorization to cancel the blocking of funds after authorization.
The void transaction is similar to described in the chapter Void.
Payment authorization and debiting funds from the client
Info
Please note that when paying using ERIP tree parameters you must not use the payment transaction type. Instead, use the authorization transaction type.
The request is similar to described in the chapter Authorization.
After successful authorization, debiting funds from a client will be made automatically.
Description of ERIP parameters is published in the section request.additional_data.komplat in the chapter Authorization.
Request example
{
"request": {
"amount": 100,
"currency": "BYN",
"description": "Test transaction",
"tracking_id": "my_tracking_id",
"credit_card": {
"token": "144da09d-078e-4aca-8919-032c87763b55"
},
"additional_data": {
"komplat": {
"pay_code": "10000156731",
"di_type": "9191",
"erip_session_id": "00000000000117153888-00-46F3AE"
}
}
}
}