While uploading you app to the Google Play Console, create In-app Products to enable In-App Purchase.
Open Play Console and go to the In-app products page (Monetize > Products > In-app products).
Click Create product.
Enter your product details :
Product ID : A unique ID for your in-app product. (make sure to plan your product IDs carefully. Product IDs need to be unique for your app, and they can’t be changed or reused after they’ve been created).
⚠️ Note : : The product ID android.test is unavailable for use, along with all product IDs that start with android.test .
Name : A short name of the item (up to 55 characters, but we recommend limiting titles to 25 characters to display properly in all contexts).
Description : A long description of the item (up to 200 characters).
Price : Enter a price in your local currency or select a pricing template
Save your changes and click Activate to make your in-app product available to users.
To be available for purchase, a product needs to be active and its app needs to be published.
If you’re using a test account, active items are available in unpublished apps. To learn more, go to the Android Developers site.