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.

Quick Reference

URL

HTTP Verb

Functionality

/api/v3/merchant/invoice/save

POST

To create invoice.

/api/v3/merchant/invoice/update

POST

To update created invoice.

/api/v2/merchant/invoice/settle

POST

To settle invoice.

/api/v1/merchant/invoice/detail

POST

To get invoice details.

/api/v1/merchant/invoice/getlist

POST

To get invoice list.

/api/v1/merchant/subscription/save

POST

To save recurring invoice.

post
Save invoice

/api/v3/merchant/invoice/save
This endpoint allows you to save and send invoices to customers.
Request
Response
Request
Body Parameters
access_key_id
required
string
Your access key.
secret_access_key
required
string
Your secret key.
template_id
required
string
Invoice format encrypted key.
invoice
required
array
Data of multiple invoices.
customer_code
required
string
Customer unique number.
bill_cycle_name
required
string
Billing cycle name eg. Feb 21
bill_date
required
string
Bill date (in the format of YYYY-mm-dd)
due_date
required
string
Due date of invoice
notify_patron
required
number
Want to send invoice notification values 1 or 0
custom_header_fields
optional
array
If you added custom field in your invoice format you can set value for that column
particular_rows
required
array
Set values for particular rows as per your invoice format like item name, Description, cost.
tax_rows
optional
array
Add taxes to invoice eg. Tax name, percentage, applicable on
new_customer
optional
array
If customer does not exist in Swipez then you can add customer details
Response
200: OK
Invoice saved successfully.
{
"reqtime": "2021-03-01 18:59:41",
"resptime": "2021-03-01 18:59:41",
"srvrsp": [
{
"invoice_id": "R000029148",
"code": "12121",
"bill_date": "2021-03-01",
"patron_name": "Rohit Sharma",
"email_id": "[email protected]",
"mobile": "9999999999",
"amount": "590.00",
"short_url": "https://go.swipez.in/9vb786"
}
],
"errcode": 0,
"errmsg": "",
"errlist": null
}

Sample code

