Skip to main content

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

AttributeDescription
typeThe type of the transaction. The value is charge for a direct charge transaction and transaction for any other kind.
transaction.idThe transaction’s identifier
transaction.remarkThe transaction’s description
transaction.amountThe amount of money, in the smallest unit, involved in the transaction.
transaction.chargeThe amount of money, in the smallest unit, charged for the transaction.
transaction.refundA boolean that indicates whether or not the transaction is a refund.
transaction.typeThe transaction type. Indicates what kind of transaction the transaction is.
transaction.currencyThe currency used for the transaction
transaction.statusThe status of the transaction
transaction.modeThe mode of the transaction. Can be either debit or credit.
transaction.metaAn object that contains optional properties passed at the point of the transaction’s initiation.
transaction.referenceThe transaction's reference
transaction.checkoutAn object containing the checkout details of a checkout transaction. For other transactions, the value of this is null.
transaction.peerAn object that contains details of the user and the business the transaction was carried out with.
transaction.userAn object containing details of the user that carried out the transaction.
transaction.channelThe SDK used to process the transaction. Can be either send, checkout, or direct_charge.
transaction.created_atThe time the transaction was created
transaction.updated_atThe 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"
}
}