Prepaid Coupons(Epin)
Manage Coupons

Active Coupons

get
β€Ž
https://<domain>/<api prefix>/<version>/user/get/active-epin/

Sample Code

Node
1
var request = require('request');
2
var options = {
3
'method': 'GET',
4
'url': 'https://<domain>/<api prefix>/<version>/user/get/active-epin/',
5
'headers': {
6
'apikey': '<apikey>',
7
'Authorization': 'Bearer <access token>',
8
},
9
formData: {}
10
};
11
request(options, function (error, response) {
12
if (error) throw new Error(error);
13
console.log(response.body);
14
});
Copied!
PHP
1
<?php
2
​
3
$curl = curl_init();
4
​
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/user/get/active-epin/',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'GET',
14
CURLOPT_HTTPHEADER => array(
15
'apikey: <apikey>',
16
'Authorization: Bearer <access token>',
17
),
18
));
19
​
20
$response = curl_exec($curl);
21
​
22
curl_close($curl);
23
echo $response;
Copied!

Transfer Coupon

post
β€Ž
https://<domain>/<api prefix>/<version>/user/transfer/epin/

Sample Code

Node
1
var request = require('request');
2
var options = {
3
'method': 'POST',
4
'url': 'https://<domain>/<api prefix>/<version>/user/transfer/epin/',
5
'headers': {
6
'apikey': '<apikey>',
7
'Authorization': 'Bearer <access token>',
8
},
9
formData: {
10
'user': '<username>',
11
'epin': '<coupon id>'
12
}
13
};
14
request(options, function (error, response) {
15
if (error) throw new Error(error);
16
console.log(response.body);
17
});
Copied!
PHP
1
<?php
2
​
3
$curl = curl_init();
4
​
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/user/transfer/epin/',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'POST',
14
CURLOPT_POSTFIELDS => array('user' => '<username>','epin' => '<coupon id>'),
15
CURLOPT_HTTPHEADER => array(
16
'apikey: <apikey>',
17
'Authorization: Bearer <access token>'
18
),
19
));
20
​
21
$response = curl_exec($curl);
22
​
23
curl_close($curl);
24
echo $response;
Copied!

Error Responses

Status Code
Error Type
FIeld
Description
400
Validation Error
user
User is not found.
Field may not be blank.
Self transfer not allowed.
User already has the maximum number of active coupons.
400
Validation Error
epin
Coupon is not found.
Coupon is not transferable.
Invalid coupon.

Share Coupon

post
β€Ž
https://<domain>/<api prefix>/<version>/user/share/epin/

Sample Code

Node
1
var request = require('request');
2
var options = {
3
'method': 'POST',
4
'url': 'https://<domain>/<api prefix>/<version>/user/share/epin/',
5
'headers': {
6
'apikey': '<apikey>',
7
'Authorization': 'Bearer <access token>',
8
},
9
formData: {
10
'email': '<user_mail>',
11
'epin': '<coupon_id>',
12
'share_amount': '<amount>'
13
}
14
};
15
request(options, function (error, response) {
16
if (error) throw new Error(error);
17
console.log(response.body);
18
});
19
​
Copied!
PHP
1
<?php
2
​
3
$curl = curl_init();
4
​
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/user/share/epin/',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'POST',
14
CURLOPT_POSTFIELDS => array('email' => '<user_mail>','epin' => '<coupon_id>','share_amount' => '<share_amount>'),
15
CURLOPT_HTTPHEADER => array(
16
'apikey: <apikey>',
17
'Authorization: Bearer <access token>',
18
),
19
));
20
​
21
$response = curl_exec($curl);
22
​
23
curl_close($curl);
24
echo $response;
Copied!

Error Responses

Status Code
Error Type
FIeld
Description
400
Validation Error
email
This field is required.
This field may not be blank.
Enter a valid email address.
400
Validation Error
epin
This field is required.
This field may not be blank.
Only numeric characters are allowed.
Coupon is not found.
Coupon is not transferable.
400
Validation Error
share_amount
This field is required.
This field may not be blank.
Only numeric characters are allowed.
Insufficient Balance.

Delete Coupon

delete
β€Ž
https://<domain>/<api prefix>/<version>/user/delete/epin/

Sample Code

Node
1
var request = require('request');
2
var options = {
3
'method': 'DELETE',
4
'url': 'https://<domain>/<api prefix>/<version>/user/delete/epin/',
5
'headers': {
6
'apikey': '<apikey>',
7
'Authorization': 'Bearer <access token>',
8
'Cookie': 'store_user=admin_store; sessionid=2ysk6htgc4b3w2f87zvw9cn4v5rxqkws'
9
},
10
formData: {}
11
​
12
}
13
};
14
request(options, function (error, response) {
15
if (error) throw new Error(error);
16
console.log(response.body);
17
});
Copied!
PHP
1
<?php
2
​
3
$curl = curl_init();
4
​
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/user/delete/epin/',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'DELETE',
14
CURLOPT_HTTPHEADER => array(
15
'apikey: <apikey>',
16
'Authorization: Bearer <access token>',
17
),
18
));
19
​
20
$response = curl_exec($curl);
21
​
22
curl_close($curl);
23
echo $response;
Copied!

