ChapaChapa Docs

Transaction Logs

View detailed history of state changes and lifecycle events for payments and payouts.

Transaction Logs provide a detailed history of state changes and lifecycle events for a specific payment or payout.

They are especially useful for:

  • Debugging payment issues
  • Auditing transaction behavior
  • Understanding why a transaction failed, was cancelled, or blocked
  • Customer support and dispute resolution

While All Payments shows the current snapshot, Transaction Logs show how the transaction got there.

What Are Transaction Logs?

A transaction log records each significant event that occurs during a transaction's lifecycle, such as:

  • Initialization
  • Authentication required
  • Payment success or failure
  • Cancellation
  • Refunds (partial or full)
  • Blocking due to compliance or risk rules

Logs are typically derived from:

  • Internal lifecycle events
  • Webhook events
  • Status transitions (e.g. pending → auth_needed → success → refunded)

Common Log Events

Transaction logs usually reflect the same lifecycle states defined in Chapa's standardized status codes:

StatusMeaning
pendingTransaction initiated
successCompleted successfully
failedFailed or rejected
cancelledCancelled by user or system
incompleteTimed out or abandoned
partially_refundedPartially refunded
fully_refundedFully refunded
auth_neededAdditional authentication required
blockedBlocked due to risk or compliance

Typical Log Fields

A transaction log entry usually includes:

FieldDescription
referenceChapa or merchant reference
previous_statusStatus before the event
current_statusStatus after the event
eventTriggering event name
reasonFailure / block / cancellation reason (if any)
sourceOrigin of event (API, webhook, system)
created_atTimestamp of the event

Example Transaction Logs

Authentication Required:

{
  "reference": "CHAPA123456789",
  "previous_status": "pending",
  "current_status": "auth_needed",
  "event": "payment.auth_needed",
  "reason": "PIN_REQUIRED",
  "source": "system",
  "created_at": "2025-11-07T12:01:00Z"
}

Payment Success:

{
  "reference": "CHAPA123456789",
  "previous_status": "auth_needed",
  "current_status": "success",
  "event": "payment.success",
  "source": "webhook",
  "created_at": "2025-11-07T12:03:10Z"
}

How Merchants Should Use Logs

Debugging Failed Payments

  1. Check the last log entry
  2. Look for reason fields (e.g. INSUFFICIENT_FUNDS, COMPLIANCE_REVIEW)
  3. Identify whether failure was user-driven, system-driven, or compliance-related

Customer Support Investigations

Logs help answer questions like:

  • Did the customer attempt payment?
  • Did authentication fail?
  • Was the transaction cancelled or blocked?
  • Did the customer retry multiple times?

Auditing & Compliance

  • Maintain a full timeline of transaction activity
  • Useful for dispute handling and internal reviews
  • Helps demonstrate traceability and decision history

Relationship with Webhooks

Each webhook event can be thought of as creating or updating a transaction log entry.

Webhook EventLog Entry
payment.failedLog entry with current_status = failed
payment.partially_refundedLog entry with refund details
payout.blockedLog entry with compliance reason

Best practice: Store webhook payloads or normalize them into log records for traceability.

Best Practices

  • Store logs in an append-only format
  • Never overwrite historical log entries
  • Link logs to both chapa_reference and merchant_reference
  • Include reason and source whenever available
  • Treat logs as read-only audit data

Next Steps

On this page