CURL
PHP
CURL
curl --location --request POST '<BASE URL>/api/v3/merchant/invoice/save' \
--header 'Content-Type: application/json' \
--data-raw '{
"access_key_id": "<GET ACCESS KEY ID FROM YOUR ACCOUNT>",
"secret_access_key": "<GET SECRET ACCESS KEY FROM YOUR ACCOUNT>",
"template_id": "<GET TEMPLATE ID FROM YOUR ACCOUNT>",
"invoice": [
{
"customer_code": "Cust-1",
"bill_cycle_name": "Feb 21",
"bill_date": "2021-02-01",
"due_date": "2021-02-05",
"invoice_properties": {
"notify_patron": "1"
},
"custom_header_fields": [
{
"id": "1853191",
"name": "Invoice no",
"type": "text",
"value": "INV-5"
}
],
"particular_rows": [
{
"item": "Product name",
"sac_code": "9899",
"description": "Product description",
"gst": "18",
"total_amount": "1500.00"
}
],
"tax_rows": [
{
"name": "[email protected]%",
"percentage": "18.00",
"applicable_on": "1500.00"
}
],
"new_customer": {
"customer_code": "",
"customer_name": "",
"email": "",
"mobile": "",
"address": "",
"city": "",
"state": "",
"zipcode": "",
"custom_fields": [
{
"id": "845",
"name": "GST",
"type": "gst",
"value": ""
}
]
}
}
]
}'
PHP
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '<BASE URL>/api/v3/merchant/invoice/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 =>'{
"access_key_id": "<GET ACCESS KEY ID FROM YOUR ACCOUNT>",
"secret_access_key": "<GET SECRET ACCESS KEY FROM YOUR ACCOUNT>",
"template_id": "<GET TEMPLATE ID FROM YOUR ACCOUNT>",
"invoice": [
{
"customer_code": "Cust-1",
"bill_cycle_name": "Feb 21",
"bill_date": "2021-02-01",
"due_date": "2021-02-05",
"invoice_properties": {
"notify_patron": "1"
},
"custom_header_fields": [
{
"id": "1853191",
"name": "Invoice no",
"type": "text",
"value": "INV-5"
}
],
"particular_rows": [
{
"item": "Product name",
"sac_code": "9899",
"description": "Product description",
"gst": "18",
"total_amount": "1500.00"
}
],
"tax_rows": [
{
"name": "[email protected]%",
"percentage": "18.00",
"applicable_on": "1500.00"
}
],
"new_customer": {
"customer_code": "",
"customer_name": "",
"email": "",
"mobile": "",
"address": "",
"city": "",
"state": "",
"zipcode": "",
"custom_fields": [
{
"id": "845",
"name": "GST",
"type": "gst",
"value": ""
}
]
}
}
]
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

post
Update invoice

/api/v3/merchant/invoice/update
This endpoint allows you to update created invoice.
Request
Response
Request
Body Parameters
access_key_id
required
string
Your access key.
secret_access_key
required
string
Your secret key.
invoice_id
required
string
System generated invoice id.
invoice
required
array
Invoice data.
customer_code
required
string
Customer unique number.
bill_cycle_name
required
string
Billing cycle name eg. Feb 21
bill_date
required
string
Bill date (in the format of YYYY-mm-dd)
due_date
required
string
Due date of invoice
notify_patron
required
number
Want to send invoice notification values 1 or 0
custom_header_fields
optional
array
If you added custom field in your invoice format you can set value for that column
particular_rows
required
array
Set values for particular rows as per your invoice format like item name, Description, cost.
tax_rows
optional
array
Add taxes to invoice eg. Tax name, percentage, applicable on
new_customer
optional
array
If customer does not exist in Swipez then you can add customer details
Response
200: OK
Invoice saved successfully.
{
"reqtime": "2021-03-01 18:59:41",
"resptime": "2021-03-01 18:59:41",
"srvrsp": [
{
"invoice_id": "R000029148",
"code": "12121",
"bill_date": "2021-03-01",
"patron_name": "Rohit Sharma",
"email_id": "[email protected]",
"mobile": "9999999999",
"amount": "590.00",
"short_url": "https://go.swipez.in/9vb786"
}
],
"errcode": 0,
"errmsg": "",
"errlist": null
}

Sample code

CURL
PHP
CURL
curl --location --request POST '<BASE URL>/api/v3/merchant/invoice/update' \
--header 'Content-Type: application/json' \
--data-raw '{
"access_key_id": "<GET ACCESS KEY ID FROM YOUR ACCOUNT>",
"secret_access_key": "<GET SECRET ACCESS KEY FROM YOUR ACCOUNT>",
"invoice_id": "<SYSTEM GENERATED INVOICE ID>",
"invoice":
{
"customer_code": "Cust-1",
"bill_cycle_name": "Feb 21",
"bill_date": "2021-02-01",
"due_date": "2021-02-05",
"invoice_properties": {
"notify_patron": "1"
},
"custom_header_fields": [
{
"id": "1853191",
"name": "Invoice no",
"type": "text",
"value": "INV-5"
}
],
"particular_rows": [
{
"item": "Product name",
"sac_code": "9899",
"description": "Product description",
"gst": "18",
"total_amount": "1500.00"
}
],
"tax_rows": [
{
"name": "[email protected]%",
"percentage": "18.00",
"applicable_on": "1500.00"
}
],
"new_customer": {
"customer_code": "",
"customer_name": "",
"email": "",
"mobile": "",
"address": "",
"city": "",
"state": "",
"zipcode": "",
"custom_fields": [
{
"id": "845",
"name": "GST",
"type": "gst",
"value": ""
}
]
}
}
}'
PHP
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '<BASE URL>/api/v3/merchant/invoice/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 =>'{
"access_key_id": "<GET ACCESS KEY ID FROM YOUR ACCOUNT>",
"secret_access_key": "<GET SECRET ACCESS KEY FROM YOUR ACCOUNT>",
"invoice_id": "<SYSTEM GENERATED INVOICE ID>",
"invoice":
{
"customer_code": "Cust-1",
"bill_cycle_name": "Feb 21",
"bill_date": "2021-02-01",
"due_date": "2021-02-05",
"invoice_properties": {
"notify_patron": "1"
},
"custom_header_fields": [
{
"id": "1853191",
"name": "Invoice no",
"type": "text",
"value": "INV-5"
}
],
"particular_rows": [
{
"item": "Product name",
"sac_code": "9899",
"description": "Product description",
"gst": "18",
"total_amount": "1500.00"
}
],
"tax_rows": [
{
"name": "[email protected]%",
"percentage": "18.00",
"applicable_on": "1500.00"
}
],
"new_customer": {
"customer_code": "",
"customer_name": "",
"email": "",
"mobile": "",
"address": "",
"city": "",
"state": "",
"zipcode": "",
"custom_fields": [
{
"id": "845",
"name": "GST",
"type": "gst",
"value": ""
}
]
}
}
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

post
Settle invoice

/api/v2/merchant/invoice/settle
This endpoint allows you to settle invoice with transaction details
Request
Response
Request
Body Parameters
access_key_id
required
string
Your access key.
secret_access_key
required
string
Your secret key.
invoice_id
required
string
System generated invoice id.
paid_date
required
string
Payment date (in the format YYYY-mm-dd)
amount
required
number
Settlement amount.
mode
required
string
Payment mode (NEFT,Cheque,Cash,Online)
bank_name
optional
string
Bank name of transaction.
bank_ref_no
optional
string
Bank reference number
cheque_no
optional
string
Cheque number if mode is Cheque
cash_paid_to
optional
string
Cash receiver name.
notify
optional
integer
Want to send receipt to customer (1 or 0)
Response
200: OK
Invoice settled successfully.
{
"reqtime": "2021-03-01 20:21:09",
"resptime": "2021-03-01 20:21:09",
"srvrsp": {
"invoice_id": "R000029148",
"code": "12121",
"transaction_id": "H000001297",
"paid_date": "2021-03-01",
"patron_name": "Rohit Sharma",
"email_id": "[email protected]",
"amount": "500.00"
},
"errcode": 0,
"errmsg": "",
"errlist": null
}

Sample code

CURL
PHP
CURL
curl --location --request POST '<BASE URL>/api/v2/merchant/invoice/settle' \
--header 'Content-Type: application/json' \
--data-raw '{
"access_key_id": "<GET ACCESS KEY ID FROM YOUR ACCOUNT>",
"secret_access_key": "<GET SECRET ACCESS KEY FROM YOUR ACCOUNT>",
"invoice_id": "<SYSTEM GENERATED INVOICE ID>",
"paid_date": "2021-03-01",
"amount": "500.00",
"mode": "Online",
"bank_name": "",
"bank_ref_no": "8749540",
"cheque_no": "",
"cash_paid_to": "",
"notify": "1"
}'
PHP
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '<BASE URL>/api/v2/merchant/invoice/settle',
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 =>'{
"access_key_id": "<GET ACCESS KEY ID FROM YOUR ACCOUNT>",
"secret_access_key": "<GET SECRET ACCESS KEY FROM YOUR ACCOUNT>",
"invoice_id": "<SYSTEM GENERATED INVOICE ID>",
"paid_date": "2021-03-01",
"amount": "500.00",
"mode": "Online",
"bank_name": "",
"bank_ref_no": "8749540",
"cheque_no": "",
"cash_paid_to": "",
"notify": "0"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

