Skip to main content

Overview

Fetch detailed information about a specific transaction using either its id (UUID) or reference.
Required permission: payment:read

Endpoint

GET /api/payments/get-transaction

Request

Headers

X-API-Key
string
required
Your Chidori API key

Query parameters

Provide either id OR reference:
id
string
The transaction ID (UUID)
reference
string
The transaction reference string

Response

Success response

status
boolean
Always true for successful requests
data
object
Complete transaction object with all details

Examples

curl "https://api.chidori.africa/api/payments/get-transaction?id=txn-123-456-789" \
  -H "X-API-Key: sk_live_xxx.yyy"
{
  "status": true,
  "data": {
    "id": "txn-123-456-789",
    "type": "DEBIT",
    "amount": 2500,
    "reference": "order_12345_payment",
    "description": "Delivery payment - CHI-ABC123",
    "balanceBefore": 50000,
    "balanceAfter": 47500,
    "deliveryId": "abc123-def456-ghi789",
    "createdAt": "2025-01-15T10:30:00.000Z"
  }
}

Use cases

After processing a payment, verify it was successful:
async function verifyPayment(reference) {
  const response = await fetch(
    `https://api.chidori.africa/api/payments/get-transaction?reference=${reference}`,
    { headers: { 'X-API-Key': apiKey } }
  );
  
  const { status, data } = await response.json();
  
  if (status && data) {
    return {
      verified: true,
      amount: data.amount,
      timestamp: data.createdAt
    };
  }
  
  return { verified: false };
}
Match transactions with your internal records:
async function reconcileOrder(orderId) {
  const reference = `order_${orderId}_payment`;
  
  const response = await fetch(
    `https://api.chidori.africa/api/payments/get-transaction?reference=${reference}`,
    { headers: { 'X-API-Key': apiKey } }
  );
  
  const { data } = await response.json();
  
  if (data) {
    await updateOrderRecord(orderId, {
      paymentVerified: true,
      transactionId: data.id,
      paidAmount: data.amount,
      paidAt: data.createdAt
    });
  }
}

Next steps