Get Payment Status
curl --request GET \
--url https://pesahub.co/api/v1/payments/{transaction_id} \
--header 'Authorization: <authorization>'import requests
url = "https://pesahub.co/api/v1/payments/{transaction_id}"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://pesahub.co/api/v1/payments/{transaction_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://pesahub.co/api/v1/payments/{transaction_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://pesahub.co/api/v1/payments/{transaction_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://pesahub.co/api/v1/payments/{transaction_id}")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pesahub.co/api/v1/payments/{transaction_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"status": "<string>",
"payment.transaction_id": "<string>",
"payment.transaction_mode": "<string>",
"payment.transaction_currency": "<string>",
"payment.channel": {},
"payment.customer": {},
"payment.metadata": {},
"payment.amount.value": "<string>",
"payment.event": "<string>",
"payment.created_at": "<string>",
"payment.updated_at": "<string>",
"payment.timestamp": "<string>"
}USSD Collection
Get Payment Status
Retrieves the current status and details of a payment using its transaction ID.
GET
/
api
/
v1
/
payments
/
{transaction_id}
Get Payment Status
curl --request GET \
--url https://pesahub.co/api/v1/payments/{transaction_id} \
--header 'Authorization: <authorization>'import requests
url = "https://pesahub.co/api/v1/payments/{transaction_id}"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://pesahub.co/api/v1/payments/{transaction_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://pesahub.co/api/v1/payments/{transaction_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://pesahub.co/api/v1/payments/{transaction_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://pesahub.co/api/v1/payments/{transaction_id}")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pesahub.co/api/v1/payments/{transaction_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"status": "<string>",
"payment.transaction_id": "<string>",
"payment.transaction_mode": "<string>",
"payment.transaction_currency": "<string>",
"payment.channel": {},
"payment.customer": {},
"payment.metadata": {},
"payment.amount.value": "<string>",
"payment.event": "<string>",
"payment.created_at": "<string>",
"payment.updated_at": "<string>",
"payment.timestamp": "<string>"
}Request Headers
string
required
Bearer token for authentication. Format:
Bearer <token>string
default:"application/json"
Expected response format. Use
application/json.Path Parameters
string
required
Unique identifier of the payment transaction.
Example Request
curl -X GET https://pesahub.co/api/v1/payments/f19605f6-f67e-4230-8152-30b35740a024 \
-H "Authorization: Bearer {{api_key}}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"
const response = await fetch(
'https://pesahub.co/api/v1/payments/f19605f6-f67e-4230-8152-30b35740a024',
{
method: 'GET',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json',
},
}
);
const data = await response.json();
import requests
response = requests.get(
'https://pesahub.co/api/v1/payments/f19605f6-f67e-4230-8152-30b35740a024',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'application/json',
'Content-Type': 'application/json',
},
)
data = response.json()
Response
boolean
Indicates whether the request was successful.
string
Human-readable response message.
string
Current payment status (
pending, completed, failed, or cancelled).string
Unique identifier of the payment transaction.
string
Payment transaction mode (for example,
ussd).string
Currency used for the transaction.
object
Payment channel information.
object
Customer information associated with the payment.
object
Additional metadata attached to the transaction.
string
Payment amount.
string
Latest payment event (for example,
payment.pending).string
ISO 8601 timestamp when the payment was created.
string
ISO 8601 timestamp when the payment was last updated.
string
Timestamp of the latest payment status update.
Example Response
{
"success": true,
"message": "Payment status retrieved successfully",
"status": "pending",
"payment": {
"transaction_id": "f19605f6-f67e-4230-8152-30b35740a024",
"transaction_mode": "ussd",
"transaction_currency": "TZS",
"channel": {
"name": "AIRTEL-MONEY",
"reference": null
},
"customer": {
"full_name": null,
"phone_number": null
},
"metadata": {
"order_id": "12345",
"customer_note": "Test payment"
},
"amount": {
"value": "500.00"
},
"created_at": "2026-05-01T18:08:15.000000Z",
"updated_at": "2026-05-01T09:57:23.000000Z",
"timestamp": "2026-07-12T19:12:33.795106Z",
"event": "payment.pending"
}
}
Poll this endpoint using the transaction ID to monitor payment progress until the transaction reaches a final state.