Comment on page
Payouts
Learn more about payouts APIs and their usage.
Below are some of the points you must be aware of while calling Payouts APIs:
- All API requests and responses are in JSON format.
- POST requests should include
ContentType: application/json
- All API response have status, message, and data.
- Swipez uses API keys to allow access to the API. Once you have signed up at our merchant site, you will be able to see your AccessKey and SecretKey.
URL | HTTP Verb | Functionality |
POST | To get auth token. | |
POST | To save beneficiary details. | |
POST | To transfer amount. | |
POST | To withdraw amount. | |
GET | To get nodal balance. | |
GET | To get transfer status. | |
GET | To get list of beneficiary. | |
POST | To fetch beneficiary details. |
Calling the Authentication APIs allows you to get and verify bearer tokens returned by Swipez. Swipez require these token for all further communication.
Swipez libraries automatically call the Authorize API and internally store the token. Do not store the token in an insecure manner. Regenerating a new token does not invalidate the already generated token. Token generated from one IP address cannot be used from a different IP address. Token generated is valid for 60 Min . Please ensure that you get a new token by calling the authorize API once the token has expired.
The API is rate limited per user. You will receive a 429 HTTP status code if you exceed the rate limit. The rate limit is 30 requests per minute per user and is subject to change.
post
/api/token
Get token
CURL
PHP
curl --location --request POST '<BASE URL>/api/token' \
--form 'access_key_id="<GET ACCESS KEY ID FROM YOUR ACCOUNT>"' \
--form 'secret_access_key="<GET SECRET ACCESS KEY FROM YOUR ACCOUNT>"'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '<BASE URL>/api/token',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('access_key_id' => '<GET ACCESS KEY ID FROM YOUR ACCOUNT>','secret_access_key' => '<GET SECRET ACCESS KEY FROM YOUR ACCOUNT>'),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
post
/api/v1/beneficiary/save
Save beneficiary
CURL
PHP
curl --location --request POST '<BASE URL>/api/v1/beneficiary/save' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Rohit Sharma",
"email_id": "[email protected]",
"mobile": "9999999999",
"account_number": "000111122235",
"ifsc": "HDFC0000008",
"upi": "rohit@okaxis",
"address": "Behala Manton Super Market, Room 43, Behala",
"city": "Bangalore",
"state": "Karnataka",
"pincode": "560001"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '<BASE URL>/api/v1/beneficiary/save',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"name": "Rohit Sharma",
"email_id": "[email protected]",
"mobile": "9999999999",
"account_number": "000111122235",
"ifsc": "HDFC0000008",
"upi": "rohit@okaxis",
"address": "Behala Manton Super Market, Room 43, Behala",
"city": "Bangalore",
"state": "Karnataka",
"pincode": "560001"
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer <TOKEN>',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
post
/api/v1/beneficiary/transfer
Transfer amount
CURL
PHP
curl --location --request POST '<BASE URL>/api/v1/beneficiary/transfer' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"beneficiary_id":"<SYSTEM GENERATED ID>",
"amount": "100",
"reference_id": "124",
"mode" : "banktransfer", //banktransfer or upi
"narrative": "First transfer"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '<BASE URL>/api/v1/beneficiary/transfer',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"beneficiary_id":"<SYSTEM GENERATED ID>",
"amount": "100",
"reference_id": "124",
"mode" : "banktransfer", //banktransfer or upi
"narrative": "First transfer"
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer <TOKEN>',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
post
/api/v1/payout/withdraw
Withdraw amount
CURL
PHP
curl --location --request POST '<BASE URL>/api/v1/payout/withdraw' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"amount": "100",
"narrative": "First withdraw"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '<BASE URL>/api/v1/payout/withdraw',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"amount": "100",
"narrative": "First withdraw"
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer <TOKEN>',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
get
/api/v1/payout/balance
Get balance
CURL
PHP
curl --location --request GET '<BASE URL>/api/v1/payout/balance' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '<BASE URL>/api/v1/payout/balance',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
,
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer <TOKEN>',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
get
/api/v1/payout/transferstatus/{type}/{id}
Get transfer status
PHP
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '<BASE URL>/api/v1/payout/transferstatus/{type}/{id}',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
,
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer <TOKEN>',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
get
/api/v1/beneficiary/list
Get beneficiary list
CURL
PHP
curl --location --request GET '<BASE URL>/api/v1/beneficiary/list' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '<BASE URL>/api/v1/beneficiary/list',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
,
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer <TOKEN>',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
post
/api/v1/beneficiary/detail
Beneficiary detail
CURL
PHP
curl --location --request POST '<BASE URL>/api/v1/beneficiary/detail' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"account_number": "0000122121",
"ifsc": "KKBK0001245"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '<BASE URL>/api/v1/beneficiary/detail',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"account_number": "0000122121",
"ifsc": "KKBK0001245"
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer <TOKEN>',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Last modified 1yr ago