Discover rails, providers and networks
GET
/api/global/discovery/discover-rails
curl -X GET "https://api.payhero.africa/api/global/discovery/discover-rails?country=UG" \ -u "API_USERNAME:API_PASSWORD"<?php$ch = curl_init("https://api.payhero.africa/api/global/discovery/discover-rails?country=UG");curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_USERPWD => "API_USERNAME:API_PASSWORD",]);$response = curl_exec($ch);curl_close($ch);echo $response;import requests
response = requests.get( "https://api.payhero.africa/api/global/discovery/discover-rails", auth=("API_USERNAME", "API_PASSWORD"), params={"country": "UG"},)print(response.json())const auth = Buffer.from("API_USERNAME:API_PASSWORD").toString("base64");
const response = await fetch("https://api.payhero.africa/api/global/discovery/discover-rails?country=UG", { headers: { Authorization: `Basic ${auth}` },});
console.log(await response.json());Returns what a payer in one country can pay with: the rails available, the providers on each rail as provider codes, every network those providers publish, and the fields each provider requires on a payment.
The answer covers only the providers assigned to your account. An account with none assigned discovers nothing.
Each network appears once per ramp_type: use deposit networks for
collections and withdraw networks for payouts. Send a network’s
channel_type as provider_config.account_type.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”country
required
string
Example
UGISO 3166-1 alpha-2 country code.
Responses
Section titled “Responses”Rails, providers and networks for the country.
Media typeapplication/json
object
rails
object
bank
boolean
card
boolean
momo
boolean
merchant_id
string
has_networks
boolean
country
string
currency
string
available_providers
object
bank
Array<string>
card
Array<string>
momo
Array<string>
provider_networks
object
key
additional properties
any
Example
{ "country": "UG", "currency": "UGX", "rails": { "bank": false, "card": true, "crypto": false, "momo": true }, "available_providers": { "card": [ "vabupay" ], "momo": [ "yc" ] }, "provider_networks": { "yc": [ { "network_id": "04a3083a-567c-4a2b-aa39-fa8f19e64341", "network_name": "Airtel Mobile Money", "network_code": "AIRTEL_UGANDA", "channel_id": "e167def0-c4f0-46e2-aaa9-50046f13b0a7", "channel_type": "momo", "account_type": "phone", "ramp_type": "deposit", "min_amount": 15000, "max_amount": 3000000, "provider": "yc", "status": "active" } ] }, "required_fields": { "yc": { "provider_config": { "channel_id": true, "network_code": true, "network_id": true, "network_name": true } } }, "provider_operations": { "yc": { "b2c": true, "c2b": true } }}Missing or invalid Basic auth credentials.
Media typeapplication/json
object
error_code
string
error_message
string
status_code
integer
Example
{ "error_code": "invalid_argument", "error_message": "the transaction amount is insufficient as it wont cater for cost: (4.62)", "status_code": 400}
