Developer Documentation
Discover how easy it is to enhance your application with beautiful invoices

Create Invoice

curl -X POST "https://dev.invoicingapi.com/v1/invoice/createinvoice" \
    -H "ApiKey: __YOUR_API_KEY__" \
    -H "Content-Type: application/json" \
    -d '{
        "template": "business3",
          "color": "black",
          "documentType": "a4",
          "fontSize": 11,
          "invoiceNumber": "2024-44",
          "issueDate": "2024-01-11T09:18:54.092Z",
          "dueDate": "2024-05-11T09:18:54.092Z",
          "recipientAddress":{
              "name": "John Doe",
              "email": "johndoe@gmail.com",
              "addressLine1": "John Keneddy Str",
              "telephone": "(034)-543-43354"
          },
          "lineItems":[
              {
                  "description": "App consulting services",
                  "quantity": 1,
                  "unitPrice": 950
              }
          ],
          "currency": "usd",
          "notes": "Payment Information\nIBAN Number: 43249423423489234",
          "IsPaid": false
    }' \
    -o output.pdf
using InvoicingAPI.Nuget; // install the Nuget package by searching "InvoicingAPI"
                                                
var client = new InvoicingApiClient("__YOUR_API_KEY__");

// Replace with your actual invoice data. Check documentation below for more invoice parameters
var body = new CreateInvoiceBody
{
    Template = "business3",
    Color = "black",
    DocumentType = "letter",
    FontSize = 11,
    InvoiceNumber = "3345",
    IssueDate = DateTime.Now,
    DueDate = DateTime.Now,
    RecipientAddress = new Address
    {
        Name = "John Doe",
        Email = "johndoe@gmail.com",
        AddressLine1 = "John Keneddy Str",
        Telephone = "(034)-543-43354"
    },
    LineItems = new List
    {
        new LineItem
        {
            Description = "App consulting services", Quantity = 1, UnitPrice = 950
        }
    },
    Currency = "usd",
    Notes = "Payment Information\nIBAN Number: 43249423423489234",
    IsPaid = false
};

var result = await client.CreateInvoice(body);

if (result.InvoiceByteArray != null)
{
    File.WriteAllBytes($@"__PATH__\{result.FileName}", result.InvoiceByteArray);
}
import requests
import json

api_key = "__YOUR_API_KEY__"
api_url = "https://dev.invoicingapi.com/v1/invoice/createinvoice"

# Replace with your actual invoice data. Check documentation below for more invoice parameters
invoice_data = {
    "template": "business3",
    "color": "black",
    "documentType": "a4",
    "fontSize": 11,
    "invoiceNumber": "2024-44",
    "issueDate": "2024-01-11T09:18:54.092Z",
    "dueDate": "2024-05-11T09:18:54.092Z",
    "recipientAddress":{
        "name": "John Doe",
        "email": "johndoe@gmail.com",
        "addressLine1": "John Keneddy Str",
        "telephone": "(034)-543-43354"
    },
    "lineItems":[
        {
            "description": "App consulting services",
            "quantity": 1,
            "unitPrice": 950
        }
    ],
    "currency": "usd",
    "notes": "Payment Information\nIBAN Number: 43249423423489234",
    "isPaid": false
}

# Convert the invoice data to JSON format
invoice_json = json.dumps(invoice_data)

# Define the headers with the API key
headers = {
    "Content-Type": "application/json",
    "ApiKey": api_key,
}

# Make a POST request to the API
response = requests.post(api_url, data=invoice_json, headers=headers)

# Check if the request was successful (status code 200)
if response.status_code == 200:
    # Save it to a file
    with open("invoice.pdf", "wb") as pdf_file:
        pdf_file.write(response.content)
    print("Invoice PDF received and saved as 'invoice.pdf'")
else:
    print(f"API request failed with status code {response.status_code}")
    print(response.text)
$apiKey = '__YOUR_API_KEY__';
$apiUrl = 'https://dev.invoicingapi.com/v1/invoice/createinvoice';

