Swipez Docs
Search…
Payouts
Learn more about payouts APIs and their usage.

Guidelines

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.

Quick Reference

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.

Authentication

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.

Rate limiting

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

Sample code

CURL
PHP
1
curl --location --request POST '<BASE URL>/api/token' \
2
--form 'access_key_id="<GET ACCESS KEY ID FROM YOUR ACCOUNT>"' \
3
--form 'secret_access_key="<GET SECRET ACCESS KEY FROM YOUR ACCOUNT>"'
4
5
Copied!
1
$curl = curl_init();
2
3
curl_setopt_array($curl, array(
4
CURLOPT_URL => '<BASE URL>/api/token',
5
CURLOPT_RETURNTRANSFER => true,
6
CURLOPT_ENCODING => '',
7
CURLOPT_MAXREDIRS => 10,
8
CURLOPT_TIMEOUT => 0,
9
CURLOPT_FOLLOWLOCATION => true,
10
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
11
CURLOPT_CUSTOMREQUEST => 'POST',
12
CURLOPT_POSTFIELDS => array('access_key_id' => '<GET ACCESS KEY ID FROM YOUR ACCOUNT>','secret_access_key' => '<GET SECRET ACCESS KEY FROM YOUR ACCOUNT>'),
13
));
14
15
$response = curl_exec($curl);
16
17
curl_close($curl);
18
echo $response;
19
Copied!
post
/api/v1/beneficiary/save
Save beneficiary

Sample code

CURL
PHP
1
curl --location --request POST '<BASE URL>/api/v1/beneficiary/save' \
2
--header 'Authorization: Bearer <TOKEN>' \
3
--header 'Content-Type: application/json' \
4
--data-raw '{
5
"name": "Rohit Sharma",
6
"email_id": "[email protected]",
7
"mobile": "9999999999",
8
"account_number": "000111122235",
9
"ifsc": "HDFC0000008",
10
11
"address": "Behala Manton Super Market, Room 43, Behala",
12
"city": "Bangalore",
13
"state": "Karnataka",
14
"pincode": "560001"
15
}'
Copied!
1
2
$curl = curl_init();
3
4
curl_setopt_array($curl, array(
5
CURLOPT_URL => '<BASE URL>/api/v1/beneficiary/save',
6
CURLOPT_RETURNTRANSFER => true,
7
CURLOPT_ENCODING => '',
8
CURLOPT_MAXREDIRS => 10,
9
CURLOPT_TIMEOUT => 0,
10
CURLOPT_FOLLOWLOCATION => true,
11
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
12
CURLOPT_CUSTOMREQUEST => 'POST',
13
CURLOPT_POSTFIELDS =>'{
14
"name": "Rohit Sharma",
15
"email_id": "[email protected]",
16
"mobile": "9999999999",
17
"account_number": "000111122235",
18
"ifsc": "HDFC0000008",
19
20
"address": "Behala Manton Super Market, Room 43, Behala",
21
"city": "Bangalore",
22
"state": "Karnataka",
23
"pincode": "560001"
24
}',
25
CURLOPT_HTTPHEADER => array(
26
'Authorization: Bearer <TOKEN>',
27
'Content-Type: application/json'
28
),
29
));
30
31
$response = curl_exec($curl);
32
33
curl_close($curl);
34
echo $response;
Copied!
post
/api/v1/beneficiary/transfer
Transfer amount

Sample code

CURL
PHP
1
curl --location --request POST '<BASE URL>/api/v1/beneficiary/transfer' \
2
--header 'Authorization: Bearer <TOKEN>' \
3
--header 'Content-Type: application/json' \
4
--data-raw '{
5
"beneficiary_id":"<SYSTEM GENERATED ID>",
6
"amount": "100",
7
"reference_id": "124",
8
"narrative": "First transfer"
9
}'
Copied!
1
2
$curl = curl_init();
3
4
curl_setopt_array($curl, array(
5
CURLOPT_URL => '<BASE URL>/api/v1/beneficiary/transfer',
6
CURLOPT_RETURNTRANSFER => true,
7
CURLOPT_ENCODING => '',
8
CURLOPT_MAXREDIRS => 10,
9
CURLOPT_TIMEOUT => 0,
10
CURLOPT_FOLLOWLOCATION => true,
11
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
12
CURLOPT_CUSTOMREQUEST => 'POST',
13
CURLOPT_POSTFIELDS =>'{
14
"beneficiary_id":"<SYSTEM GENERATED ID>",
15
"amount": "100",
16
"reference_id": "124",
17
"narrative": "First transfer"
18
}',
19
CURLOPT_HTTPHEADER => array(
20
'Authorization: Bearer <TOKEN>',
21
'Content-Type: application/json'
22
),
23
));
24
25
$response = curl_exec($curl);
26
27
curl_close($curl);
28
echo $response;
Copied!
post
/api/v1/payout/withdraw
Withdraw amount

Sample code

