Skip to main content
POST
/
api
/
v1
/
payments
/
{transaction_id}
Get Payment Status
curl --request POST \
  --url https://pesahub.test/api/v1/payments/{transaction_id}
import requests

url = "https://pesahub.test/api/v1/payments/{transaction_id}"

response = requests.post(url)

print(response.text)
const options = {method: 'POST'};

fetch('https://pesahub.test/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.test/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 => "POST",
]);

$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.test/api/v1/payments/{transaction_id}"

req, _ := http.NewRequest("POST", url, nil)

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://pesahub.test/api/v1/payments/{transaction_id}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://pesahub.test/api/v1/payments/{transaction_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

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>"
}

Endpoint

GET /v1/payments/{transaction_id}

Authentication

Requires a Bearer token in the Authorization header.
Authorization: Bearer {{api_key}}

Request Headers

HeaderValue
Acceptapplication/json
Content-Typeapplication/json

Path Parameters

transaction_id
string
required
Unique identifier of the payment transaction.

Example Request

curl -X GET https://pesahub.test/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.test/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.test/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

success
boolean
Indicates whether the request was successful.
message
string
Human-readable response message.
status
string
Current payment status (pending, completed, failed, or cancelled).
payment.transaction_id
string
Unique identifier of the payment transaction.
payment.transaction_mode
string
Payment transaction mode (for example, ussd).
payment.transaction_currency
string
Currency used for the transaction.
payment.channel
object
Payment channel information.
payment.customer
object
Customer information associated with the payment.
payment.metadata
object
Additional metadata attached to the transaction.
payment.amount.value
string
Payment amount.
payment.event
string
Latest payment event (for example, payment.pending).
payment.created_at
string
ISO 8601 timestamp when the payment was created.
payment.updated_at
string
ISO 8601 timestamp when the payment was last updated.
payment.timestamp
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.