// Replace with your actual invoice data. Check documentation below for more invoice parameters
$invoiceData = [
    "template" => "business3",
    "color" => "black",
    "documentType" => "a4",
    "fontSize" => 11,
    "invoiceNumber" => "2024-44",
    "issueDate" => "2024-01-11T09:18:54.092Z",
    "dueDate" => "2024-05-11T09:18:54.092Z",
    "recipientAddress" => array(
        "name" => "John Doe",
        "email" => "johndoe@gmail.com",
        "addressLine1" => "John Keneddy Str",
        "telephone" => "(034)-543-43354"
    ),
    "lineItems" => array(
        array(
            "description" => "App consulting services",
            "quantity" => 1,
            "unitPrice" => 950
        )
    ),
    "currency" => "usd",
    "notes" => "Payment Information\nIBAN Number: 43249423423489234",
    "isPaid" => false
];

// Convert the invoice data to JSON format
$invoiceJson = json_encode($invoiceData);

// Initialize cURL session
$ch = curl_init($apiUrl);

// Set cURL options
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $invoiceJson);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/json',
    'ApiKey: ' . $apiKey,
]);

// Execute cURL session and capture the response
$response = curl_exec($ch);

// Check for cURL errors
if (curl_errno($ch)) {
    echo 'cURL Error: ' . curl_error($ch);
    exit;
}

// Get the HTTP status code
$httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);

// Close cURL session
curl_close($ch);

// Check if the request was successful (status code 200)
if ($httpStatus === 200) {
    // Save the PDF response to a file
    file_put_contents('invoice.pdf', $response);
    echo 'Invoice PDF received and saved as "invoice.pdf"';
} else {
    echo 'API request failed with status code ' . $httpStatus . PHP_EOL;
    echo 'Response: ' . $response . PHP_EOL;
}
package main

import (
    "bytes"
    "fmt"
    "io/ioutil"
    "net/http"
)

func main() {
    apiKey := "__YOUR_API_KEY__"
    apiUrl := "https://dev.invoicingapi.com/v1/invoice/createinvoice"

    // Replace with your actual invoice data. Check documentation below for more invoice parameters
    invoiceData := `{
        "template": "business3",
        "color": "black",
        "documentType": "letter",
        "fontSize": 11,
        "invoiceNumber": "2024-44",
        "issueDate": "2024-01-11T09:18:54.092Z",
        "dueDate": "2024-05-11T09:18:54.092Z",
        "recipientAddress":{
            "name": "John Doe",
            "email": "johndoe@gmail.com",
            "addressLine1": "John Keneddy Str",
            "telephone": "(034)-543-43354"
        },
        "lineItems":[
            {
                "description": "App consulting services",
                "quantity": 1,
                "unitPrice": 950
            }
        ],
        "currency": "usd",
        "notes": "Payment Information\nIBAN Number: 43249423423489234",
        "isPaid": false
    }`

    // Create a request body with the invoice data
    requestBody := bytes.NewBuffer([]byte(invoiceData))

    // Create an HTTP client
    client := &http.Client{}

    // Create an HTTP POST request
    req, err := http.NewRequest("POST", apiUrl, requestBody)
    if err != nil {
        fmt.Println("Error creating request:", err)
        return
    }

    // Set request headers
    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("ApiKey", apiKey)

    // Send the HTTP request
    resp, err := client.Do(req)
    if err != nil {
        fmt.Println("Error sending request:", err)
        return
    }
    defer resp.Body.Close()

    // Check if the request was successful (status code 200)
    if resp.StatusCode == http.StatusOK {
        // Read the response body (PDF content)
        pdfContent, err := ioutil.ReadAll(resp.Body)
        if err != nil {
            fmt.Println("Error reading response:", err)
            return
        }

        // Save the PDF content to a file
        err = ioutil.WriteFile("invoice.pdf", pdfContent, 0644)
        if err != nil {
            fmt.Println("Error saving PDF:", err)
            return
        }

        fmt.Println("Invoice PDF received and saved as 'invoice.pdf'")
    } else {
        fmt.Printf("API request failed with status code %d\n", resp.StatusCode)
        responseText, _ := ioutil.ReadAll(resp.Body)
        fmt.Println("Response:", string(responseText))
    }
}
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;