post
Get invoice details

/api/v1/merchant/invoice/detail
This endpoint allows you to get invoice details.
Request
Response
Request
Body Parameters
access_key_id
required
string
Your access key.
secret_access_key
required
string
Your secret key.
invoice_id
required
string
System generated invoice id.
Response
200: OK
{
"reqtime": "2021-03-02 09:40:48",
"resptime": "2021-03-02 09:40:49",
"srvrsp": {
"invoice_id": "R000029148",
"invoice_number": "INV-5",
"bill_date": "01 Mar 2021",
"due_date": "01 Mar 2021",
"cycle_name": "Test",
"customer_code": "12121",
"customer_name": "Rohit Sharma",
"email": "[email protected]",
"mobile": "9999999999",
"address": "26/2, Herms paras, near Joggers park,Kalyani nagar",
"city": "Delhi",
"zipcode": "490014",
"state": "Delhi",
"narrative": "",
"absolute_cost": "590.00",
"paid_amount": "0.00",
"advance": "0.00",
"previous_due": "0.00",
"late_fee": "0.00",
"franchise_id": "0",
"short_url": "https://shr.swipez.in/9vb987",
"invoice_status": "Paid offline",
"custom_column": [
{
"column_name": "Custom column 1",
"value": "Custom value"
}
],
"particular": [
{
"item": "Maintenance Charges",
"sac_code": "99998",
"description": "Test",
"total_amount": "500.00"
}
],
"tax": [
{
"tax_name": "[email protected]%",
"percentage": "9.00",
"applicable_on": "500.00",
"amount": "45.00",
"narrative": ""
},
{
"tax_name": "[email protected]%",
"percentage": "9.00",
"applicable_on": "500.00",
"amount": "45.00",
"narrative": ""
}
]
},
"errcode": null,
"errmsg": "",
"errlist": null
}

Sample code