Error Responses

Status Code
Error Type
FIeld
Description
400
Validation Error
epin
This field is required.
This field may not be blank.
Only numeric characters are allowed.
Coupon is not found.

Generate Coupon

Get Wallet List

get
β€Ž
https://<domain>/<api prefix>/<version>/user/generate/epin/

Sample Code

Node
1
var request = require('request');
2
var options = {
3
'method': 'GET',
4
'url': 'https://<domain>/<api prefix>/<version>/user/generate/epin/',
5
'headers': {
6
'apikey': '<apikey>',
7
'Authorization': 'Bearer <access token>',
8
},
9
formData: {}
10
};
11
request(options, function (error, response) {
12
if (error) throw new Error(error);
13
console.log(response.body);
14
});
15
​
Copied!
PHP
1
<?php
2
​
3
$curl = curl_init();
4
​
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/user/generate/epin/',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'GET',
14
CURLOPT_HTTPHEADER => array(
15
'apikey: <apikey>',
16
'Authorization: Bearer <access token>',
17
),
18
));
19
​
20
$response = curl_exec($curl);
21
​
22
curl_close($curl);
23
echo $response;
Copied!

Error Responses

Status Code
Error Type
Description
401
Request Failed
Coupon facility is disabled, Please contact your administrator.

Create Coupon

post
β€Ž
https://<domain>/<api prefix>/<version>/user/generate/epin/

Sample Code

Node
1
var request = require('request');
2
var options = {
3
'method': 'POST',
4
'url': 'https://<domain>/<api prefix>/<version>/user/generate/epin/',
5
'headers': {
6
'apikey': '<apikey>',
7
'Authorization': 'Bearer <access token>',
8
},
9
formData: {
10
'wallet_type': '<wallet_key>',
11
'epin_amount': '<amount>',
12
'number_of_pins': '<number_of_coupon>',
13
'form_key': '<form_key>',
14
'token_checksum_field': '<token_checksum>',
15
'token_field': '<token>',
16
'transferable': '<True or False>',
17
'reusable': '<True or False>'
18
}
19
};
20
request(options, function (error, response) {
21
if (error) throw new Error(error);
22
console.log(response.body);
23
});
Copied!
PHP
1
<?php
2
​
3
$curl = curl_init();
4
​
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/user/generate/epin/',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'POST',
14
CURLOPT_POSTFIELDS => array('wallet_type' => '<wallet_key>','epin_amount' => '<amount>','number_of_pins' => '<number of coupon>','form_key' => '<form key>','token_checksum_field' => '<token_cheksum>','token_field' => '<token>','transferable' => '<True or False>','reusable' => '<True or False>'),
15
CURLOPT_HTTPHEADER => array(
16
'apikey: <apikey>',
17
'Authorization: Bearer <access token>'
18
),
19
));
20
​
21
$response = curl_exec($curl);
22
​
23
curl_close($curl);
24
echo $response;
Copied!

Error Responses

Status Code
Error Type
FIeld
Description
400
Validation Error
wallet_type
This field is required.
This field may not be blank.
You don't have sufficient balance to continue with this operation.
400
Validation Error
epin_amount
Invalid or empty Amount.
This field is required.
This field may not be blank.
Please enter an amount between <min> and <max>.
Only integers are allowed.
Ensure this field has no more than 7 characters.
400
Validation Error
number_of_pins
This field is required.
This field may not be blank.
This operation exceeds the maximum number of active Coupons.
Invalid number of Coupon.
Only numeric characters are allowed.
400
Validation Error
transferable
This field is required.
This field may not be blank.
Select True or False
400
Validation Error
reusable
This field is required.
This field may not be blank.
Select True or False
400
Validation Error
token_checksum_field
This field is required.
This field may not be blank.
400
Validation Error
token_field
This field is required.
This field may not be blank.
Token is not matching.
400
Validation Error
form_key
You have another form running, Please reload.
401
Request Failed
​
Coupon facility is disabled, Please contact your administrator.

Coupon History

get
β€Ž
https://<domain>/<api prefix>/<version>/user/epin/history/

Sample Code

Node
1
var request = require('request');
2
var options = {
3
'method': 'GET',
4
'url': 'https://<domain>/<api prefix>/<version>/user/epin/history/',
5
'headers': {
6
'apikey': '<apikey>',
7
'Authorization': 'Bearer <access token>',
8
},
9
formData: {}
10
};
11
request(options, function (error, response) {
12
if (error) throw new Error(error);
13
console.log(response.body);
14
});
15
​
Copied!
PHP
1
<?php
2
​
3
$curl = curl_init();
4
​
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/user/epin/history/',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'GET',
14
CURLOPT_POSTFIELDS => array(),
15
CURLOPT_HTTPHEADER => array(
16
'apikey: <apikey>',
17
'Authorization: Bearer <access token>',
18
),
19
));
20
​
21
$response = curl_exec($curl);
22
​
23
curl_close($curl);
24
echo $response;
Copied!
​
Last modified 2mo ago