Swipez Docs
Search…
Invoicing
Learn more about invoicing APIs and their usage.

Guidelines

Below are some of the points you must be aware of while calling Swipez 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.

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 invoice.
POST
To update created invoice.
POST
To settle invoice.
POST
To get invoice details.
POST
To get invoice list.
POST
To save recurring invoice.
post
/api/v3/merchant/invoice/save
Save invoice

Sample code

CURL
PHP
1
curl --location --request POST '<BASE URL>/api/v3/merchant/invoice/save' \
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
"template_id": "<GET TEMPLATE ID FROM YOUR ACCOUNT>",
7
"invoice": [
8
{
9
"customer_code": "Cust-1",
10
"bill_cycle_name": "Feb 21",
11
"bill_date": "2021-02-01",
12
"due_date": "2021-02-05",
13
"invoice_properties": {
14
"notify_patron": "1"
15
},
16
"custom_header_fields": [
17
{
18
"id": "1853191",
19
"name": "Invoice no",
20
"type": "text",
21
"value": "INV-5"
22
}
23
],
24
"particular_rows": [
25
{
26
"item": "Product name",
27
"sac_code": "9899",
28
"description": "Product description",
29
"gst": "18",
30
"total_amount": "1500.00"
31
}
32
],
33
"tax_rows": [
34
{
35
"name": "[email protected]%",
36
"percentage": "18.00",
37
"applicable_on": "1500.00"
38
}
39
],
40
"new_customer": {
41
"customer_code": "",
42
"customer_name": "",
43
"email": "",
44
"mobile": "",
45
"address": "",
46
"city": "",
47
"state": "",
48
"zipcode": "",
49
"custom_fields": [
50
{
51
"id": "845",
52
"name": "GST",
53
"type": "gst",
54
"value": ""
55
}
56
]
57
}
58
}
59
]
60
}'
61
Copied!
1
2
$curl = curl_init();
3
4
curl_setopt_array($curl, array(
5
CURLOPT_URL => '<BASE URL>/api/v3/merchant/invoice/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
"template_id": "<GET TEMPLATE ID FROM YOUR ACCOUNT>",
17
"invoice": [
18
{
19
"customer_code": "Cust-1",
20
"bill_cycle_name": "Feb 21",
21
"bill_date": "2021-02-01",
22
"due_date": "2021-02-05",
23
"invoice_properties": {
24
"notify_patron": "1"
25
},
26
"custom_header_fields": [
27
{
28
"id": "1853191",
29
"name": "Invoice no",
30
"type": "text",
31
"value": "INV-5"
32
}
33
],
34
"particular_rows": [
35
{
36
"item": "Product name",
37
"sac_code": "9899",
38
"description": "Product description",
39
"gst": "18",
40
"total_amount": "1500.00"
41
}
42
],
43
"tax_rows": [
44
{
45
"name": "[email protected]%",
46
"percentage": "18.00",
47
"applicable_on": "1500.00"
48
}
49
],
50
"new_customer": {
51
"customer_code": "",
52
"customer_name": "",
53
"email": "",
54
"mobile": "",
55
"address": "",
56
"city": "",
57
"state": "",
58
"zipcode": "",
59
"custom_fields": [
60
{
61
"id": "845",
62
"name": "GST",
63
"type": "gst",
64
"value": ""
65
}
66
]
67
}
68
}
69
]
70
}',
71
CURLOPT_HTTPHEADER => array(
72
'Content-Type: application/json'
73
),
74
));
75
76
$response = curl_exec($curl);
77
78
curl_close($curl);
79
echo $response;
Copied!
post
/api/v3/merchant/invoice/update
Update invoice

Sample code