CURL
PHP
CURL
curl --location --request POST '<BASE URL>/api/v1/merchant/invoice/detail' \
--header 'Content-Type: application/json' \
--data-raw '{
"access_key_id": "<GET ACCESS KEY ID FROM YOUR ACCOUNT>",
"secret_access_key": "<GET SECRET ACCESS KEY FROM YOUR ACCOUNT>",
"invoice_id": "<SYSTEM GENERATED INVOICE ID>"
}'
PHP
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '<BASE URL>/api/v1/merchant/invoice/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 =>'{
"access_key_id": "<GET ACCESS KEY ID FROM YOUR ACCOUNT>",
"secret_access_key": "<GET SECRET ACCESS KEY FROM YOUR ACCOUNT>",
"invoice_id": "<SYSTEM GENERATED INVOICE ID>"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

post
Invoice list

/api/v1/merchant/invoice/getlist
This endpoint allows you to get list of invoices.
Request
Response
Request
Body Parameters
access_key_id
required
string
Your access key.
secret_access_key
required
string
Your secret key.
from_date
required
string
From date (in the format YYYY-mm-dd) from which you want the data.
to_date
required
string
To Date till you want the data
filter_by
required
string
Filter by date type (bill_date,due_date,sent_date)
invoice_status
optional
string
Filter by invoice status (Submitted,Failed,Paid online,Paid offline)
customer_code
optional
string
Filter by customer code.
group
optional
string
Filter by customer group.
franchise_id
optional
string
Filter by franchise.
Response
200: OK
Invoices successfully retrieved.
{
"reqtime": "2021-03-02 10:09:15",
"resptime": "2021-03-02 10:09:15",
"total_records": 2,
"srvrsp": [
{
"invoice_id": "R000029148",
"invoice_number": null,
"bill_date": "2021-03-01",
"due_date": "2021-03-01",
"sent_date": "2021-03-01 18:59:41",
"customer_code": "12121",
"customer_name": "Rohit Sharma ",
"customer_group": "All,Cricket",
"email": "[email protected]",
"mobile": "9999999999",
"address": "26/2, Herms paras, near Joggers park,Kalyani nagar",
"city": "Mumbai",
"state": "Maharashtra",
"zipcode": "400214",
"amount": "590.00",
"paid_amount": "0.00",
"status": "Paid offline",
"cycle_name": "Test",
"franchise_id": "0",
"franchise_name": null,
"created_by": "Test company"
},
{
"invoice_id": "R000029147",
"invoice_number": "INV655",
"bill_date": "2021-02-15",
"due_date": "2021-02-15",
"sent_date": "2021-02-15 16:36:01",
"customer_code": "C000359",
"customer_name": "Virat Kohli",
"customer_group": "All",
"email": "[email protected]",
"mobile": "9999999998",
"address": "",
"city": "Delhi",
"state": "Delhi",
"zipcode": "400014",
"amount": "826.00",
"paid_amount": "0.00",
"status": "Paid offline",
"cycle_name": "Test Fee",
"franchise_id": "0",
"franchise_name": null,
"created_by": "Test company"
}
],
"errcode": null,
"errmsg": "",
"errlist": null
}

Sample code

CURL
PHP
CURL
curl --location --request POST '<BASE URL>/api/v1/merchant/invoice/getlist' \
--header 'Content-Type: application/json' \
--data-raw '{
"access_key_id": "<GET ACCESS KEY ID FROM YOUR ACCOUNT>",
"secret_access_key": "<GET SECRET ACCESS KEY FROM YOUR ACCOUNT>",
"from_date": "2021-02-04",
"to_date": "2021-03-03",
"filter_by": "bill_date",
"invoice_status": "",
"customer_code": "",
"group": "",
"franchise_id": ""
}'
PHP
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '<BASE URL>/api/v1/merchant/invoice/getlist',
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 =>'{
"access_key_id": "<GET ACCESS KEY ID FROM YOUR ACCOUNT>",
"secret_access_key": "<GET SECRET ACCESS KEY FROM YOUR ACCOUNT>",
"from_date": "2021-02-04",
"to_date": "2021-03-03",
"filter_by": "bill_date",
"invoice_status": "",
"customer_code": "",
"group": "",
"franchise_id": ""
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

post
Save subscription

