Bridge API DocsBridge API Docs
Bridge API Docs
Api reference

Get Transaction Status

Verify the status of a specific transaction

Get Transaction Status

Check the current status of a transaction using its transaction ID. This endpoint helps you track payment processing and determine if a transaction was successful, failed, or is still pending.

Endpoint

POST https://api.bridgeagw.com/get_transaction_status

Request Headers

Authorization: Basic <base64_encoded_credentials>
Content-Type: application/json

Request Body

{
  "service_id": 1,
  "transaction_id": "70"
}

Parameters

ParameterTypeRequiredDescription
service_idintegerYesYour service identifier
transaction_idstringYesThe transaction ID to check

Response

Success Response (200)

{
  "response_data": {
    "network_transaction_id": "57537797464",
    "status_desc": "Transaction Successful",
    "transaction_id": "37",
    "status": "000",
    "message": "SUCCESSFUL"
  },
  "response_message": "Success",
  "response_code": "000"
}

Response Fields

FieldTypeDescription
network_transaction_idstringThe network's transaction ID
status_descstringHuman-readable status description
transaction_idstringYour original transaction ID
statusstringStatus code (000 = Success, 001 = Failed)
messagestringStatus message

Failed Transaction Response

{
  "response_data": {
    "network_transaction_id": "61962982397",
    "status_desc": "Transaction Failed",
    "transaction_id": "73",
    "status": "001",
    "message": "FAILED"
  },
  "response_message": "Success",
  "response_code": "000"
}

Status Codes

Status CodeDescription
000Transaction Successful
001Transaction Failed
002Transaction Pending
003Transaction Cancelled

Example Usage

cURL

curl -X POST "https://api.bridgeagw.com/get_transaction_status" \
  -H "Authorization: Basic <your_credentials>" \
  -H "Content-Type: application/json" \
  -d '{
    "service_id": 1,
    "transaction_id": "70"
  }'

JavaScript

const response = await fetch('https://api.bridgeagw.com/get_transaction_status', {
  method: 'POST',
  headers: {
    'Authorization': 'Basic <your_credentials>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    service_id: 1,
    transaction_id: "70"
  })
});

const result = await response.json();
console.log(result);

Python

import requests

url = "https://api.bridgeagw.com/get_transaction_status"
headers = {
    "Authorization": "Basic <your_credentials>",
    "Content-Type": "application/json"
}
data = {
    "service_id": 1,
    "transaction_id": "70"
}

response = requests.post(url, headers=headers, json=data)
result = response.json()
print(result)

Use Cases

Payment Verification

After initiating a payment, use this endpoint to verify if the transaction was successful:

// Check payment status after 30 seconds
setTimeout(async () => {
  const status = await checkTransactionStatus(transactionId);
  if (status.status === '000') {
    console.log('Payment successful!');
  } else {
    console.log('Payment failed:', status.status_desc);
  }
}, 30000);

Transaction History

Query multiple transactions to build a transaction history:

const transactionIds = ['70', '71', '72', '73'];
const statuses = await Promise.all(
  transactionIds.map(id => checkTransactionStatus(id))
);

Webhook Verification

Verify transaction statuses received via webhooks:

app.post('/webhook', async (req, res) => {
  const { transaction_id } = req.body;
  
  // Verify the status with the API
  const status = await checkTransactionStatus(transaction_id);
  
  if (status.status === '000') {
    // Process successful payment
    await processSuccessfulPayment(transaction_id);
  }
  
  res.status(200).send('OK');
});

Error Handling

If the transaction ID doesn't exist or there's an error, you'll receive an appropriate error response:

{
  "response_message": "Transaction not found",
  "response_code": "404"
}

Notes

  • Transaction statuses are updated in real-time
  • You can check the status of any transaction you've initiated
  • The network_transaction_id can be used for reference with the mobile money provider
  • Status checks don't affect the transaction in any way
  • Failed transactions may have additional error details in the status_desc field