Swipez Docs
Search…
Customer management
Learn more about customer management APIs and their usage.

Guidelines

Below are some of the points you must be aware of while calling Swipez APIs:‌
  • All API 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.

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.

Quick Reference

URL
HTTP Verb
Functionality
POST
To create customers.
POST
To update created customer.
POST
To get customer details.
POST
To get customer list.
post
/api/v1/merchant/customer/save
Create customer

Sample code

CURL
PHP
1
2
curl --location --request POST '<BASE URL>/api/v1/merchant/customer/save' \
3
--header 'Content-Type: application/json' \
4
--data-raw '{
5
"access_key_id": "<GET ACCESS KEY ID FROM YOUR ACCOUNT>",
6
"secret_access_key": "<GET SECRET ACCESS KEY FROM YOUR ACCOUNT>",
7
"customer": [
8
{
9
"customer_code": "Cust-254",
10
"customer_name": "Rohit Sharma",
11
"email": "[email protected]",
12
"mobile": "9999999999",
13
"address": "Behala Manton Super Market, Room 43, Behala",
14
"city": "Kolkata",
15
"state": " West Bengal",
16
"zipcode": "700034",
17
"custom_fields": [
18
{
19
"id": "4839",
20
"name": "Customer GSTN",
21
"type": "gst",
22
"value": "33BRSPP2039T1ZU"
23
}
24
]
25
}
26
]
27
}'
Copied!
1
2
$curl = curl_init();
3
4
curl_setopt_array($curl, array(
5
CURLOPT_URL => '<BASE URL>/api/v1/merchant/customer/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
"access_key_id": "<GET ACCESS KEY ID FROM YOUR ACCOUNT>",
15
"secret_access_key": "<GET SECRET ACCESS KEY FROM YOUR ACCOUNT>",
16
"customer": [
17
{
18
"customer_code": "Cust-254",
19
"customer_name": "Rohit Sharma",
20
"email": "[email protected]",
21
"mobile": "9999999999",
22
"address": "Behala Manton Super Market, Room 43, Behala",
23
"city": "Kolkata",
24
"state": "West Bengal",
25
"zipcode": "700034",
26
"custom_fields": [
27
{
28
"id": "4839",
29
"name": "Customer GSTN",
30
"type": "gst",
31
"value": "33BRSPP2039T1ZU"
32
}
33
]
34
}
35
]
36
}',
37
CURLOPT_HTTPHEADER => array(
38
'Content-Type: application/json',
39
'Cookie: __cfduid=d4b581ca97b6435b558bd41f9610f82b51614605091; PHPSESSID=h0md9koeohb4t9tpseem501oua'
40
),
41
));
42
43
$response = curl_exec($curl);
44
45
curl_close($curl);
46
echo $response;
Copied!
post
/api/v1/merchant/customer/update
Update customer

Sample code

CURL
PHP
1
2
curl --location --request POST '<BASE URL>/api/v1/merchant/customer/update' \
3
--header 'Content-Type: application/json' \
4
--data-raw '{
5
"access_key_id": "<GET ACCESS KEY ID FROM YOUR ACCOUNT>",
6
"secret_access_key": "<GET SECRET ACCESS KEY FROM YOUR ACCOUNT>",
7
"customer": [
8
{
9
"customer_id": "125484",
10
"customer_code": "Cust-254",
11
"customer_name": "Rohit Sharma",
12
"email": "[email protected]",
13
"mobile": "9999999999",
14
"address": "Behala Manton Super Market, Room 43, Behala",
15
"city": "Kolkata",
16
"state": " West Bengal",
17
"zipcode": "700034",
18
"custom_fields": [
19
{
20
"id": "4839",
21
"name": "Customer GSTN",
22
"type": "gst",
23
"value": "33BRSPP2039T1ZU"
24
}
25
]
26
}
27
]
28
}'
Copied!
1
2
$curl = curl_init();
3
4
curl_setopt_array($curl, array(
5
CURLOPT_URL => '<BASE URL>/api/v1/merchant/customer/update',
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
"access_key_id": "<GET ACCESS KEY ID FROM YOUR ACCOUNT>",
15
"secret_access_key": "<GET SECRET ACCESS KEY FROM YOUR ACCOUNT>",
16
"customer": [
17
{
18
"customer_id": "125484",
19
"customer_code": "Cust-254",
20
"customer_name": "Rohit Sharma",
21
"email": "[email protected]",
22
"mobile": "9999999999",
23
"address": "Behala Manton Super Market, Room 43, Behala",
24
"city": "Kolkata",
25
"state": "West Bengal",
26
"zipcode": "700034",
27
"custom_fields": [
28
{
29
"id": "4839",
30
"name": "Customer GSTN",
31
"type": "gst",
32
"value": "33BRSPP2039T1ZU"
33
}
34
]
35
}
36
]
37
}',
38
CURLOPT_HTTPHEADER => array(
39
'Content-Type: application/json',
40
'Cookie: __cfduid=d4b581ca97b6435b558bd41f9610f82b51614605091; PHPSESSID=h0md9koeohb4t9tpseem501oua'
41
),
42
));
43
44
$response = curl_exec($curl);
45
46
curl_close($curl);
47
echo $response;
Copied!
post
/api/v1/merchant/customer/getlist
Customer list

Sample code

CURL
PHP
1
curl --location --request POST '<BASE URL>/api/v1/merchant/customer/getlist' \
2
--header 'Content-Type: application/json' \
3
--data-raw '{
4
"access_key_id": "<GET ACCESS KEY ID FROM YOUR ACCOUNT>",
5
"secret_access_key": "<GET SECRET ACCESS KEY FROM YOUR ACCOUNT>",
6
"searchby": "state",
7
"keyword": "maharashtra"
8
}'
Copied!
1
2
$curl = curl_init();
3
4
curl_setopt_array($curl, array(
5
CURLOPT_URL => '<BASE URL>/api/v1/merchant/customer/getlist',
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
"access_key_id": "<GET ACCESS KEY ID FROM YOUR ACCOUNT>",
15
"secret_access_key": "<GET SECRET ACCESS KEY FROM YOUR ACCOUNT>",
16
"searchby": "state",
17
"keyword": "maharashtra"
18
}',
19
CURLOPT_HTTPHEADER => array(
20
'Content-Type: application/json'
21
),
22
));
23
24
$response = curl_exec($curl);
25
26
curl_close($curl);
27
echo $response;
Copied!
post
/api/v1/merchant/customer/detail
Customer detail

Sample code

CURL
PHP
1
curl --location --request POST '<BASE URL>/api/v1/merchant/customer/detail' \
2
--header 'Content-Type: application/json' \
3
--data-raw '{
4
"access_key_id": "<GET ACCESS KEY ID FROM YOUR ACCOUNT>",
5
"secret_access_key": "<GET SECRET ACCESS KEY FROM YOUR ACCOUNT>",
6
"customer_code": "cust-1"
7
"
8
}'
Copied!
1
2
$curl = curl_init();
3
4
curl_setopt_array($curl, array(
5
CURLOPT_URL => '<BASE URL>/api/v1/merchant/customer/detail',
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
"access_key_id": "<GET ACCESS KEY ID FROM YOUR ACCOUNT>",
15
"secret_access_key": "<GET SECRET ACCESS KEY FROM YOUR ACCOUNT>",
16
"customer_code": "cust-1"
17
}',
18
CURLOPT_HTTPHEADER => array(
19
'Content-Type: application/json'
20
),
21
));
22
23
$response = curl_exec($curl);
24
25
curl_close($curl);
26
echo $response;
Copied!
Last modified 6mo ago