CURL
PHP
1
curl --location --request POST '<BASE URL>/api/v3/merchant/invoice/update' \
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
"invoice_id": "<SYSTEM GENERATED INVOICE ID>",
7
"invoice":
8
{
9
"customer_code": "Cust-1",
10
"bill_cycle_name": "Feb 21",
11
"bill_date": "2021-02-01",
12
"due_date": "2021-02-05",
13
"invoice_properties": {
14
"notify_patron": "1"
15
},
16
"custom_header_fields": [
17
{
18
"id": "1853191",
19
"name": "Invoice no",
20
"type": "text",
21
"value": "INV-5"
22
}
23
],
24
"particular_rows": [
25
{
26
"item": "Product name",
27
"sac_code": "9899",
28
"description": "Product description",
29
"gst": "18",
30
"total_amount": "1500.00"
31
}
32
],
33
"tax_rows": [
34
{
35
"name": "[email protected]%",
36
"percentage": "18.00",
37
"applicable_on": "1500.00"
38
}
39
],
40
"new_customer": {
41
"customer_code": "",
42
"customer_name": "",
43
"email": "",
44
"mobile": "",
45
"address": "",
46
"city": "",
47
"state": "",
48
"zipcode": "",
49
"custom_fields": [
50
{
51
"id": "845",
52
"name": "GST",
53
"type": "gst",
54
"value": ""
55
}
56
]
57
}
58
}
59
}'
60
Copied!
1
2
$curl = curl_init();
3
4
curl_setopt_array($curl, array(
5
CURLOPT_URL => '<BASE URL>/api/v3/merchant/invoice/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
"invoice_id": "<SYSTEM GENERATED INVOICE ID>",
17
"invoice":
18
{
19
"customer_code": "Cust-1",
20
"bill_cycle_name": "Feb 21",
21
"bill_date": "2021-02-01",
22
"due_date": "2021-02-05",
23
"invoice_properties": {
24
"notify_patron": "1"
25
},
26
"custom_header_fields": [
27
{
28
"id": "1853191",
29
"name": "Invoice no",
30
"type": "text",
31
"value": "INV-5"
32
}
33
],
34
"particular_rows": [
35
{
36
"item": "Product name",
37
"sac_code": "9899",
38
"description": "Product description",
39
"gst": "18",
40
"total_amount": "1500.00"
41
}
42
],
43
"tax_rows": [
44
{
45
"name": "[email protected]%",
46
"percentage": "18.00",
47
"applicable_on": "1500.00"
48
}
49
],
50
"new_customer": {
51
"customer_code": "",
52
"customer_name": "",
53
"email": "",
54
"mobile": "",
55
"address": "",
56
"city": "",
57
"state": "",
58
"zipcode": "",
59
"custom_fields": [
60
{
61
"id": "845",
62
"name": "GST",
63
"type": "gst",
64
"value": ""
65
}
66
]
67
}
68
}
69
}',
70
CURLOPT_HTTPHEADER => array(
71
'Content-Type: application/json'
72
),
73
));
74
75
$response = curl_exec($curl);
76
77
curl_close($curl);
78
echo $response;
Copied!
post
/api/v2/merchant/invoice/settle
Settle invoice

Sample code

CURL
PHP
1
curl --location --request POST '<BASE URL>/api/v2/merchant/invoice/settle' \
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
"invoice_id": "<SYSTEM GENERATED INVOICE ID>",
7
"paid_date": "2021-03-01",
8
"amount": "500.00",
9
"mode": "Online",
10
"bank_name": "",
11
"bank_ref_no": "8749540",
12
"cheque_no": "",
13
"cash_paid_to": "",
14
"notify": "1"
15
}'
Copied!
1
2
$curl = curl_init();
3
4
curl_setopt_array($curl, array(
5
CURLOPT_URL => '<BASE URL>/api/v2/merchant/invoice/settle',
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
"invoice_id": "<SYSTEM GENERATED INVOICE ID>",
17
"paid_date": "2021-03-01",
18
"amount": "500.00",
19
"mode": "Online",
20
"bank_name": "",
21
"bank_ref_no": "8749540",
22
"cheque_no": "",
23
"cash_paid_to": "",
24
"notify": "0"
25
}',
26
CURLOPT_HTTPHEADER => array(
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/merchant/invoice/detail
Get invoice details

Sample code

CURL
PHP
1
curl --location --request POST '<BASE URL>/api/v1/merchant/invoice/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
"invoice_id": "<SYSTEM GENERATED INVOICE ID>"
7
}'
Copied!
1
$curl = curl_init();
2
3
curl_setopt_array($curl, array(
4
CURLOPT_URL => '<BASE URL>/api/v1/merchant/invoice/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
"access_key_id": "<GET ACCESS KEY ID FROM YOUR ACCOUNT>",
14
"secret_access_key": "<GET SECRET ACCESS KEY FROM YOUR ACCOUNT>",
15
"invoice_id": "<SYSTEM GENERATED INVOICE ID>"
16
}',
17
CURLOPT_HTTPHEADER => array(
18
'Content-Type: application/json'
19
),
20
));
21
22
$response = curl_exec($curl);
23
24
curl_close($curl);
25
echo $response;
Copied!
post
/api/v1/merchant/invoice/getlist
Invoice list

Sample code

