> For the complete documentation index, see [llms.txt](https://gramhal.gitbook.io/bolbhav/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gramhal.gitbook.io/bolbhav/chapter-1-database/user-data/user_payout_transactions.md).

# user\_payout\_transactions

This table is an audit log of all the payout transactions initiated by a user when redeeming reward tokens.

## Model

<table><thead><tr><th>Field</th><th>Type</th><th data-type="checkbox">Nullable</th><th>Constraint</th></tr></thead><tbody><tr><td>id</td><td>int4</td><td>false</td><td></td></tr><tr><td>user_id</td><td>int4</td><td>false</td><td>Foreign Key<br>(person table)</td></tr><tr><td>amount</td><td>float8</td><td>false</td><td></td></tr><tr><td>status</td><td>varchar</td><td>false</td><td></td></tr><tr><td>payout_id</td><td>text</td><td>false</td><td></td></tr><tr><td>payout_transaction_data</td><td>json</td><td>false</td><td></td></tr><tr><td>error_code</td><td>json</td><td>false</td><td></td></tr><tr><td>source</td><td>varchar</td><td>false</td><td></td></tr><tr><td>fund_account_id</td><td>varchar</td><td>false</td><td></td></tr><tr><td>created_at</td><td>timestamp</td><td>false</td><td></td></tr><tr><td>updated_at</td><td>timestamp</td><td>false</td><td></td></tr><tr><td>reference</td><td>json</td><td>false</td><td></td></tr></tbody></table>

### Description of fields

#### id

The primary key of the table.

#### user\_id

ID of the user who initiated the payout.

#### amount

Amount (in INR) involved in the transaction.

#### status

Status of the transaction.

1. Pending - This means the payout has been started but is still not complete between the Bolbhav bank and user bank.
2. Processed - This means the payout was successful and the amount has been deducted from Bolbhav bank.
3. Reversed - This means the payout was unsuccessful for some reasons.

#### payout\_id

This is a unique ID of the payout that Bolbhav uses to mark each payout.

#### payout\_transaction\_data

Data received from payout provider (currently RazorPay). This will include more details about the payout transaction and the corresponding fields based on the transaction status.

#### error\_code

This is the error JSON as received by payout provider. Here's one example:

{% code overflow="wrap" fullWidth="false" %}

```json
{
  "source": "gateway",
  "reason": "gateway_technical_error",
  "description": "Payout failed due to a temporary technical issue at the partner bank. Please retry after 30 min.",
  "code": "NA",
  "step": "NA",
  "metadata": {}
}
```

{% endcode %}

#### source

This field captures the source of the transaction details. This field is currently hardcoded to store "RazorpayX" value as all payout transactions are being done through Razorpay.

#### fund\_account\_id

The foreign key referring to the fund account id for which the payout transaction has been triggered.

#### created\_at

Timestamp at which payout entry was created.

#### updated\_at

Timestamp at which payout entry was last updated.

#### reference

Additional details that are captured to store information about the fund account id at the time of the transaction. A sample entry looks like:

```json
{
  "user_account_name": "Priyansh sahu",
  "fund_account_id": "fa_Nf9SlPJk0E11PO",
  "bank_ifsc_code": "KKBK0000813"
}
```
