Transaction Object
Transaction
A transaction is…
Typically, when funds are transferred between entities, that’s kind of what a transaction is. Also, that’s kind of what Thepeer does.
The Transaction Object
The transaction object that Thepeer returns when transactions are made all adhere to one format.
Anatomy of the Transaction Object
Attribute | Description |
---|---|
type | The type of the transaction. The value is charge for a direct charge transaction and transaction for any other kind. |
transaction.id | The transaction’s identifier |
transaction.remark | The transaction’s description |
transaction.amount | The amount of money, in the smallest unit, involved in the transaction. |
transaction.charge | The amount of money, in the smallest unit, charged for the transaction. |
transaction.refund | A boolean that indicates whether or not the transaction is a refund. |
transaction.type | The transaction type. Indicates what kind of transaction the transaction is. |
transaction.currency | The currency used for the transaction |
transaction.status | The status of the transaction |
transaction.mode | The mode of the transaction. Can be either debit or credit . |
transaction.meta | An object that contains optional properties passed at the point of the transaction’s initiation. |
transaction.reference | The transaction's reference |
transaction.checkout | An object containing the checkout details of a checkout transaction. For other transactions, the value of this is null . |
transaction.peer | An object that contains details of the user and the business the transaction was carried out with. |
transaction.user | An object containing details of the user that carried out the transaction. |
transaction.channel | The SDK used to process the transaction. Can be either send , checkout , or direct_charge . |
transaction.created_at | The time the transaction was created |
transaction.updated_at | The time the transaction was updated |
Sample response
{
"type": "transaction",
"transaction": {
"id": "TRANSACTION_IDENTIFIER",
"remark": "test",
"amount": 20000,
"charge": 200,
"refund": false,
"type": "peer",
"currency": "NGN",
"status": "success",
"mode": "credit",
"meta": {
"city": "Ketu",
"state": "London"
},
"reference": "TRANSACTION_REFERENCE",
"checkout": null,
"peer": {
"business": {
"name": "Thepeer",
"logo": null,
"logo_colour": "#0067FF"
},
"user": {
"name": "Trojan Okoh",
"identifier": "trojin",
"identifier_type": "username"
}
},
"user": {
"name": "Trojan Okoh",
"identifier": "trojin",
"identifier_type": "username",
"email": "trojan@thepeer.co",
"reference": "the-nothing",
"created_at": "2023-02-20T17:55:01.000000Z",
"updated_at": "2023-02-20T17:55:01.000000Z"
},
"channel": "send",
"created_at": "2023-03-06T14:10:26.000000Z",
"updated_at": "2023-03-06T14:10:26.000000Z"
}
}