Wire Gh Documentation
Welcome to the Wire Gh developer documentation. Everything you need to accept payments in your website or app, from your first test payment to going live.
Quick start
Accept PaymentsTake Mobile Money and Wire Gh wallet payments with the popup or the hosted checkout page.
Charge APICollect payments inside your own app or website, with your own screens.
WebhooksGet told on your server the moment a payment succeeds or a refund completes.
Test PaymentsUse test numbers to try every outcome before you take real money.
Accept a payment
Here is the quickest way to take a payment with the Wire Gh Pay API. It takes three steps.
Before you begin
Create a free Wire Gh account and open Wire Pay from your dashboard. Your test keys are ready at once on the API & Sandbox page.
- Initialize the transaction on your serverSend the customer's email and the amount in pesewas with your secret key. You get back a checkout link.
curl https://api.wiregh.com/transaction/initialize \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "customer@email.com",
"amount": 20000
}' \
-X POSTconst response = await fetch('https://api.wiregh.com/transaction/initialize', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_SECRET_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: 'customer@email.com',
amount: 20000
})
});
const result = await response.json();
console.log(result);<?php
$ch = curl_init('https://api.wiregh.com/transaction/initialize');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode([
'email' => 'customer@email.com',
'amount' => 20000,
]),
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_SECRET_KEY',
'Content-Type: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($result);{
"status": true,
"message": "Authorization URL created",
"data": {
"authorization_url": "https://checkout.wiregh.com/5297adjn3udup2s",
"access_code": "5297adjn3udup2s",
"reference": "WG261109RF9825WN4C3L9K"
}
}- Send your customer to the checkoutRedirect them to
authorization_url. They pick their network, enter their Mobile Money number and approve the prompt on their phone. When they finish, we send them back to your callback URL with the reference. - Verify the payment, then give valueOn your server, verify the reference and check that
statusissuccessandamountis what you expected.
curl https://api.wiregh.com/transaction/verify/WG261109RF9825WN4C3L9K \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-X GETconst response = await fetch('https://api.wiregh.com/transaction/verify/WG261109RF9825WN4C3L9K', {
method: 'GET',
headers: {
Authorization: 'Bearer YOUR_SECRET_KEY'
}
});
const result = await response.json();
console.log(result);<?php
$ch = curl_init('https://api.wiregh.com/transaction/verify/WG261109RF9825WN4C3L9K');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_SECRET_KEY',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($result);Prefer to keep customers on your page? Use the popup. Want your own payment screens? Use the Charge API.