This section provides details on how to integrate a standard transfer. It explains how to add a beneficiary, make a payment, and get the transfer status.

Steps

  1. Setup
  2. Initialization and Authorization
  3. Get beneficiary details
  4. Add a beneficiary
  5. Request a transfer
  6. Get 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) to get processed.

curl -X POST \
  'https://payout-api.cashfree.com/payout/v1/authorize' \

-H 'X-Client-Id: {{client id}}' \
 -H 'X-Client-Secret: {{client secret}}' \
 -H 'cache-control: no-cache'

Sample response

// This is a curl response
{
	"status": "SUCCESS",
	"message": "Token generated",
	"subCode": "200",
	"data": { "token": "eyJ0eXA...fWStg", "expiry": 1564130052 }
}

Step 3: Get Beneficiary Details

Fetch the details of a beneficiary by passing the beneficiary Id. beneId is a unique identifier for your beneficiary.

curl -X GET \
  'https://payout-api.cashfree.com/payout/v1/getBeneficiary/JOHN18011343' \
  -H 'Authorization: Bearer {{Token}}' \
  -H 'Postman-Token: 59c129af-c109-482a-bb6f-6fc18abde21d' \
  -H 'cache-control: no-cache'

Sample Response

{
	"status": "SUCCESS",
	"subCode": "200",
	"message": "Details of beneficiary",
	"data": {
		"beneId": "JOHN18011343",
		"name": "John Doe",
		"groupName": "DEFAULT",
		"email": "johndoe@cashfree.com",
		"phone": "9876543210",
		"address1": "ABC street",
		"address2": "",
		"city": "Bangalore",
		"state": "Karnataka",
		"pincode": "0",
		"bankAccount": "00011020001772",
		"ifsc": "HDFC0000001",
		"status": "VERIFIED"
	}
}

Step 4: Add Beneficiary

Add a beneficiary by providing the bank account number, IFSC, and other required details. You can only request a transfer for added beneficiaries.

curl -X POST \
  'https://payout-api.cashfree.com/payout/v1/addBeneficiary' \
  -H 'Authorization: Bearer {{Token}}' \
  -d '{
  "beneId": "JOHN18011343",
  "name": "john doe",
  "email": "johndoe@cashfree.com",
  "phone": "9876543210",
  "bankAccount": "00111122233",
  "ifsc": "HDFC0000001",
  "address1": "ABC Street",
  "city": "Bangalore",
  "state": "Karnataka",
  "pincode": "560001"
}'

Sample Response

{
	"status": "SUCCESS",
	"subCode": "200",
	"message": "Beneficiary added successfully"
}

Step 5: Request Transfer

API to request a payout transfer.

curl -X POST \
  'https://payout-api.cashfree.com/payout/v1/requestTransfer' \
  -H 'Authorization: Bearer {{Token}}' \
  -d '{
  "beneId": "JOHN18011343",
  "amount": "1.00",
  "transferId": "JUNOB2018"
}'

Sample Response

{
	"status": "SUCCESS",
	"subCode": "200",
	"message": "Transfer completed successfully",
	"data": {
		"referenceId": "10023",
		"utr": "P16111765023806",
		"acknowledged": 1
	}
}

Step 6: Get Transfer Status

API to fetch details of a particular transfer. You can either pass referenceId or transferId to fetch the details.

This API gives responses other than SUCCESS and ERROR.

curl -X GET \
  'https://payout-api.cashfree.com/payout/v1.1/getTransferStatus?referenceId=14057&transferId=tranfer001234' \
  -H 'Authorization: Bearer {{Token}}' \

Sample Response

{
	"status": "SUCCESS",
	"subCode": "200",
	"message": "Details of transfer with transferId tranfer001234",
	"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 Libraries and 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.

Was this page helpful?