Skip to content

Transactions

A Transaction represents a payment that has actually been processed by an operator. It is created automatically by Sangho when a Payment Intent succeeds — you cannot create one directly through the API.

Transactions are the accounting system of record for your business. They contain the net amount collected, Sangho fees, and partner commissions, and are the source of the Receipts sent to customers.

Read-only transactions

Transactions cannot be created, modified (except for description and metadata), or deleted. To return the funds from a transaction, create a Refund. To dispute a transaction, contact Sangho support.

Possible statuses

StatusMeaningPossible action
approvedApproved by the operator, pending settlement.Wait — automatically moves to completed.
pendingQueued for operator processing.Wait for the transaction.succeeded webhook.
completedPayment successful — funds captured and available.Deliver the service/product. Refund possible.
failedPayment failed on the operator's side.Notify the customer, offer another method.
refundedFull refund issued.None — transaction closed.
disputedTransaction disputed by the customer or the operator.Contact support with evidence.
canceledTransaction canceled before processing.Create a new Payment Intent if needed.

Endpoints

MéthodeEndpointDescription
GET/transactions/List transactions (paginated, filterable)
GET/transactions/{id}/Retrieve a transaction by its ID
PATCH/transactions/{id}/Update description and metadata only
POST/transactions/{id}/cancel/Cancel a transaction in pending status

Object schema

ResponseTransaction object
Full structure. The fee and commission fields are calculated automatically by Sangho based on your pricing plan.
json
{
  "id": "trans_3Nx8mLKZ2eZvKYlo28m",
  "object": "transaction",
  "app": "app_xxxxxxxx",
  "amount": 15000,
  "fee": 350,
  "fee_rate": 0.023,
  "commission": 150,
  "commission_rate": 0.01,
  "net_amount": 14500,
  "currency": "XAF",
  "status": "completed",
  "type": "deposit",
  "description": "Order #CMD-2026-042",
  "payment_intent": "pi_xxxxxxxxxxxx",
  "customer": "cust_xxxxxxxx",
  "payment_method_type": "mobile_money",
  "operator": "airtel",
  "processed_at": "2026-03-01T10:05:00Z",
  "metadata": {
    "order_id": "CMD-2026-042"
  },
  "livemode": true,
  "created_at": "2026-03-01T10:00:00Z",
  "updated_at": "2026-03-01T10:05:00Z"
}

List transactions

Returns a paginated list of all transactions for your App. This is the primary endpoint for accounting reports, reconciliations, and exports.

GETQuery parameters
statusOptionnel
stringquery

Filter by status. Multiple values separated by a comma: status=completed,refunded.

typeOptionnel
stringquery

Filter by transaction type.

En savoir plus

Possible values: deposit (incoming payment), refund (refund), payout (outgoing transfer), withdraw (withdrawal), transfer (internal transfer).

payment_method_typeOptionnel
stringquery

Filter by payment method used: mobile_money, bank_card, paypal.

currencyOptionnel
stringISO 4217query

Filter by currency.

customerOptionnel
stringquery

Filter by Customer ID or email. Returns all transactions linked to this customer.

min_amountOptionnel
integercentsquery

Minimum amount (inclusive) in cents. Useful for filtering transactions above a threshold.

max_amountOptionnel
integercentsquery

Maximum amount (inclusive) in cents.

created_afterOptionnel
stringISO 8601queryex :2026-01-01T00:00:00Z

Start date of the time range (inclusive).

created_beforeOptionnel
stringISO 8601queryex :2026-03-31T23:59:59Z

End date of the time range (inclusive).

orderingOptionnel
stringquerydéfaut :-created_at

Sorting. Available fields: created_at, amount, net_amount, status.

pageOptionnel
integerquerydéfaut :1

Page number.

page_sizeOptionnel
integerquerydéfaut :20

Results per page. Maximum: 100.

En savoir plus

For accounting exports or reconciliations, combine page_size=100 with created_after and created_before to paginate over a precise period.

Monthly reconciliation

To export all transactions for a month, combine created_after=2026-03-01T00:00:00Z, created_before=2026-03-31T23:59:59Z, status=completed, type=deposit, and paginate with page_size=100 until you run out of pages.

List transactions

bash
# Completed transactions for Q1 2026
curl "https://api.sangho.ga/v1/transactions/?status=completed&type=deposit&created_after=2026-01-01T00:00:00Z&created_before=2026-03-31T23:59:59Z&page_size=100" \
  -H "Authorization: Bearer sk_prod_xxxx"
Response200 OK — Paginated list
The pagination.count field indicates the total number of transactions matching the filters, all usable for accounting totals.
json
{
  "object": "list",
  "data": [
    {
      "id": "trans_3Nx8mLKZ2eZvKYlo28m",
      "object": "transaction",
      "amount": 15000,
      "fee": 350,
      "net_amount": 14500,
      "currency": "XAF",
      "status": "completed",
      "type": "deposit",
      "payment_method_type": "mobile_money",
      "customer": "cust_xxxxxxxx",
      "created_at": "2026-03-01T10:05:00Z"
    }
  ],
  "pagination": {
    "count": 347,
    "total_pages": 4,
    "page": 1,
    "page_size": 100,
    "previous": null,
    "next": "https://api.sangho.ga/v1/transactions/?page=2&page_size=100&status=completed"
  }
}
ResponseRetrieve a transaction
GET /transactions/{id}/ returns the full object with all fee fields and the operator.
json
{
  "id": "trans_3Nx8mLKZ2eZvKYlo28m",
  "amount": 15000,
  "fee": 350,
  "fee_rate": 0.023,
  "commission": 150,
  "net_amount": 14500,
  "currency": "XAF",
  "status": "completed",
  "type": "deposit",
  "payment_intent": "pi_xxxxxxxxxxxx",
  "customer": "cust_xxxxxxxx",
  "payment_method_type": "mobile_money",
  "operator": "airtel",
  "processed_at": "2026-03-01T10:05:00Z"
}