There are two types of APIs to create payouts.
- Normal Payout API
- Composite Payout API
You can use Normal Payout API to:
- Create a Contact. You receive a Contact id in the response.
- Create a Fund account using the Contact id. The Fund account can be a bank account or a UPI ID.
- Create a payout using the Fund account id.
You can use the Composite Payout API to create a Contact, Fund account and payout in a single API call.
Always validate your customer's Fund account to ensure it is the account number where your user wants to receive the amount. Know more about Fund account validation.
Watch Out!
If your user provides an account number by mistake which is not where the user wants the amount, the payout gets processed if the account number exists. Hence, we recommend you to validate the Fund accounts before making a payout.
We recommend that you enable workflows on your account. This allows you to set up a maker-checker process. You can have 1 person create a payout and save it as a draft. Next, you can have someone from the financial team check the payouts before they are processed. Know more about RazorpayX Maker-Checker.
Intelligent Payouts automatically detects the degradation of beneficiary bank or NPCI and queues the payout in system till a pre-defined SLA, thereby reducing the chances of payouts going to DEEMED_SUCCESS
state, preventing money from getting blocked for T+2 days. This feature is enabled by default. You just have to consume the payout.failed
event to utilise this feature. Refer Intelligent Payouts for more information.
We recommend that you set low balance alerts on your RazorpayX account. Once set, we will notify you when your RazorpayX account balance drops below the set threshold. Know more about Low balance alerts.
If your RazorpayX account does not have sufficient funds to process a payout, the payout fails.
To avoid such scenarios, we recommend passing queue_if_low_balance: true
in the Payout API request. When you pass the parameter, if you do not have sufficient balance to process the payout, the payout is queued instead of failing. The queued payouts are automatically processed when you add funds to your RazorpayX account. Know more about Queued Payouts.
If you are not PCI-DSS compliant, you should not process your Contact's card details at your backend.
Use the public Fund Account API to create a Fund account with type card. The public Fund Account API only needs your <KEY_ID>. DO NOT send your <KEY_SECRET> when making this API call as you will be exposing this on your website. Know more about Payouts to Cards.
We recommend you ensure your payout API requests are idempotent. Idempotency allows you to safely retry or send the same request multiple times without fear of performing the same action more than once. Know more about RazorpayX Idempotency.
Example
You made a request, but were unable to read/save the response sent by Razorpay. In such cases, you make another payout request. Assuming the first request was successful, your account will be debited twice. Making your payout requests idempotent helps you avoid such scenarios.
To make a request idempotent:
- Add the header
X-Payout-Idempotency
to the request and pass an idempotency key against it. When a payout request is idempotent, you can make the same call multiple times, but the amount will be deducted only once.
- If a duplicate request is found with the same idempotency key, we return the payout's latest state.
As an extra precaution, you can get your IP address whitelisted. This means only API calls made from the whitelisted IP will be processed by us. Contact RazorpayX Support from your Dashboard to get your IP whitelisted.
Handy Tips
Whitelisting your IP will affect both Razorpay Payment Gateway and RazorpayX API calls.