Transaction object 💎
The transaction object contains all the information about a transaction. It will be returned after a successful charge authorization (and also received via webhook).
Anatomy of a transaction object
A transaction object usually looks like this:
{ "type": "transaction", "transaction": { "id": "transaction-identifier", "remark": "medicine", "amount": 50000, "currency": "NGN", "charge": 0, "type": "peer", "refund": false, "channel": "send", "status": "success", "user": { "name": "Tim Cook", "identifier": "tim", "identifier_type": "username", "email": "tim@apple.com", "reference": "one-more-thing", "created_at": "2020-05-06T12:00:00.000Z", "updated_at": "2020-05-06T12:00:00.000Z" }, "checkout": null, "mode": "credit", "reference": "transaction-reference", "peer": { "user": { "name": "John Ternus", "identifier": "john", "identifier_type": "username" }, "business": { "name": "Apple", "logo": null, "logo_colour": "#ffffff" } }, "meta": { "city": "Cupertino", "state": "California" }, "created_at": "2021-04-12T19:52:22.000000Z", "updated_at": "2021-04-12T19:52:22.000000Z" }}
Attribute | Description |
---|---|
transaction.id | The transaction's identifier |
transaction.amount | The receipt value in the smallest unit of a given currency |
transaction.currency | The currency of the given amount |
transaction.channel | The used SDK to process the transaction (send , checkout or direct_charge ) |
transaction.user | The user object of the user carrying out the transaction |
transaction.peer | The receipt peer object contains objects of the user and business the transaction is being carried out with |
transaction.remark | Transaction remark |
transaction.type | Transaction type |
transaction.checkout | This will hold the checkout object if its a checkout transaction |
transaction.status | Transaction status |
transaction.mode | Transaction mode (debit or credit ) |
transaction.reference | Transaction reference |
transaction.meta | This object should contain additional/optional values passed from the SDK |