# wallet\_ledger

### Modal

<table><thead><tr><th>Field</th><th>Type</th><th data-type="checkbox">Nullable</th><th>Constraints</th></tr></thead><tbody><tr><td>id</td><td>varchar</td><td>false</td><td></td></tr><tr><td>source_wallet_id</td><td>varchar</td><td>true</td><td>Foreign key<br>(user wallet)</td></tr><tr><td>target_wallet_id</td><td>varchar</td><td>true</td><td>Foreign key<br>(user wallet)</td></tr><tr><td>amount</td><td>int4</td><td>true</td><td></td></tr><tr><td>reason</td><td>varchar</td><td>true</td><td></td></tr><tr><td>ref_id</td><td>varchar</td><td>true</td><td></td></tr><tr><td>created_at</td><td>timestamp</td><td>true</td><td></td></tr><tr><td>updated_at</td><td>timestamp</td><td>true</td><td></td></tr><tr><td>amount_unit</td><td>varchar</td><td>true</td><td></td></tr></tbody></table>

### Description of field

#### id

The primary key of the table.

#### source\_wallet\_id

Represents the user wallet in each wallet transaction.

#### target\_wallet\_id

Represents the bank wallet in each wallet transaction

#### amount

The amount involved in the wallet transaction. This is the same amount debited or credit to the user/bank wallet. A positive amount means the balance was credited to the user wallet and a negative amount means the balance was debited from the user wallet.

{% hint style="info" %}
The sum of all wallet ledger entries for a specific wallet type for a user should always be equal to the current balance of that user wallet.
{% endhint %}

#### reason

The reason for which the wallet transaction occured. This often determines for which event/activity the wallet transaction was created for.

#### ref\_id

This points to the short and specific data for the wallet transaction reason. Like the payout transaction id or payment transaction id or the UPI ID.

#### created\_at

Timestamp when the wallet ledger entry was created.

#### updated\_at

Timestamp when the wallet ledger entry was last updated.

#### amount\_unit

This refers to the amount unit that was involved in the transaction. Default value is token. We are currently using INR for only payouts.