public class InvoicingAPI {
    public static void main(String[] args) {
        String apiKey = "__YOUR_API_KEY__";
        String apiUrl = "https://dev.invoicingapi.com/v1/invoice/createinvoice";

        // Replace with your actual invoice data in JSON format. Check documentation below for more invoice parameters 
        String invoiceData = "{\"template\": \"business3\", " +
                "\"color\": \"black\", " +
                "\"documentType\": \"letter\", " +
                "\"fontSize\": 11, " +
                "\"invoiceNumber\": \"2024-44\", " +
                "\"issueDate\": \"2024-01-11T09:18:54.092Z\", " +
                "\"dueDate\": \"2024-05-11T09:18:54.092Z\", " +
                "\"recipientAddress\": {\"name\": \"John Doe\", " +
                "\"email\": \"johndoe@gmail.com\", " +
                "\"addressLine1\": \"John Keneddy Str\", " +
                "\"telephone\": \"(034)-543-43354\"}, " +
                "\"lineItems\": [{\"description\": \"App consulting services\", " +
                "\"quantity\": 1, " +
                "\"unitPrice\": 950}], " +
                "\"currency\": \"usd\", " +
                "\"notes\": \"Payment Information\\nIBAN Number: 43249423423489234\", " +
                "\"isPaid\": \"false\"}";

        try {
            // Create a URL object for the API endpoint
            URL url = new URL(apiUrl);

            // Open a connection to the URL
            HttpURLConnection connection = (HttpURLConnection) url.openConnection();

            // Set the request method to POST
            connection.setRequestMethod("POST");

            // Set request headers
            connection.setRequestProperty("Content-Type", "application/json");
            connection.setRequestProperty("ApiKey", apiKey);

            // Enable input and output streams
            connection.setDoOutput(true);

            // Write the invoice data to the output stream
            try (OutputStream os = connection.getOutputStream()) {
                byte[] input = invoiceData.getBytes("utf-8");
                os.write(input, 0, input.length);
            }

            // Get the response code
            int responseCode = connection.getResponseCode();

            if (responseCode == HttpURLConnection.HTTP_OK) {
                // Read the response as an InputStream
                try (InputStream is = connection.getInputStream()) {
                    // Save the PDF response to a file
                    try (FileOutputStream fos = new FileOutputStream("invoice.pdf")) {
                        byte[] buffer = new byte[1024];
                        int bytesRead;
                        while ((bytesRead = is.read(buffer)) != -1) {
                            fos.write(buffer, 0, bytesRead);
                        }
                    }
                    System.out.println("Invoice PDF received and saved as 'invoice.pdf'");
                }
            } else {
                // Handle the error
                System.out.println("API request failed with status code " + responseCode);
                try (InputStream errorStream = connection.getErrorStream();
                     BufferedReader reader = new BufferedReader(new InputStreamReader(errorStream))) {
                    String line;
                    while ((line = reader.readLine()) != null) {
                        System.out.println(line);
                    }
                }
            }

            // Close the connection
            connection.disconnect();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

Request Headers

ApiKey

string

Your API key

Content-Type

string

The media type of the request. Required application/json

Request Body Parameters

template

string

Your chosen invoice template

Full list of available templates

color

string

The color to be used on the template. See which templates make use of this field here. Choose between black, brown, blue, green, and purple.

documentType

string

Page size of the invoice. Choose between a0, a1, a2, a3, a4, a5, b0, b1, b2, b3, b4, b5, letter, executive, or legal

fontSize

int

(optional)

Font size to be used for standard text (non-titles) on the invoice. Default font size is 10 if not included in request.

invoiceNumber

string

Number of invoice

issueDate

string

Issue date of invoice

dueDate

string

Due date of invoice

issuerAddress

dictionary

(optional)

The default address of the issuing party of the invoice. You can set this either on your account profile page or as a request parameter. If both are set, the request parameter takes priority. This provides a mechanism for overriding the default issuer address on a per-invoice basis.

"issuerAddress": {
    "name": "John Doe",
    "email": "johndoe@email.com",
    "country": "USA",
    "city": "Florida",
    "addressLine1": "Street address",
    "addressLine2": "Area",
    "telephone": "995-8443-32323",
    "website": "www.myorg.com",
    "vatno": "RF45ID3"
}

recipientAddress

dictionary

The address of the receiving party of the invoice

"recipientAddress": {
    "name": "Jane Doe",
    "email": "janedoe@email.com",
    "country": "Australia",
    "city": "Perth",
    "addressLine1": "Street address",
    "addressLine2": "Area",
    "telephone": "443-5645-54353",
    "website": "www.mysite.com",
    "vatno": "3PFD93T"
}

taxData

dictionary

(optional)

The default tax data to be applied to the invoice. You can set this either on your account profile page or as a request parameter. If both are set, the request parameter takes priority. This provides a mechanism for overriding the default tax data on a per-invoice basis.

"taxData": {
    "type": "Sales Tax",
    "percentage": 30,
    "displayInline": true,
    "unitPriceIncludesTax": false
}

  • Type (required) - Acceptable values are None, Sales Tax, GST, HST, or VAT. Use None if you do not want to charge or show any tax information on your invoice. Let us know if you would like to add other tax types to the list.
  • Percentage (optional) - The percent of tax to be used on the invoice. If not provided, default will be set to 0.
  • DisplayInline (optional) - Acceptable values are true or false. If set to true, two tax fields displaying the tax type and percent will be added to the invoice table with data displayed inline. If set to false (default value), they will not be shown in the tax table.
  • UnitPriceIncludesTax (optional) - Acceptable values are true or false. If set to true, this means your line item unit price already includes tax and therefore no extra calculation will be needed to determine the line item total. If set to false (default value), then a calculation will be done using the tax percent.

currency

string

Currency to be used on invoice (e.g. usd or eur). Use the country code in this field, and the corresponding symbol will be displayed on the invoice.

Currency Code Symbol Invoice Support Payment Link Support
Albania Lek ALL Lek tick tick
Afghanistan Afghani AFN Af tick tick
Argentina Peso ARS $ tick tick
Aruba Guilder AWG ƒ tick tick
Australia Dollar AUD $ tick tick
Azerbaijan Manat AZN tick tick
Bahamas Dollar BSD $ tick tick
Barbados Dollar BBD $ tick tick
Belarus Ruble BYN Br tick tick
Belize Dollar BZD BZ$ tick tick
Bermuda Dollar BMD $ tick tick
Bolivia Bolíviano BOB $b tick tick
Bosnia and Herzegovina Convertible Mark BAM KM tick tick
Botswana Pula BWP P tick tick
Bulgaria Lev BGN лв tick tick
Brazil Real BRL R$ tick tick
Brunei Darussalam Dollar BND $ tick tick
Cambodia Riel KHR tick tick
Canada Dollar CAD $ tick tick
Cayman Islands Dollar KYD $ tick tick
Chile Peso CLP $ tick tick
China Yuan Renminbi CNY ¥ tick tick
Colombia Peso COP $ tick tick
Costa Rica Colon CRC tick tick
Cuba Peso CUP tick cross
Czech Republic Koruna CZK tick tick
Denmark Krone DKK kr tick tick
Dominican Republic Peso DOP RD$ tick tick
East Caribbean Dollar XCD $ tick tick
Egypt Pound EGP £ tick tick
El Salvador Colon SVC $ tick cross
Euro Member Countries EUR tick tick
Falkland Islands (Malvinas) Pound FKP £ tick tick
Fiji Dollar FJD $ tick tick
Ghana Cedi GHS ¢ tick cross
Gibraltar Pound GIP £ tick tick
Guatemala Quetzal GTQ Q tick tick
Guernsey Pound GGP £ tick cross
Guyana Dollar GYD $ tick tick
Honduras Lempira HNL L tick tick
Hong Kong Dollar HKD $ tick tick
Hungary Forint HUF Ft tick tick
Iceland Krona ISK kr tick tick
India Rupee INR tick tick
Indonesia Rupiah IDR Rp tick tick
Iran Rial IRR tick cross
Isle of Man Pound IMP £ tick cross
Israel Shekel ILS tick tick
Jamaica Dollar JMD J$ tick tick
Japan Yen JPY ¥ tick tick
Jersey Pound JEP £ tick cross
Kazakhstan Tenge KZT лв tick tick
Korea (North) Won KPW tick cross
Korea (South) Won KRW tick tick
Kyrgyzstan Som KGS лв tick tick
Laos Kip LAK tick tick
Lebanon Pound LBP £ tick tick
Liberia Dollar LRD $ tick tick
Macedonia Denar MKD ден tick tick
Malaysia Ringgit MYR RM tick tick
Mauritius Rupee MUR tick tick
Mexico Peso MXN $ tick tick
Mongolia Tughrik MNT tick tick
Moroccan-dirham MAD د.م. tick tick
Mozambique Metical MZN MT tick tick
Namibia Dollar NAD $ tick tick
Nepal Rupee NPR tick tick
Netherlands Antilles Guilder ANG ƒ tick tick
New Zealand Dollar NZD $ tick tick
Nicaragua Cordoba NIO C$ tick tick
Nigeria Naira NGN tick tick
Norway Krone NOK kr tick tick
Oman Rial OMR tick cross
Pakistan Rupee PKR tick tick
Panama Balboa PAB B/. tick tick
Paraguay Guarani PYG Gs tick tick
Peru Sol PEN S/. tick tick
Philippines Peso PHP tick tick
Poland Zloty PLN tick tick
Qatar Riyal QAR tick tick
Romania Leu RON lei tick tick
Russia Ruble RUB tick tick
Saint Helena Pound SHP £ tick tick
Saudi Arabia Riyal SAR tick tick
Serbia Dinar RSD Дин. tick tick
Seychelles Rupee SCR tick tick
Singapore Dollar SGD $ tick tick
Solomon Islands Dollar SBD $ tick tick
Somalia Shilling SOS S tick tick
South Korean Won KRW tick tick
South Africa Rand ZAR R tick tick
Sri Lanka Rupee LKR tick tick
Sweden Krona SEK kr tick tick
Switzerland Franc CHF CHF tick tick
Suriname Dollar SRD $ tick tick
Syria Pound SYP £ tick cross
Taiwan New Dollar TWD NT$ tick tick
Thailand Baht THB ฿ tick tick
Trinidad and Tobago Dollar TTD TT$ tick tick
Turkey Lira TRY tick tick
Tuvalu Dollar TVD $ tick cross
Ukraine Hryvnia UAH tick tick
UAE-Dirham AED د.إ tick tick
United Kingdom Pound GBP £ tick tick
United States Dollar USD $ tick tick
Uruguay Peso UYU $U tick tick
Uzbekistan Som UZS лв tick tick
Venezuela Bolívar VEF Bs tick cross
Viet Nam Dong VND tick tick
Yemen Rial YER tick tick
Zimbabwe Dollar ZWD Z$ tick cross

lineItems

collection of dictionaries

The items to invoice. Total per line is calculated automatically.

"lineItems": [
    {
        "description": "item1",
        "quantity": 2,
        "unitPrice": 2.4,
        "unitTax" : 1
    },
    {
        "description": "item2",
        "quantity": 3,
        "unitPrice": 3,
        "unitTax": 1.5
    }
]

  • Description (required) - Your line item description.
  • Quantity (required) - The number of units of the line item.
  • UnitPrice (required) - The unit price of the line item. Can be inclusive or exclusive of tax (see taxData body parameter).
  • UnitTax (optional) - The value of tax applied to the line item. This field is optional as unit tax is calculated automatically using provided tax percentage (assuming you want to show tax on your invoice). Use this value if you would like to override the calculated amount.

subtotal

double

(optional)

The total amount for the line items before tax and discount. If filled, it will override the automatic calculation.

tax

double

(optional)

The tax amount to be applied to the subtotal. If filled, it will override the automatic calculation. It's recommended to use the automatic tax calculation, but you can override if you see something's not right with it.

discount

double

(optional)

The discount amount to be applied to invoice

total

double

(optional)

The total amount to be applied to invoice. If filled, will override the automatic calculation which adds the tax (if any) to the subtotal and subtracts any discount.

notes

string

(optional)

Additional notes or comments you would like to include on the invoice (e.g. IBAN, SWIFT numbers, etc). Use \n in this field to add a newline.

isPaid

bool

(optional)

Indicates whether the invoice is paid. Set this to false to display a payment link on the invoice. Requires a paid plan and onboarding with the payment processor.

Response Body Parameters

If the API returns a success code (200)

The API will return a response of content-type application/pdf that can be saved as file type PDF. See above examples for correct handling of response in your preferred language.


If the API returns a failure code (400-500)

The API will return a response of type JSON with some informative parameters.

statusCode

int

The status code. See Response Status Codes below for explanations of each code.

usage

double

The number of usage calls made for the current billing period

error

string

The error message

{
"statusCode": 429,
"usage": 10,
"error": "You have reached the monthly request limit for the Free plan. Upgrade to a paid plan to extend your monthly limit."
}

Response Status Codes

Code Message

200

Success.

400

Something is wrong with the request parameters.

401

Unauthorized request. Check your API key.

429

Too many requests or subscription request limit reached.

500

Something went wrong on our side and we've been notified.

Rate Limits

We enforce a rate limit of 10 API requests per minute. This can be increased on request. The free plan has a monthly limit which if reached, the API will return a status 429 code. The standard plan has no limit. You can track your usage via the Invoices page.

Client Library Downloads

Nuget

Check out our Nuget package here.

Ready to get started with InvoicingAPI?

Get Your Free API Key
No credit card required