You should always start with third party documentation: API Reference Guide
401 means its unauthorized request. You probably have not followed the right way to associate the auth keys.
Quote:All successful responses are returned with HTTP Status code 200. In case of failure, Razorpay API returns a JSON error response with the parameters that detail the reason for the failure.
BTW, I have never seen any decent service asking for username-password in plain as part of request.
Quote:All Razorpay APIs are authorized using Basic Authorization. Basic authorization requires the following: