Payment Flow of AUTH & CAPTURE can be divided into 3 sub-flows:-
PhonePe Wallet Linking Flow
Wallet Balance & TopUp Flow
Auth & Capture Flow
**PhonePe Wallet Linking Flow **
User visits merchant platforms and proceed to link the PhonePe wallet with merchant platform
User enters the mobile number
Merchant calls the** [PhonePe Trigger OTP API](🔗)**. PhonePe server validates the request and sends the OTP to the customer.
User enters the OTP
Merchant calls the **[PhonePe Verify OTP API](🔗) **and get the OTP validated
Merchant saves the UserAuthToken for future operations

**Wallet Balance & Top-Up Flow **
On clicking on PhonePe, the user need to see the balance.
Merchant server calls the **[Get Wallet Balance API](🔗)** with the userAuthToken received while linking the user’s PhonePe wallet
PhonePe server validates the token and shares the usableBalance which can be displayed as a balance
Merchant display the Wallet top-up CTA if the balance is insufficient requirements
Merchant server calls [**Wallet TopUp API**](🔗) to get the redirection URL
Redirects user to the URL for top-up
User completes the top-up. Merchant client receives the response from PhonePe
Merchant client passes the information to the server

**Auth & Capture Flow **
User adds the services in the cart
Cart passes details like items, amount, etc. to the merchant server
Merchant server calls the **[Submit Auth Request API](🔗)** to block the amount in customer’s PhonePe Wallet
PhonePe validates the request and blocks the amount. On successful block, PhonePe pass the auth Id to the merchant
Merchant starts providing the services to the customer
Once fulfillment is completed, the merchant server calculated the final amount and calls the **[Submit Capture Request API](🔗) ** with the final amount that has to be debited
PhonePe debits the amount and releases the remaining blocked amount. PhonePe confirms the status to the merchant
Merchant notifies the customer
