razorpay / razorpay/razorpay-java
5% Failure Rate of Payment Transfer to Bank Accounts via Route (`RazorpayException BAD_REQUEST_ERROR:The id provided does not exist`)
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 74
- Forks
- 83
- PR merge metrics
- No merged PRs in 30d
Description
I work at a start-up and we use Razorpay payment gateway to collect payments from our client's customers'. We have added the client bank accounts in our Razorpay account and use routing to transfer the amount to the client using the "Route" feature of Razorpay. We are experiencing a 5% failure of payment transfers in a day when there are a more than 1000 transactions being made in a day.
I'm using this code snippet to transfer the amount (razorpay-java-1.4.3)
Map<String, Object> paymentPayload = (Map<String, Object>) payload.get("payload");
Map<String, Object> payment = (Map<String, Object>) paymentPayload.get("payment");
Map<String, Object> paymentEntity = (Map<String, Object>) payment.get("entity");
String paymentId = String.valueOf(paymentEntity.get("id"));
RazorpayClient razorpay = new RazorpayClient(razorpayMID, razorpaySecretKey);
JSONObject createOrderRequest = new JSONObject();
JSONObject request = new JSONObject();
JSONArray transfers = new JSONArray();
createOrderRequest.put(AMOUNT, amountToBeTransferred);
createOrderRequest.put(CURRENCY, "INR");
createOrderRequest.put("account", accountId);
transfers.put(createOrderRequest);
request.put("transfers", transfers);
List<Transfer> razorpayTransfers = razorpay.payments.transfer(paymentId, request);
The transfer method in the last line fails with this error: RazorpayException BAD_REQUEST_ERROR:The id provided does not exist
JSON body of the transfer API (payload):
{
"account_id": "acc_qwerty",
"contains": [
"payment"
],
"created_at": 1721298486,
"entity": "event",
"event": "payment.captured",
"payload": {
"payment": {
"entity": {
"acquirer_data": {
"rrn": "0987654321"
},
"amount": 1101233,
"amount_refunded": 0,
"bank": null,
"base_amount": 1101233,
"captured": true,
"card_id": null,
"contact": "+911234567890",
"created_at": 1721298485,
"currency": "INR",
"description": "qwerty",
"email": "[johndoe@gmail.com](mailto:johndoe@gmail.com)",
"entity": "payment",
"error_code": null,
"error_description": null,
"error_reason": null,
"error_source": null,
"error_step": null,
"fee": 0,
"id": "pay_xyz",
"international": false,
"invoice_id": null,
"method": "upi",
"notes": {
"amountPaid": "1100000",
"convenienceCharges": "1233",
"proformaOrderId": "123",
"proformaOrderNo": "456",
"regNo": "112233",
"selectedPaymentMethod": "upi",
"studentId": "445566",
"tenantId": "999",
"type": "payment"
},
"order_id": "order_abc",
"refund_status": null,
"reward": null,
"status": "captured",
"tax": 0,
"upi": {
"payer_account_type": "bank_account",
"vpa": "johndoe@abc"
},
"vpa": "johndoe@abc",
"wallet": null
}
}
}
}
Note: Replaced all sensitive information.
The error message is not helpful because the payment ID is valid. What is the error message trying to say? The payment ID is not yet recorded in Razorpay's system?
We tried contacting the Razorpay support but we did not receive any help in this issue. Did anyone else face this issue before? If so, how did you overcome this issue?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No repository file or test is identified. Start at the payments.transfer(paymentId, request) call and the supplied payment.captured payload, then determine which Route requirement or request context produces the error; done means a confirmed cause and a reproducible resolution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- payments
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 18/100