Cashgram is a sub-service of payouts offered by Cashfree that enables a merchant to send money to their client instantly. This topic will help you to integrate with Cashgram It includes creating a Cashgram and fetching the Cashgram status.

Steps

  1. Setup
  2. Initialization and Authorization
  3. Create Cashgram
  4. Get Cashgram Status

Step 1: Setup

Get your corresponding clientId and clientSecret from your payout dashboard and ensure that your IP is whitelisted. 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’s 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.

Sample Response

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

Step 3: Create Cashgram

Create a Cashgram that can be sent directly to your end customer by passing their relevant information.

notifyCustomer field is an optional field when set to 1 it sends the Cashgram to your end customer phone and email.

Sample Response

{
	"status": "SUCCESS",
	"subCode": "200",
	"message": "Cashgram Created",
	"data": { "referenceId": 3645, "cashgramLink": "http://bit.ly/2xxnGm8" }
}

Step 4: Get Cashgram Status

Get the status of the created Cashgram by passing the cashgramId.

Sample Response

{
	"status": "SUCCESS",
	"subCode": "200",
	"message": "Cashgram details retrieved",
	"data": {
		"cashgramStatus": "ACTIVE",
		"referenceId": 123456,
		"cashgramId": "JOHaN10",
		"cashgramLink": "http://csgr.am/abcdefg"
	}
}

You now have a complete Cashgram integration for payouts. Cashfree will send webhooks in the case of certain events. Webhooks are events that send you notifications. Learn more about webhooks here.

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