> 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/subscription-data/payment_transactions.md).

# payment\_transactions

## 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>transaction_id</td><td>text</td><td>false</td><td></td></tr><tr><td>transaction_data</td><td>json</td><td>false</td><td></td></tr><tr><td>data</td><td>json</td><td>false</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>remarks</td><td>text</td><td>true</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 payment.

#### amount

Amount (in INR) involved in the transaction.

#### status

Status of the transaction.

1. Initiated - This means that the transaction has been initiated but the user still has to enter their payment details and submit the transaction from their end.
2. Pending - This means the user has submitted the transaction at their end but Bolbhav's payment provider still hasn't received the amount.
3. Completed - This means the payment was successful and the amount has been received into Bolbhav's payment provider account.
4. Failed - This means the payment was unsuccessful for some reasons. The amount wasn't received due to specific reasons.

#### transaction\_id

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

#### transaction\_data

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

#### data

This is the Bolbhav data specific to the user's transaction. An example for the format is:

```json
{
  "membership_plan": {
    "id": "unique_days_20",
    "amount": 20,
    "label": "₹20",
    "days": 5,
    "description": "5 दिनों के लिए फशल के नए भाव"
  }
}
```

#### created\_at

Timestamp at which payment transaction entry was created.

#### updated\_at

Timestamp at which payment transaction entry was last updated.

#### remarks

Additional remarks for the payment transaction. This value is filled based on the transaction\_data returned by the payment provider API. Since reading the whole `transaction_data` JSON can be difficult for admins, this field is a simplied version of transaction status like reason for failure, backfill entry etc.
