Quickstart
This walks through a first collection (pay-in) in Uganda. For the full path to production, see the Integration guide.
-
Set your credentials from the dashboard:
Terminal window export PH_API_USERNAME="your-username"export PH_API_PASSWORD="your-password"export PH_BASE_URL="https://api.payhero.africa" -
Discover what Uganda supports:
Terminal window curl "$PH_BASE_URL/api/global/discovery/discover-rails?country=UG" \-u "$PH_API_USERNAME:$PH_API_PASSWORD"If
available_providersis empty, your account has no providers enabled yet — ask PayHero to enable them before continuing. -
Choose a rail that is
trueinrails, a provider code fromavailable_providers, and a network fromprovider_networkswithramp_type: deposit. -
Create the collection, copying the network into
provider_config. Note thataccount_typetakes the network’schannel_type:Terminal window curl -X POST "$PH_BASE_URL/api/global/payments" \-u "$PH_API_USERNAME:$PH_API_PASSWORD" \-H "Content-Type: application/json" \-d '{"request_type": "payment","transaction_channel": "momo","provider": "yc","amount": 20000,"currency": "UGX","country": "UG","customer": {"first_name": "Jane","last_name": "Mukasa","email": "jane@example.com","phone": "+256769759910","country": "UG"},"vendor_config": { "vendor_id": 63 },"provider_config": {"network_id": "04a3083a-567c-4a2b-aa39-fa8f19e64341","network_name": "Airtel Mobile Money","network_code": "AIRTEL_UGANDA","channel_id": "e167def0-c4f0-46e2-aaa9-50046f13b0a7","account_type": "momo"},"payment_config": {"reference": "first_collection_001","account_number": "+256769759910","callback_url": "https://your-system.com/webhooks/payhero"}}' -
Read the response. A
200with amerchant_referencemeans the payment started:{"status_code": "200","merchant_reference": "9FD194041588.iI","transaction_type": "payin","success": true,"message": "request sent","checkout_request_id": "a8e1c979-3592-5abd-b1cd-dc1dbd34e708"} -
Wait for the callback. The payer approves the prompt on their phone, and the final result is POSTed to your
callback_url. See Callbacks & Webhooks.

