Bolbhav to User (Payout)

This page outlines the process by which users can redeem cash in exchange of their gold tokens

We are using RazorPay X for Payout from Bolbhav bank account to user's bank account. API Documentation 1 Gold Token = Rs.1

For more information on how PhonePe is integrated into the Bolbhav app, visit the RazorPay X page in Chapter 10 - SaaS Products

Prerequisites for Payout:

To be eligible for a payout, a user must meet the following conditions:

  1. Minimum Token Requirement: The user must possess 250 or more Gold Tokens to initiate a payout transaction.

  2. Bank Account Verification: Users with at least 250 Gold Tokens can add their bank account details within the app.

  3. Payout Button Activation: If a user has successfully added their bank account details and has not initiated a payout within the day, the payout button becomes enabled.

  4. Daily Redemption Limit: Users can redeem Gold Tokens for cash only once a day, with a maximum redemption amount of 250 tokens.

Payout scenarios:

Currently, following options are available in payout

  • User can make a payout of 250Rs once per day

  • Users can convert their Gold Tokens to Silver Tokens the exchange rate (1 Gold Token equivalent to 2 Silver Tokens. There are no restrictions on the amount of Gold Tokens that can be converted to Silver Tokens.

  • Upon successful purchase of a plan by any Bolbhav user, the same amount of the membership plan purchased will be paid out to the user through the RazorPay X payment gateway.

    Payout is initiated for the seller user via the endpoint: {{base_url}}/payment-complete Purpose of this API: It verifies the payment made by the buyer user and, upon successful payment, initiates the payout for the seller user.

Wallet transactions occur in both the seller user and buyer user wallets:

  • Amount: Tokens are debited from the seller user's membership wallet and credited to the buyer user's membership wallet. The payout amount is credited to the seller user's wallet.

  • Source Wallet ID: The Seller User membership wallet ID is designated as the source.

  • Target Wallet ID: The bank's membership wallet ID serves as the target.

  • Reason: The reason field indicates the purpose of the transaction, specifying the membership plan sold for 100 silver tokens.

  • Ref ID: A unique identifier is generated to reference the payout transaction, typically in the format of silver_token_payment_{user.id}.

User payout transactions are stored in the user payout transaction table and include:

  • Source Wallet ID: The seller user payback wallet ID is designated as the source.

  • Target Wallet ID: The bank's payback wallet ID serves as the target.

  • Amount: The amount credited to the payback wallet corresponds to the credit associated with the membership plan payout.

  • Reason: The reason field indicates the purpose of the transaction, specifying the payout done against the membership plan.

  • Ref ID: A unique identifier is generated to reference the payout transaction, typically in the format of payout_transaction_{payout_transaction_id}.

Payout Workflow:

  1. When a user adds their bank account, the RazorPay API is invoked to generate a fund account ID for them.

    Endpoint Triggered: {{base_url}}/create-payout-fund-account

    Purpose of this API: It facilitates the creation of a user fund account and stores both the user's fund account details and bank account information in the database.

  2. Once the user's fund account ID is created, their bank account details including account number, IFSC code, name, Razorpay fund account ID, reference ID, and contact ID are stored in the user bank account table.

  3. When a user initiates a payout, the transaction is logged in the user_payout_transaction table. Upon successful payout, the specified amount is credited to the user's registered bank account.

    Endpoint Triggered: {{base_url}}/initiate-payout

    Purpose of this API: This API facilitates the initiation of payouts and is responsible for crediting the specified amount into the user's account by redeeming gold tokens.

  1. Following a successful payout, the system verifies the transaction status through the following endpoint:

    Endpoint Triggered: {{base_url}}/user-payout-details-and-status

    Purpose of this API: This API is utilized to retrieve and ascertain the status of the payout transaction.

  2. An amount 'X' is debited from the user's Reward Wallet (gold tokens), and the same amount 'X' is added to the user's Payback Wallet. Additionally, transactions are recorded in the wallet ledger table for both the membership and payback wallets.

  3. When users opt to delete their account to add another bank account, their account details are erased from the user_bank_accounts table. Additionally, their fund account ID is flagged as inactive in the RazorPay Dashboard upon clicking the delete button.

    Endpoint Triggered: {{base_url}}/update-fund-account-status Purpose of this API: This API facilitates the deletion of account details and deactivation of the user's fund account ID in Razorpay.

Database transactions between Bolbhav and the payout user

When a user initiates a payout, an entry is recorded in the user_payout_transaction table. Based on the transaction status, the user payout transaction is marked as processed, reverted, or processing.

Upon successful payout, 'X' token amount is debited from the user's Reward Wallet. A new entry is logged in the wallet ledger:

  • Source Wallet ID: The user's Reward Wallet ID is designated as the source.

  • Target Wallet ID: The bank's Reward Wallet ID serves as the target.

  • Amount: The amount debited from the Reward Wallet corresponds to the maximum of Rs. 250.

  • Reason: This field indicates the purpose of the transaction, specifying the token debited for the payout. It could be formatted as "Payout transaction."

  • Ref ID: A unique identifier is generated to reference the payout transaction, typically in the format of payout_transaction_{payout_transaction_id}.

Simultaneously, 'X' amount is credited to the user's Payback Wallet. Another entry is logged in the wallet ledger:

  • Source Wallet ID: The user's Payback Wallet ID is designated as the source.

  • Target Wallet ID: The bank's Payback Wallet ID serves as the target.

  • Amount: The amount credited to the Payback Wallet corresponds to the maximum of Rs. 250.

  • Reason: This field indicates the purpose of the transaction, specifying the token credited for the payout. It could be formatted as "Payout transaction."

  • Ref ID: A unique identifier is generated to reference the payout transaction, typically in the format of payout_transaction_{payout_transaction_id}.

To Do:

  1. Move the section mentioning silver token purchase to the User to Bolbhav page

Last updated