Hello Kamal Ranabhat,
Thank you for reaching out to Microsoft Support!
For the issue related to 402 Payment required, please find the below mentioned verifications which might help resolve the issue.
- Ensure that your application has completed the billing onboarding process for the Microsoft Graph API.
- Evaluating subscriptions limits - If you are using a metered API, you may need to upgrade your subscription or adjust your usage.
- Verify application setup - Double check that your application is correctly registered and subscribed to the required API. Use Azure CLI Commands like az resource list or az resource show to confirm the provisioning state and billing plan.
- Please make sure the target application must be a confidential client application since public client applications are not supported in this scenario.
Please refer the documentation -Payment requirements
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.