CURL
PHP
1
curl --location --request POST '<BASE URL>/api/v1/merchant/invoice/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
"from_date": "2021-02-04",
7
"to_date": "2021-03-03",
8
"filter_by": "bill_date",
9
"invoice_status": "",
10
"customer_code": "",
11
"group": "",
12
"franchise_id": ""
13
}'
Copied!
1
2
$curl = curl_init();
3
4
curl_setopt_array($curl, array(
5
CURLOPT_URL => '<BASE URL>/api/v1/merchant/invoice/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
"from_date": "2021-02-04",
17
"to_date": "2021-03-03",
18
"filter_by": "bill_date",
19
"invoice_status": "",
20
"customer_code": "",
21
"group": "",
22
"franchise_id": ""
23
}',
24
CURLOPT_HTTPHEADER => array(
25
'Content-Type: application/json'
26
),
27
));
28
29
$response = curl_exec($curl);
30
31
curl_close($curl);
32
echo $response;
33
Copied!
post
/api/v1/merchant/subscription/save
Save subscription

Sample code

CURL
PHP
1
curl --location --request POST '<BASE URL>/api/v1/merchant/subscription/save' \
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
"template_id": "<GET TEMPLATE ID FROM YOUR ACCOUNT>",
7
"mode": "Monthly",
8
"repeat_every": "3",
9
"start_date": "2021-03-01",
10
"due_date": "2021-03-07",
11
"end_mode": "Never",
12
"occurences": "",
13
"end_date": "",
14
"carry_forword_dues": "0",
15
"invoice":
16
{
17
"customer_code": "Cust-1",
18
"bill_cycle_name": "Feb 21",
19
"bill_date": "2021-02-01",
20
"due_date": "2021-02-05",
21
"invoice_properties": {
22
"notify_patron": "1"
23
},
24
"custom_header_fields": [
25
{
26
"id": "1853191",
27
"name": "Invoice no",
28
"type": "text",
29
"value": "INV-5"
30
}
31
],
32
"particular_rows": [
33
{
34
"item": "Product name",
35
"sac_code": "9899",
36
"description": "Product description",
37
"gst": "18",
38
"total_amount": "1500.00"
39
}
40
],
41
"tax_rows": [
42
{
43
"name": "[email protected]%",
44
"percentage": "18.00",
45
"applicable_on": "1500.00"
46
}
47
],
48
"new_customer": {
49
"customer_code": "",
50
"customer_name": "",
51
"email": "",
52
"mobile": "",
53
"address": "",
54
"city": "",
55
"state": "",
56
"zipcode": "",
57
"custom_fields": [
58
{
59
"id": "845",
60
"name": "GST",
61
"type": "gst",
62
"value": ""
63
}
64
]
65
}
66
}
67
68
}'
Copied!
1
2
$curl = curl_init();
3
4
curl_setopt_array($curl, array(
5
CURLOPT_URL => '<BASE URL>/api/v1/merchant/subscription/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
"template_id": "<GET TEMPLATE ID FROM YOUR ACCOUNT>",
17
"mode": "Monthly",
18
"repeat_every": "3",
19
"start_date": "2021-03-01",
20
"due_date": "2021-03-07",
21
"end_mode": "Never",
22
"occurences": "",
23
"end_date": "",
24
"carry_forword_dues": "0",
25
"invoice":
26
{
27
"customer_code": "Cust-1",
28
"bill_cycle_name": "Feb 21",
29
"bill_date": "2021-02-01",
30
"due_date": "2021-02-05",
31
"invoice_properties": {
32
"notify_patron": "1"
33
},
34
"custom_header_fields": [
35
{
36
"id": "1853191",
37
"name": "Invoice no",
38
"type": "text",
39
"value": "INV-5"
40
}
41
],
42
"particular_rows": [
43
{
44
"item": "Product name",
45
"sac_code": "9899",
46
"description": "Product description",
47
"gst": "18",
48
"total_amount": "1500.00"
49
}
50
],
51
"tax_rows": [
52
{
53
"name": "[email protected]%",
54
"percentage": "18.00",
55
"applicable_on": "1500.00"
56
}
57
],
58
"new_customer": {
59
"customer_code": "",
60
"customer_name": "",
61
"email": "",
62
"mobile": "",
63
"address": "",
64
"city": "",
65
"state": "",
66
"zipcode": "",
67
"custom_fields": [
68
{
69
"id": "845",
70
"name": "GST",
71
"type": "gst",
72
"value": ""
73
}
74
]
75
}
76
}
77
}',
78
CURLOPT_HTTPHEADER => array(
79
'Content-Type: application/json'
80
),
81
));
82
83
$response = curl_exec($curl);
84
85
curl_close($curl);
86
echo $response;
Copied!
Last modified 3mo ago