A batch transfer is a way to make multiple payouts transfer requests at one time. Cashfree offers separate APIs for batch transfers. This section provides details on how to integrate a batch transfer from scratch. It includes making a batch transfer and fetching the batch transfer status.

Steps

  1. Setup
  2. Initialization and Authorization
  3. Request a batch transfer
  4. Get batch transfer status

Check out our libraries and samples section for the integration code hosted on GitHub.

Step 1: Setup

Get your corresponding clientId and clientSecret from your payout dashboard and ensure that your IP is whitelisted as well. Check our development quickstart here.

Host URL: Use the following URL for PROD and TEST, respectively:

Step 2: Initialization and Authorization

Call the authenticate API to Cashfree system/server to obtain an Authorization Bearer token. All other API calls must have this token as Authorization header in the format ‘Bearer <token>’ (without quotes) for them to be processed.

Sample Response

{
	"status": "SUCCESS",
	"message": "Token generated",
	"subCode": "200",
	"data": { "token": "eyJ0eXA...fWStg", "expiry": 1564130052 }
}

Step 3: Request Batch Transfer

A batch transfer allows you to request multiple payout transfers at a given time. Batch transfers can be created by passing the beneficiary ID or by passing the beneficiary details.

Sample Response

{
  "status": SUCCESS,
  "subCode": "200",
  "message": "Request accepted",
  "data": { "referenceId": 1594 }}

Step 4: Get Batch Transfer Status

Get the status of all transfers within a batch transfer.

Sample Response

{
	"status": "SUCCESS",
	"subCode": "200",
	"message": "Details of transfer with transferId 159381033b123",
	"data": {
		"transfer": {
			"referenceId": 17073,
			"bankAccount": "026291800001191",
			"beneId": "ABCD_123",
			"amount": "20.00",
			"status": "SUCCESS",
			"utr": "1387420170430008800069857",
			"addedOn": "2017­-01­-07 20:09:59",
			"processedOn": "2017­-01­-07 20:10:05",
			"acknowledged": 1
		}
	}
}

Check out our Samples section for the integration code hosted on GitHub.

You now have a complete standard transfer integration for payouts. Cashfree will send webhooks in the case of certain events. Webhooks are server to server notifications. Learn more about webhooks here.

When testing your integration with your test API key, you can use test numbers to ensure that it works correctly.