CURL
PHP
1
curl --location --request POST '<BASE URL>/api/v1/payout/withdraw' \
2
--header 'Authorization: Bearer <TOKEN>' \
3
--header 'Content-Type: application/json' \
4
--data-raw '{
5
"amount": "100",
6
"narrative": "First withdraw"
7
}'
Copied!
1
2
$curl = curl_init();
3
4
curl_setopt_array($curl, array(
5
CURLOPT_URL => '<BASE URL>/api/v1/payout/withdraw',
6
CURLOPT_RETURNTRANSFER => true,
7
CURLOPT_ENCODING => '',
8
CURLOPT_MAXREDIRS => 10,
9
CURLOPT_TIMEOUT => 0,
10
CURLOPT_FOLLOWLOCATION => true,
11
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
12
CURLOPT_CUSTOMREQUEST => 'POST',
13
CURLOPT_POSTFIELDS =>'{
14
"amount": "100",
15
"narrative": "First withdraw"
16
}',
17
CURLOPT_HTTPHEADER => array(
18
'Authorization: Bearer <TOKEN>',
19
'Content-Type: application/json'
20
),
21
));
22
23
$response = curl_exec($curl);
24
25
curl_close($curl);
26
echo $response;
Copied!
get
/api/v1/payout/balance
Get balance

Sample code

CURL
PHP
1
curl --location --request GET '<BASE URL>/api/v1/payout/balance' \
2
--header 'Authorization: Bearer <TOKEN>' \
3
--header 'Content-Type: application/json' \
Copied!
1
2
$curl = curl_init();
3
4
curl_setopt_array($curl, array(
5
CURLOPT_URL => '<BASE URL>/api/v1/payout/balance',
6
CURLOPT_RETURNTRANSFER => true,
7
CURLOPT_ENCODING => '',
8
CURLOPT_MAXREDIRS => 10,
9
CURLOPT_TIMEOUT => 0,
10
CURLOPT_FOLLOWLOCATION => true,
11
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
12
CURLOPT_CUSTOMREQUEST => 'GET',
13
,
14
CURLOPT_HTTPHEADER => array(
15
'Authorization: Bearer <TOKEN>',
16
'Content-Type: application/json'
17
),
18
));
19
20
$response = curl_exec($curl);
21
22
curl_close($curl);
23
echo $response;
Copied!
get
/api/v1/payout/transferstatus/{type}/{id}
Get transfer status
PHP
1
$curl = curl_init();
2
3
curl_setopt_array($curl, array(
4
CURLOPT_URL => '<BASE URL>/api/v1/payout/transferstatus/{type}/{id}',
5
CURLOPT_RETURNTRANSFER => true,
6
CURLOPT_ENCODING => '',
7
CURLOPT_MAXREDIRS => 10,
8
CURLOPT_TIMEOUT => 0,
9
CURLOPT_FOLLOWLOCATION => true,
10
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
11
CURLOPT_CUSTOMREQUEST => 'GET',
12
,
13
CURLOPT_HTTPHEADER => array(
14
'Authorization: Bearer <TOKEN>',
15
'Content-Type: application/json'
16
),
17
));
18
19
$response = curl_exec($curl);
20
21
curl_close($curl);
22
echo $response;
Copied!
get
/api/v1/beneficiary/list
Get beneficiary list

Sample code

CURL
PHP
1
curl --location --request GET '<BASE URL>/api/v1/beneficiary/list' \
2
--header 'Authorization: Bearer <TOKEN>' \
3
--header 'Content-Type: application/json' \
Copied!
1
$curl = curl_init();
2
3
curl_setopt_array($curl, array(
4
CURLOPT_URL => '<BASE URL>/api/v1/beneficiary/list',
5
CURLOPT_RETURNTRANSFER => true,
6
CURLOPT_ENCODING => '',
7
CURLOPT_MAXREDIRS => 10,
8
CURLOPT_TIMEOUT => 0,
9
CURLOPT_FOLLOWLOCATION => true,
10
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
11
CURLOPT_CUSTOMREQUEST => 'GET',
12
,
13
CURLOPT_HTTPHEADER => array(
14
'Authorization: Bearer <TOKEN>',
15
'Content-Type: application/json'
16
),
17
));
18
19
$response = curl_exec($curl);
20
21
curl_close($curl);
22
echo $response;
Copied!
post
/api/v1/beneficiary/detail
Beneficiary detail

Sample code

CURL
PHP
1
curl --location --request POST '<BASE URL>/api/v1/beneficiary/detail' \
2
--header 'Authorization: Bearer <TOKEN>' \
3
--header 'Content-Type: application/json' \
4
--data-raw '{
5
"account_number": "0000122121",
6
"ifsc": "KKBK0001245"
7
}'
Copied!
1
$curl = curl_init();
2
3
curl_setopt_array($curl, array(
4
CURLOPT_URL => '<BASE URL>/api/v1/beneficiary/detail',
5
CURLOPT_RETURNTRANSFER => true,
6
CURLOPT_ENCODING => '',
7
CURLOPT_MAXREDIRS => 10,
8
CURLOPT_TIMEOUT => 0,
9
CURLOPT_FOLLOWLOCATION => true,
10
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
11
CURLOPT_CUSTOMREQUEST => 'POST',
12
CURLOPT_POSTFIELDS =>'{
13
"account_number": "0000122121",
14
"ifsc": "KKBK0001245"
15
}',
16
CURLOPT_HTTPHEADER => array(
17
'Authorization: Bearer <TOKEN>',
18
'Content-Type: application/json'
19
),
20
));
21
22
$response = curl_exec($curl);
23
24
curl_close($curl);
25
echo $response;
Copied!
Last modified 1mo ago