Mobipay
Mobipay offers real time airtime top-ups more than 550 mobile operators across 160 countries.
Getting Started: Account Set-Up and Management
Corezoid Project structure
Сorezoid process “Config”
In storage folder is located a Config-process(further config_process_id
). Remember it ID.
Retrieve your account credentials
Account credentials is JSON-file. It can provide you by Middleware manager. Example of file:
{
"billing_api_login": "123",
"billing_api_secret_key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"crzd_key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"crzd_login": "123123",
"crzd_process_id": "321321",
"crzd_url": "https://www.corezoid.com/api/1/json"
}
Configure billing credentials with corezoid process
In corezoid process “Config” create new task with named reference. As a reference, use the mode of interaction with API. For example, mode = test or mode = prod etc.
Configure main corezoid process
In corezoid-process Mobipay edit node Initialization of task:
where
config_process_id
- process identifier "Config" (see item 1)
mode
- mode of interaction with API (see item 2)
crzd_callback_url
- webhook from any callback node from corezoid process "Mobipay"
callback_url
- url your frontend system for callback’s. For example, https://webhook.site/#/0a16316f-9d02-4a9c-b21a-58ec39b2214a/3632b1ff-91cd-4ac0-9faf-c6ccae11e8df/1
Click apply to save changes
Check credentials
To check credentials create a new task in process Mobipay with action = check_connectivity
Frontend system should receive JSON:
{
"response": {
"action": "check_connectivity",
"result": "check_connectivity_ok"
},
"task_id": "5c8589a760e3270e1b1d1cab"
}
Top-up End-To-End Flow
The following process describes a typical transaction flow based on the main methods provided by the API.
Protocol description
Check connectivity
Allows to check account credentials
request
{
"action": "check_connectivity"
}
response
{
"response": {
"action": "check_connectivity",
"result": "check_connectivity_ok"
},
"task_id": "5c8589a760e3270e1b1d1cab"
}
Getting details about receiver’s phone
Returns relevant information on a MSISDN (operator, country...) as well as the list of products configured for your account and the destination operator linked to that MSISDN. Allows to check if a MSISDN is subjected to a promotion.
request
{
"action": "get_msisdn_info",
"phone_receiver": "380731120011"
}
response
{
"response": {
"action": "get_msisdn_info",
"result": "get_msisdn_info_ok",
"msisdn_info": {
"destination_msisdn": "380630000001",
"country": "Ukraine",
"country_id": "804",
"operator": "Lifecell Ukraine",
"operator_id": "43",
"denominations": [
{
"amount": 5,
"amount_before_tax": 5,
"amount_after_tax": 5.5,
"amount_retail": 0.2,
"amount_fee": 0.5
},
{
"amount": 10,
"amount_before_tax": 10,
"amount_after_tax": 11,
"amount_retail": 0.4,
"amount_fee": 1
}
],
"destination_currency": "UAH",
"denominations_size": "2"
}
},
"task_id": "5c8442d260e3270e1b1927b6"
}
Hold top-up
request
{
"action": "topup_hold",
"hold_type": "credit",
"msisdn_info": {
"destination_msisdn": "380630000001",
"destination_currency": "UAH",
"country": "Ukraine",
"country_id": "804",
"operator": "Lifecell Ukraine",
"operator_id": "43",
"denomination": {
"amount": 5,
"amount_before_tax": 5,
"amount_after_tax": 5,
"amount_retail": 0.2,
"amount_fee": 0
}
}
}
response
{
"response": {
"action": "topup_hold",
"result": "topup_hold_ok",
"topup_id": "12"
},
"task_id": "5c84469960e3270e1b193087"
}
4.4 Finish top-up
Allows to conduct a Top-up. Returns transaction details : transaction id and status, error code, pin information, local amount received, etc.
request
{
"action": "topup_finish",
"topup_id": "12"
}
response success
{
"response": {
"action": "topup_finish",
"result": "topup_finish_ok",
"topup": {
"id": 12,
"tt_id": "752284690",
"document_id": 1,
"company_id": 1,
"phone_receiver": "380731120011",
"amount": 0.2,
"currency": "EUR",
"amount_local": 5,
"currency_local": "UAH",
"hold_type": "credit",
"description": "380630000001 (5 UAH)",
"status": "finished",
"error_type": null,
"error_code": null,
"error_description": null,
"company": {
"id": 1,
"title": "TestCompany",
"phone": "",
"email": "test@middleware.biz",
"info": "",
"status": "active",
"limits_status": "disabled"
},
"document": {
"id": 1,
"company_id": 1,
"balance_credit": 1895.35,
"balance_debit": 0,
"currency": "EUR",
"commission": 0.02,
"title": "test document/20.03.2019",
"api_login": "123",
"api_secret_key": "xxxxxxxxxxxxxxxxxxxxxxx",
"info": "",
"status": "active",
"mode": "test",
"ts_expired": "2099-12-31 00:00:00"
},
"ts_created": "2019-03-10 22:35:32",
"ts_changed": "2019-03-10 22:36:46"
}
},
"task_id": "5c85917c60e3270e1b1d2f68",
"topup_id": "12"
}
response error
{
"response": {
"action": "topup_finish",
"result": "topup_finish_error",
"error_type": "business",
"error_code": "wrong_topup_status"
},
"task_id": "5c858fb8f6c3762d331cb681",
"topup_id": "12"
}
Standart API Errors
Error type | Error code | Error description |
---|---|---|
business | incorrect_incoming_params | Incorrect incoming parameters |
business | document_not_active | Document is inactive. Please contact your Account Manager. |
business | company_not_active | Company is inactive. Please contact your Account Manager. |
business | document_not_found | Document isn't found. Please contact your Account Manager. |
business | destination_msisdn_out_of_range | Destination MSISDN out of range. Numbering plan not recognized: the destination/recipient number was not identified as to belonging to any operators covered by Mobipay. |
business | invalid_length_of_destination_msisdn | Invalid length of destination MSISDN. Operation failed because the recipient number length does not match (shorter or longer) the mobile number format of the country. |
business | wrong_company_id | Wrong company id |
business | wrong_document_id | Wrong document id |
business | wrong_phone_receiver | Wrong phone |