/api/v1/merchant/subscription/save
This endpoint allows you to save recurring invoicing.
Request
Response
Request
Body Parameters
access_key_id
required
string
Your access key
secret_access_key
required
string
Your secret key.
template_id
required
string
Invoice format encrypted key.
mode
required
string
Recurring mode (Monthly, Daily, Weekly, Yearly)
repeat_every
required
number
Repeat every recurring mode eg. 3 Months
start_date
required
string
Start date of invoice creation
due_date
required
string
Due date of first invoice.
end_mode
required
string
Recurring stop mode Never: It will be infinite Occurences: After occurrence subscription will end End date: Set end date to stop subscription
occurences
optional
number
Set occurrence value if end mode is Occurrences
end_date
optional
string
Set end date if end mode is "End date"
carry_forword_dues
optional
string
If you want to carry forward due of unpaid invoices
invoice
optional
string
Invoice data.
customer_code
optional
string
Customer identifier.
bill_cycle_name
optional
string
Billing cycle name eg. Feb 21
bill_date
optional
string
Bill date (in the format of YYYY-mm-dd)
notify_patron
optional
number
Invoice notification to customer, 1 for enable
custom_header_fields
optional
string
If you added custom fields in your invoice format you can set value for that column.
particular_rows
optional
string
Set values for particular rows as per your invoice format like Item name, Description, Cost
tax_rows
optional
string
Add taxes to invoice.
new_customer
optional
string
If customer does not exist in Swipez then you can add customer details.
Response
200: OK

Sample code

CURL
PHP
CURL
curl --location --request POST '<BASE URL>/api/v1/merchant/subscription/save' \
--header 'Content-Type: application/json' \
--data-raw '{
"access_key_id": "<GET ACCESS KEY ID FROM YOUR ACCOUNT>",
"secret_access_key": "<GET SECRET ACCESS KEY FROM YOUR ACCOUNT>",
"template_id": "<GET TEMPLATE ID FROM YOUR ACCOUNT>",
"mode": "Monthly",
"repeat_every": "3",
"start_date": "2021-03-01",
"due_date": "2021-03-07",
"end_mode": "Never",
"occurences": "",
"end_date": "",
"carry_forword_dues": "0",
"invoice":
{
"customer_code": "Cust-1",
"bill_cycle_name": "Feb 21",
"bill_date": "2021-02-01",
"due_date": "2021-02-05",
"invoice_properties": {
"notify_patron": "1"
},
"custom_header_fields": [
{
"id": "1853191",
"name": "Invoice no",
"type": "text",
"value": "INV-5"
}
],
"particular_rows": [
{
"item": "Product name",
"sac_code": "9899",
"description": "Product description",
"gst": "18",
"total_amount": "1500.00"
}
],
"tax_rows": [
{
"name": "[email protected]%",
"percentage": "18.00",
"applicable_on": "1500.00"
}
],
"new_customer": {
"customer_code": "",
"customer_name": "",
"email": "",
"mobile": "",
"address": "",
"city": "",
"state": "",
"zipcode": "",
"custom_fields": [
{
"id": "845",
"name": "GST",
"type": "gst",
"value": ""
}
]
}
}
}'
PHP
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '<BASE URL>/api/v1/merchant/subscription/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 =>'{
"access_key_id": "<GET ACCESS KEY ID FROM YOUR ACCOUNT>",
"secret_access_key": "<GET SECRET ACCESS KEY FROM YOUR ACCOUNT>",
"template_id": "<GET TEMPLATE ID FROM YOUR ACCOUNT>",
"mode": "Monthly",
"repeat_every": "3",
"start_date": "2021-03-01",
"due_date": "2021-03-07",
"end_mode": "Never",
"occurences": "",
"end_date": "",
"carry_forword_dues": "0",
"invoice":
{
"customer_code": "Cust-1",
"bill_cycle_name": "Feb 21",
"bill_date": "2021-02-01",
"due_date": "2021-02-05",
"invoice_properties": {
"notify_patron": "1"
},
"custom_header_fields": [
{
"id": "1853191",
"name": "Invoice no",
"type": "text",
"value": "INV-5"
}
],
"particular_rows": [
{
"item": "Product name",
"sac_code": "9899",
"description": "Product description",
"gst": "18",
"total_amount": "1500.00"
}
],
"tax_rows": [
{
"name": "[email protected]%",
"percentage": "18.00",
"applicable_on": "1500.00"
}
],
"new_customer": {
"customer_code": "",
"customer_name": "",
"email": "",
"mobile": "",
"address": "",
"city": "",
"state": "",
"zipcode": "",
"custom_fields": [
{
"id": "845",
"name": "GST",
"type": "gst",
"value": ""
}
]
}
}
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;