Available in🇲🇾 Malaysia
RazorpayX payouts in Malaysia are available on request. RazorpayX is not enabled on Razorpay Curlec accounts by default. To enquire about RazorpayX for your business, contact our Support team.
API Guidelines
Guidelines to follow while making API calls:- Make all API calls from your server. Live calls work only from your allowlisted server IPs.
- Pass your RazorpayX account number in the
account_numberparameter of the Payout API and the Composite Payout API. This is the 16-digit number that starts with 818181, shown on the RazorpayX Dashboard.- DO NOT pass your beneficiary’s account number here.
- Send
currencyasMYRand amounts in sen.100000is RM 1,000.00. - Send
modein upper case:IBFTfor a bank account orDUITNOWfor a DuitNow proxy. - We recommend using your internal transaction ID as the
reference_idvalue in a Payout API request. It can be up to 40 characters. - A webhook can be sent more than once and events can arrive out of order. Deduplicate webhooks using the payout ID and the payout status.
API Key Guidelines
- The owner of your RazorpayX account generates the API keys on the Dashboard under Account & Settings → Developer Controls → API Keys. Know more about API keys.
- Ensure that your API key, that is the
<KEY_ID>and<KEY_SECRET>, is not publicly available. Only a limited number of people should have access to it. We recommend you store the key as environment variables. - Download and save your API key when you generate it. The key secret is shown only once. If you lose it, you must regenerate the key.
- When you regenerate your API key, the Dashboard asks for an OTP. You can deactivate the old key immediately or within 24 hours, so that you can switch over without a gap. Update your production configuration before the old key stops working.
Types of Payout APIs
There are two ways to create payouts by API.Composite Payout API
Use the Composite Payout API to create a Contact, a Fund account and a payout in a single API call. Send the beneficiary inline asfund_account with contact. Refer to the composite payout to a bank account or to a DuitNow proxy.
Payout API with a Fund Account ID
A composite payout or a composite validation returns afund_account.id. Reuse it in later payouts to the same beneficiary by sending it as fund_account_id in the Payout API.
Payout States
- A payout above the approval amount set for your account starts in the
pendingstate and waits for a checker to approve it on the Dashboard. A payout below this amount goes to the bank directly. Build your integration to handlependingandrejected. processed,failed,reversed,rejectedandcancelledare final states.- A payout can move to
reversedwhen the beneficiary was credited and the bank then returns the payout. The amount is credited back to your balance.
Payout Status Details
Status details are sent as part of the fetch payout API response and webhook payloads. They give the reason for the current payout status. Failure and reversal reasons come instatus_details.
Check Payout Status
- Subscribe to our webhooks to get notified whenever the status of a payout changes. Update your database using the webhook payload.
- Subscribe to
payout.failed. If you do not, a failed payout is reported to you aspayout.reversedinstead. - Verify every webhook. Compute the HMAC SHA-256 of the raw request body with your webhook secret and compare it with the
X-Razorpay-Signatureheader. Discard the webhook if they differ. - Respond with HTTP 200 within 5 seconds. A webhook that does not receive a 2xx response is sent again.
- Use the Fetch a Payout API to confirm the status of a single payout, for example when a webhook is delayed.
Other Guidelines
Fund Account Validation
Validate a beneficiary’s bank account or DuitNow proxy before you pay. The validation returns the name registered with the bank, which you can compare with the name the beneficiary gave you. No amount is credited to the beneficiary. Know more about Fund account validation.Approvals
Keep the people who create payouts (makers) separate from the people who approve them (checkers). Payouts above the approval amount set for your account wait until a checker on your team approves or rejects them on the Dashboard. Payouts below this amount go to the bank directly. Know more about the approval workflow.Queued Payouts
Passqueue_if_low_balance: true in the Payout API request. If you do not have sufficient balance to process the payout, the payout is queued. Queued payouts are processed after you add funds to your RazorpayX account. Know more about Queued Payouts.
Handling 5XX Errors and Idempotency
TheX-Payout-Idempotency header is mandatory on every payout create request. Idempotency allows you to safely retry or send the same request multiple times without performing the same action more than once.
Example
You made a request but were unable to read or save the response. You then make another payout request. If the first request was successful, your account is debited twice. Making your payout requests idempotent helps you avoid this.
To make a request idempotent:
- Add the header
X-Payout-Idempotencyto the request and pass a unique idempotency key against it. You can make the same call multiple times, but the amount is deducted only once. - If a duplicate request is found with the same idempotency key, we return the payout’s latest state.