Events
Events, as the name implies, are states that a transaction must pass through in order to complete the payment flow. A completed transaction has two events that are distinguished by their states: transaction:created
and transaction:processed
.
transaction:created
This event state determines a transaction that is still in process and is awaiting a response from the customer to confirm or cancel the transaction. A transaction typically has a status
of pending
during this state.
transaction:processed
When a customer confirms or cancels a transaction, a new event with the state 'transaction:processed' is created. During this state, a transaction's status
is typically success
or failed
.
List of events
List events with multiple optional
filters passed in as query parameters.
Path:
${BASE_URL}/events/transactions
Headers
Field | Type | Description |
---|---|---|
Content-Type | string | application/json |
Accept | string | application/json |
Authorization | string | Bearer JWT token obtained from authentication. |
Query Parameters
Field | Type | Description |
---|---|---|
status | string | The status of the transaction. |
client | string | The phone number of the customer. |
ref | string | The reference number of the transaction. |
kind | string | The kind of transaction (CASHIN or CASHOUT). |
Example
cURL
curl --location --request GET 'https://payments.paypack.rw/api/events/transactions?ref=d0bb2807-1d52-4795-b373-3feaf63dceb1&kind=CASHIN&client=078xxxxxx&status=pending' \--header 'Accept: application/json' \--header 'Authorization: Bearer {token}'
Response
{ "amount": 1000, "client": "078xxxxxxx", "event-kind": "transaction:created", "kind": "CASHIN", "limit": 20, "offset": 0, "ref": "d0bb2807-1d52-4795-b373-3feaf63dceb1", "status": "failed", "total": 250, "transactions": [ { "event_id": "bf76c3a8-cafe-11ec-9478-dead2ba023b5", "event_kind": "transaction:processed", "created_at": "2022-05-03T16:33:22.434606Z", "data": { "ref": "ajsfh44w3j-4h4r-28438-efnef-e9f44a5b4c2d", "kind": "CASHIN", "fee": 2.3, "merchant": "XXXXX", "client": "078xxxxxxx", "amount": 100, "status": "successful", "created_at": "2022-05-03T16:27:01.292808134Z", "processed_at": "2022-05-03T16:33:22.434351492Z" } } ]}
Table of Contents