Get a transaction
Retrieve a transaction using the reference you supplied when making the purchase. Request fields, response examples and integration guidance.
/transactions/{reference}
Example request
curl --request GET \ --url "https://api.strongmb.ng/v1/transactions/SMB202609160001" \ --header "Authorization: Bearer $STRONGMB_API_KEY" \ --header "Accept: application/json"
// Server-side Node.js 22+; never expose your key in a browser.
async function main() {
const response = await fetch("https://api.strongmb.ng/v1/transactions/SMB202609160001", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.STRONGMB_API_KEY}`,
Accept: "application/json"
},
signal: AbortSignal.timeout(30000)
});
const result = await response.json();
console.log(response.status, result);
// Read each transaction status before treating an order as complete.
}
main().catch(console.error);
<?php
// Requires the PHP cURL extension.
$client = curl_init('https://api.strongmb.ng/v1/transactions/SMB202609160001');
curl_setopt_array($client, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('STRONGMB_API_KEY'),
'Accept: application/json',
],
]);
$raw = curl_exec($client);
if ($raw === false) {
throw new RuntimeException(curl_error($client));
}
$status = curl_getinfo($client, CURLINFO_HTTP_CODE);
curl_close($client);
$result = json_decode($raw, true, 512, JSON_THROW_ON_ERROR);
print_r(['http_status' => $status, 'response' => $result]);
// Read each transaction status before treating an order as complete.
require 'net/http'
require 'json'
uri = URI('https://api.strongmb.ng/v1/transactions/SMB202609160001')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == 'https'
http.open_timeout = 10
http.read_timeout = 30
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'Bearer ' + ENV.fetch('STRONGMB_API_KEY')
request['Accept'] = 'application/json'
begin
response = http.request(request)
result = JSON.parse(response.body)
puts({ http_status: response.code, response: result }.to_json)
rescue StandardError => error
warn error.message
end
# Reconcile an uncertain purchase before retrying.
import json
import os
from urllib.request import Request, urlopen
from urllib.error import HTTPError, URLError
headers = {
"Authorization": "Bearer " + os.environ["STRONGMB_API_KEY"],
"Accept": "application/json",
}
body = None
request = Request(
"https://api.strongmb.ng/v1/transactions/SMB202609160001",
data=body, headers=headers, method="GET"
)
try:
with urlopen(request, timeout=30) as response:
result = json.load(response)
print(response.status, result)
except HTTPError as error:
print(error.code, error.read().decode("utf-8"))
except URLError as error:
print("Network error:", error.reason)
# Reconcile an uncertain purchase before retrying.
Returns a single transaction belonging to your account that matches your purchase reference.
Path Parameter
| Parameter | Type | Required | Description |
|---|---|---|---|
| reference | string | Required | The exact reference you supplied when creating the purchase, for example
SMB202609160001.
|
{
"status": true,
"message": "Transaction details retrieved successfully",
"data": {
"transaction": {
"uuid": "06f2dd34-2f8c-4888-9529-6fd5dfabc7fa",
"wallet_type": "primary_ngn",
"direction": "debit",
"category": "product",
"type": "data",
"amount": "1500.00",
"balance_before": "886959.56",
"balance_after": "885459.56",
"description": "-",
"reference": "1SMsaadkj3hd5fdaaaa1fahaa",
"status": "successful",
"date": "2026-09-21 00:51:37.909298+01",
"details": {
"plan": "5gb",
"provider": "airtel",
"recipient": "0123456789",
"data_type": "gifting",
"validity": "2days",
"title": "5gb airtel gifting data",
"performed_via": "api"
}
}
},
"metadata": {
"code": "TRANSACTION_DETAILS_RETRIEVED",
"timestamp": 1789948330,
"trace_id": "C7D4777240"
}
}
{
"status": false,
"message": "Transaction not found.",
"data": null,
"metadata": {
"code": "ERR_TRANSACTIONS_NOT_FOUND",
"timestamp": 1773797291,
"trace_id": "FF009820DE"
}
}
Understand the request fields
| Field | Integration guidance |
|---|---|
reference
|
Supply the same reference you saved and sent with the purchase request. |
Response fields and types
Expand an object to explore its fields. [] indicates an array item. Error responses may return
data: null.
| Field path | JSON type | Meaning and handling |
|---|---|---|
status |
boolean | Request-level success flag. Check the HTTP status and metadata code as well; a successful API request is not by itself proof of purchase fulfillment. |
message |
string | Human-readable description of the result. Use metadata.code for programmatic error handling instead of parsing this text. |
data |
null | object | Endpoint payload on a completed request. Error responses may return null or validation information. |
data.transaction |
object | Single transaction matched by the supplied purchase reference. |
data.transaction.uuid |
string | Internal transaction UUID returned for identification. Use the original purchase reference in the documented lookup route. |
data.transaction.wallet_type |
string | Wallet on which this transaction occurred, such as primary_ngn. |
data.transaction.direction |
string | Wallet movement direction, such as debit or credit. |
data.transaction.type |
string | Service or transaction type, for example data, airtime, electricity or cable TV. |
data.transaction.amount |
string | Transaction amount formatted as a decimal string with two decimal places. Preserve precision when comparing it with your saved order. |
data.transaction.balance_before |
number | Wallet balance before this transactionI. |
data.transaction.balance_after |
number | Wallet balance after this transaction. |
data.transaction.status |
string | Record status: successful, processing, failed or refund. A failed purchase is refunded immediately; refund identifies its refund credit and confirms the purchase failed and was refunded. Check direction and UUID to distinguish entries. |
data.transaction.date |
string | Transaction date/time string returned for display. |
data.transaction.reference |
string | Reference supplied when creating the purchase. |
data.transaction.details |
object | Transaction details for the purchased service. Fields vary by service. |
data.transaction.details.provider |
string | Provider identifier associated with the purchased service. |
data.transaction.details.recipient |
string | Phone number, meter or customer identifier for the purchase. Compare it with the intended recipient. |
data.transaction.details.airtime_amount |
number | Face value of the requested airtime. It can differ from the amount debited when a discount applies. |
data.transaction.details.performed_via |
string | Channel through which the transaction was performed, such as the API. |
metadata |
object | Diagnostic information about the response. |
metadata.code |
string | Machine-readable result code. Use it to distinguish validation, authentication and service errors. |
metadata.timestamp |
integer | Unix timestamp in seconds associated with the response. |
metadata.trace_id |
string | Correlation identifier for troubleshooting. Retain it with a redacted request when contacting support. |
data.transaction.category |
string | Transaction category as reported by the transaction record. |
data.transaction.description |
string | Human-readable transaction description. |
Electricity: prepaid and postpaid lookup
Always query GET /transactions/{reference} to retrieve prepaid token details; they are not
returned in the initial purchase response. The sample customer number and token below are fictional
placeholders.
Prepaid transaction
{
"status": true,
"message": "Transaction details retrieved successfully",
"data": {
"transaction": {
"uuid": "a2400382-dbdd-4e7a-a31c-932275aa4d7a",
"wallet_type": "primary_ngn",
"direction": "debit",
"category": "product",
"type": "electricity",
"amount": "1100.00",
"balance_before": "508224.56",
"balance_after": "507124.56",
"description": "-",
"reference": "SMBD0113s53pafssdsddskjsd9",
"status": "successful",
"date": "2026-09-25 02:05:17.048527+01",
"details": {
"provider": "kedco",
"recipient": "0123456789",
"fee": "100.00",
"currency": "NGN",
"amount_paid": "1100.00",
"amount_subscribe": "1000.00",
"recipient_name": "Strongmb User",
"title": "kedco Subscription",
"performed_via": "api",
"meter_type": "prepaid",
"units": "55.9",
"token": "00000000000000000000",
"meter_number": "0123456789"
}
}
},
"metadata": {
"code": "TRANSACTION_DETAILS_RETRIEVED",
"timestamp": 1790298369,
"trace_id": "2A00A65871"
}
}
Postpaid transaction
Postpaid payments do not require a recharge token, so token and units are null.
{
"status": true,
"message": "Transaction details retrieved successfully",
"data": {
"transaction": {
"uuid": "a2400382-dbdd-4e7a-a31c-932275aa4d7a",
"wallet_type": "primary_ngn",
"direction": "debit",
"category": "product",
"type": "electricity",
"amount": "1100.00",
"balance_before": "508224.56",
"balance_after": "507124.56",
"description": "-",
"reference": "SMBD0113s53pafssdsddskjsd9",
"status": "successful",
"date": "2026-09-25 02:05:17.048527+01",
"details": {
"provider": "kedco",
"recipient": "0123456789",
"fee": "100.00",
"currency": "NGN",
"amount_paid": "1100.00",
"amount_subscribe": "1000.00",
"recipient_name": "Strongmb User",
"title": "kedco Subscription",
"performed_via": "api",
"meter_type": "postpaid",
"units": null,
"token": null,
"meter_number": "0123456789"
}
}
},
"metadata": {
"code": "TRANSACTION_DETAILS_RETRIEVED",
"timestamp": 1790298369,
"trace_id": "2A00A65871"
}
}
Service-specific transaction details
The fields inside data.transaction.details depend on the transaction type. In transaction
history, the equivalent path is data.transactions[].details. Provider-dependent values may be
unavailable or represented by a placeholder.
Common service fields
| Field inside details | Type | Description |
|---|---|---|
provider |
string | Service provider identifier. |
recipient |
string | Phone number, meter or smart-card identifier for the order. |
title |
string | Display title for the receipt. |
performed_via |
string | Channel used for the transaction, for example API. |
Data
| Field inside details | Type | Description |
|---|---|---|
plan |
string | Purchased data plan label. |
data_type |
string | Data type purchased. |
validity |
string | Data-plan validity label. |
Airtime
| Field inside details | Type | Description |
|---|---|---|
airtime_type |
string | Airtime type. |
airtime_amount |
integer | Airtime face value; may differ from the debited amount. |
Cable TV
| Field inside details | Type | Description |
|---|---|---|
fee |
string | Additional fee as a decimal string. |
currency |
string | Currency code. |
amount_paid |
string | Paid amount as a decimal string. |
package_amount |
string | Package amount as a decimal string. |
recipient_name |
string | Customer name when available; a placeholder may be returned. |
package_name |
string | Purchased cable package label. |
Electricity
| Field inside details | Type | Description |
|---|---|---|
fee |
string | Additional fee as a decimal string. |
currency |
string | Currency code. |
amount_paid |
string | Paid amount as a decimal string. |
amount_subscribe |
string | Electricity subscription amount as a decimal string. |
recipient_name |
string | Customer name when available. |
meter_type |
string | Prepaid or postpaid meter category. |
meter_number |
string | Meter number returned in purchase details. |
units |
string | null | Electricity units returned by transaction lookup for prepaid. |
token |
string | null | Prepaid recharge token retrieved through transaction lookup; null for postpaid. The initial purchase response does not include this token. |
Transaction error codes
ERR_REFERENCE_ALREADY_EXISTS- A transaction already has this exact reference. Verify that transaction before deciding whether to create a new purchase with another reference.
ERR_INVALID_PRODUCT_CODE_OR_INACTIVE- The product code submitted for purchase is invalid or inactive. Retrieve the current products and choose an active product before retrying.
ERR_TRANSACTIONS_NOT_FOUND- The reference does not exist in the authenticated user account. Check the original reference, account and environment.
Customer names, phone numbers, meter and smart-card numbers in these examples are fictional placeholders. Replace them with valid customer details for real requests.
Always check metadata.code; do not rely on HTTP status alone. See response codes and recommended
handling.
Questions? Let’s work through them.
Having an issue or need help with your integration? Join the Strongmb Slack community to ask questions and get assistance from our team and other developers.
Keep API keys and customer details private when sharing examples.
Experiencing a service issue? Check Strongmb’s service status for incident updates.
Did this page help you?
Up to 100 characters. Please leave out personal details, account information and API keys.