Invoice Generator API
"Customers don't measure you on how hard you tried. They measure you on what you deliver."
An invoice API (Application Programming Interface) is a set of programming instructions and standards that allow developers to interact with and create invoices within a software application. Invoice APIs can be used by businesses to automate their invoicing process, improve accuracy, and save time and effort.
With an invoice API, developers can integrate invoicing functionality directly into their applications, allowing users to create, manage, and send invoices seamlessly from within the software. An invoice API may include features such as creating and editing invoices, generating and sending invoices via email, tracking invoice status and payment information, and generating reports and analytics on invoicing data.
Invoice APIs can be useful for a variety of businesses, including freelancers, small businesses, and large enterprises. They can be used in a variety of industries, such as e-commerce, finance, and accounting.
Invoice API Features
- Create invoices: This API allow you to create invoices programmatically with all the necessary details, such as invoice number, client details, line items, and tax information.
- Customizable templates: This API allow you to customize the invoice templates, including the layout, design, and branding.
- Multicurrency support: This API support multiple currencies for international invoicing.
- Barcode attached: This API support barcode attachment on top of every invoice for billing tracking purpose for invoicing.
- Reporting: This API provide reporting functionality, including generating reports on invoices, payments, and other billing-related data.
Some common benefits of using an invoice API include increased efficiency and productivity, improved accuracy, reduced administrative workload, faster payment processing, and enhanced customer satisfaction. By automating the invoicing process, businesses can free up valuable time and resources that can be directed towards other important tasks.
Your API Authentication Key
We use API keys to authenticate all the requests. You can view and manage your API keys in the My Account -> My APIs Center page. Your API keys can be used to access our all the APIs, So be sure to keep them secure. Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.
XXXX-XXXX-XXXX-XXXX (login to see your free API Key)
API Endpoint
An API endpoint is a URL (Uniform Resource Locator) that is used to access a specific resource on a web server. API endpoints are the URLs that clients use to interact with a web API, and they typically consist of a base URL followed by a path that identifies a specific resource or action.
Endpoint URL for QR Code Generator
https://zerosack.org/marketplace/apis/v1/invoice
API Request Method POST
This API use POST HTTP method to get data from our server. All API requests must be made over HTTPS ("S" stands for secure). Calls made over plain HTTP or without authentication key will not allowed.
Request Parameters
An API endpoint is a URL (Uniform Resource Locator) that is used to access a specific resource on a web server. API endpoints are the URLs that clients use to interact with a web API, and they typically consist of a base URL followed by a path that identifies a specific resource or action.
Parameter | Description |
---|---|
key required |
This is your authentication api key to get requested data from our servers. This is mandatory parameter otherwise data request will be failed. Go to API Key. |
invoice_from required |
Name, Address, and contact details of a biller company or business (in json format). See format.
|
invoice_to required |
Name, Address, and contact details of a buyer person or business (in json format). See format.
|
invoice_number required |
Invoice identification number. QR code will be generated based on this number. Eg: IN0001234 .
|
invoice_date required |
Invoicing date as per your records. Eg: January 15, 2023 .
|
invoice_items required |
Product or service name, price, and quantity (Array of objects). See format.
|
amount_paid required |
Any priory amount paid by the buyer to biller. Possible values Eg: 0 or 1250 .
|
currency required |
Invoice currency code and currency symbol. Eg: INR | $ . See format.
|
tax_title required |
Tax title name. Eg: GST | VAT .
|
tax_percent required |
Tax percent value. Eg: 18 .
|
logo optional |
Company or biller logo URL. Only PNG or JPG image allowed. Eg: https://example.com/url-to-logo.png .
|
note optional |
Any note you want to write in to invoice. Eg: Thank you being awesome client .
|
terms optional |
Payment or invoice terms and conditions. Eg: Payment due in 30 days or Bank details for wire transfer .
|
watermark optional |
Any watermark in text format. Eg: ZNPL | Paid .
|
Example Post Data Request (in Json format)
{
"key": "XXXX-XXXX-XXXX-XXXX (login to see your free API Key)",
"invoice_from": {
"biller_name": "Zerosack Networks Pvt. Ltd.",
"biller_address": "304 Street Name, Landmark Road, \n City, Area Code, State, Country",
"biller_contact": "Mobile: +91-8888-8888-88 \n Email: xyz@gmail.com"
},
"invoice_to": {
"buyer_name": "John Doe",
"buyer_address": "304 Street Name, Landmark Road, \n City, Area Code, State, Country",
"buyer_contact": "Mobile: +91-8888-8888-88 \n Email: xyz@gmail.com"
},
"invoice_number": "IN0001234",
"invoice_date": "January 15, 2023",
"invoice_items": [
{
"item_no": "1",
"item_name": "product or service name-1 in which purpose this invoice created \n (order\/service ID #123)",
"item_qty": "2",
"item_unit_price": "150"
},
{
"item_no": "2",
"item_name": "product or service name-2 in which purpose this invoice created \n (order\/service ID #123)",
"item_qty": "1",
"item_unit_price": "450"
}
],
"amount_paid": "0",
"currency": {
"currency_code": "USD",
"currency_symbol": "$"
},
"tax_title": "GST",
"tax_percent": "18",
"logo": "https:\/\/example.com\/url-to-logo.png",
"note": "Thank you being awesome client",
"terms": "Payment due in 30 days",
"watermark": "ZNPL"
}
Response Format
API response format refers to the format in which data is returned from an API endpoint after a request is made. We use JSON format for API response data. JSON (JavaScript Object Notation): JSON is a lightweight data interchange format that is easy to read and write. It is widely used for API response data because it is easy to parse and manipulate in many programming languages.
Example Response
Sample invoice PDF file (if success)
Below response data in JSON format with base64 string data for invoice PDF file. You can convert this base64 string into PDF file and save it your server or download it directly into your project.
{
"status": 1,
"status_message": "success",
"body": {
"base64_string": "JVBERi0xLjQKJeLjz9MKMyAwIG9iago8PC9UeXBlIC9QYWdlCi9QYXJlbnQgMS ....."
}
}
In this response base64_string
invoice pdf file request response received successfully. In this case your APIs credit call/request count as 1,
Otherwise in fail condition or any other condition you will receive "status": 0
,
In this case API credit calls/request count as 0.
Sample Code
You can use our api with any programming language as well which can handle http GET requests. Here are some sample code snippets for making a GET request to an API endpoint in multiple programming languages:
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
var postData = JSON.stringify({
"key": "XXXX-XXXX-XXXX-XXXX (login to see your free API Key)",
...,
...
});
var requestOptions = {
method: "POST",
headers: myHeaders,
body: postData
};
fetch("https://zerosack.org/marketplace/apis/v1/invoice", requestOptions)
.then(response => response.json())
.then(result => console.log(result))
.catch(error => console.log("error", error));
$curl = curl_init();
$postData = json_encode(
[
"key" => "XXXX-XXXX-XXXX-XXXX (login to see your free API Key)",
...,
...
]
);
curl_setopt_array($curl, array(
CURLOPT_URL => "https://zerosack.org/marketplace/apis/v1/invoice",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => $postData,
CURLOPT_HTTPHEADER => array("Content-Type: application/json"),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
import json
url = "https://zerosack.org/marketplace/apis/v1/invoice"
payload = json.dumps({
"key": "XXXX-XXXX-XXXX-XXXX (login to see your free API Key)",
...,
...
})
headers = {"Content-Type": "application/json"}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://zerosack.org/marketplace/apis/v1/invoice");
request.Headers.Add("Cookie", "PHPSESSID=st6pbm0imcng6n3k8ju6pvg3j3");
var content = new StringContent("{\r\n \"key\": \"XXXX-XXXX-XXXX-XXXX (login to see your free API Key)\",\r\n ..., ...}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Also you can use Postman platform which enables you to create mock servers to assist with API development and testing. A mock server simulates the behavior of a real API server by accepting requests and returning responses. By adding a mock server to your collection and adding examples to your requests, you can simulate the behavior of a real API.
Do you Need Help? Contact us.
Disclaimers: This APIs is provided "as is" without warranty of any kind. If you have issue / feedback / bug report regarding the same, You can reach out to us.