Developer documentation
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. Use your sandbox key (starting with test_) while testing your integration
Content-Type
string
The media type of the request. Required application/json
Request Body Parameters
color
string
The color to be used on the template. Every template can use any of these colors: black, grey, blue, royal, teal, green, gold, orange, red, pink, purple, and brown.
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. Only populated fields will be displayed on the invoice.
Show
"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",
"gstin": "24AAACC1206D1ZM",
"gsthstno": "123456789 RT0001",
"piva": "IT12345678901",
"tva": "FR12345678901",
"abn": "12345678912"
}
recipientAddress
dictionary
The address of the receiving party of the invoice. Only populated fields will be displayed on the invoice.
Show
"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",
"gstin": "24AAACC1206D1ZM",
"gsthstno": "123456789 RT0001",
"piva": "IT12345678901",
"tva": "FR12345678901",
"abn": "12345678912"
}
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.
Show
"taxData": {
"type": "Sales Tax",
"percentage": 30,
"displayInline": true,
"unitPriceIncludesTax": false
}
- Type (required) - Acceptable values are
None,Sales Tax,GST,HST, orVAT. 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
trueorfalse. 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
trueorfalse. 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 | ![]() |
|
| Afghanistan Afghani | AFN | Af | ![]() |
|
| Argentina Peso | ARS | $ | ![]() |
|
| Aruba Guilder | AWG | ƒ | ![]() |
|
| Australia Dollar | AUD | $ | ![]() |
|
| Azerbaijan Manat | AZN | ₼ | ![]() |
|
| Bahamas Dollar | BSD | $ | ![]() |
|
| Barbados Dollar | BBD | $ | ![]() |
|
| Belarus Ruble | BYN | Br | ![]() |
|
| Belize Dollar | BZD | BZ$ | ![]() |
|
| Bermuda Dollar | BMD | $ | ![]() |
|
| Bolivia Bolíviano | BOB | $b | ![]() |
|
| Bosnia and Herzegovina Convertible Mark | BAM | KM | ![]() |
|
| Botswana Pula | BWP | P | ![]() |
|
| Bulgaria Lev | BGN | лв | ![]() |
|
| Brazil Real | BRL | R$ | ![]() |
|
| Brunei Darussalam Dollar | BND | $ | ![]() |
|
| Cambodia Riel | KHR | ៛ | ![]() |
|
| Canada Dollar | CAD | $ | ![]() |
|
| Cayman Islands Dollar | KYD | $ | ![]() |
|
| Chile Peso | CLP | $ | ![]() |
|
| China Yuan Renminbi | CNY | ¥ | ![]() |
|
| Colombia Peso | COP | $ | ![]() |
|
| Costa Rica Colon | CRC | ₡ | ![]() |
|
| Cuba Peso | CUP | ₱ | ![]() |
|
| Czech Republic Koruna | CZK | Kč | ![]() |
|
| Denmark Krone | DKK | kr | ![]() |
|
| Dominican Republic Peso | DOP | RD$ | ![]() |
|
| East Caribbean Dollar | XCD | $ | ![]() |
|
| Egypt Pound | EGP | £ | ![]() |
|
| El Salvador Colon | SVC | $ | ![]() |
|
| Euro Member Countries | EUR | € | ![]() |
|
| Falkland Islands (Malvinas) Pound | FKP | £ | ![]() |
|
| Fiji Dollar | FJD | $ | ![]() |
|
| Ghana Cedi | GHS | ¢ | ![]() |
|
| Gibraltar Pound | GIP | £ | ![]() |
|
| Guatemala Quetzal | GTQ | Q | ![]() |
|
| Guernsey Pound | GGP | £ | ![]() |
|
| Guyana Dollar | GYD | $ | ![]() |
|
| Honduras Lempira | HNL | L | ![]() |
|
| Hong Kong Dollar | HKD | $ | ![]() |
|
| Hungary Forint | HUF | Ft | ![]() |
|
| Iceland Krona | ISK | kr | ![]() |
|
| India Rupee | INR | ₹ | ![]() |
|
| Indonesia Rupiah | IDR | Rp | ![]() |
|
| Iran Rial | IRR | ﷼ | ![]() |
|
| Isle of Man Pound | IMP | £ | ![]() |
|
| Israel Shekel | ILS | ₪ | ![]() |
|
| Jamaica Dollar | JMD | J$ | ![]() |
|
| Japan Yen | JPY | ¥ | ![]() |
|
| Jersey Pound | JEP | £ | ![]() |
|
| Kazakhstan Tenge | KZT | лв | ![]() |
|
| Korea (North) Won | KPW | ₩ | ![]() |
|
| Korea (South) Won | KRW | ₩ | ![]() |
|
| Kyrgyzstan Som | KGS | лв | ![]() |
|
| Laos Kip | LAK | ₭ | ![]() |
|
| Lebanon Pound | LBP | £ | ![]() |
|
| Liberia Dollar | LRD | $ | ![]() |
|
| Macedonia Denar | MKD | ден | ![]() |
|
| Malaysia Ringgit | MYR | RM | ![]() |
|
| Mauritius Rupee | MUR | ₨ | ![]() |
|
| Mexico Peso | MXN | $ | ![]() |
|
| Mongolia Tughrik | MNT | ₮ | ![]() |
|
| Moroccan-dirham | MAD | د.م. | ![]() |
|
| Mozambique Metical | MZN | MT | ![]() |
|
| Namibia Dollar | NAD | $ | ![]() |
|
| Nepal Rupee | NPR | ₨ | ![]() |
|
| Netherlands Antilles Guilder | ANG | ƒ | ![]() |
|
| New Zealand Dollar | NZD | $ | ![]() |
|
| Nicaragua Cordoba | NIO | C$ | ![]() |
|
| Nigeria Naira | NGN | ₦ | ![]() |
|
| Norway Krone | NOK | kr | ![]() |
|
| Oman Rial | OMR | ﷼ | ![]() |
|
| Pakistan Rupee | PKR | ₨ | ![]() |
|
| Panama Balboa | PAB | B/. | ![]() |
|
| Paraguay Guarani | PYG | Gs | ![]() |
|
| Peru Sol | PEN | S/. | ![]() |
|
| Philippines Peso | PHP | ₱ | ![]() |
|
| Poland Zloty | PLN | zł | ![]() |
|
| Qatar Riyal | QAR | ﷼ | ![]() |
|
| Romania Leu | RON | lei | ![]() |
|
| Russia Ruble | RUB | ₽ | ![]() |
|
| Saint Helena Pound | SHP | £ | ![]() |
|
| Saudi Arabia Riyal | SAR | ﷼ | ![]() |
|
| Serbia Dinar | RSD | Дин. | ![]() |
|
| Seychelles Rupee | SCR | ₨ | ![]() |
|
| Singapore Dollar | SGD | $ | ![]() |
|
| Solomon Islands Dollar | SBD | $ | ![]() |
|
| Somalia Shilling | SOS | S | ![]() |
|
| South Korean Won | KRW | ₩ | ![]() |
|
| South Africa Rand | ZAR | R | ![]() |
|
| Sri Lanka Rupee | LKR | ₨ | ![]() |
|
| Sweden Krona | SEK | kr | ![]() |
|
| Switzerland Franc | CHF | CHF | ![]() |
|
| Suriname Dollar | SRD | $ | ![]() |
|
| Syria Pound | SYP | £ | ![]() |
|
| Taiwan New Dollar | TWD | NT$ | ![]() |
|
| Thailand Baht | THB | ฿ | ![]() |
|
| Trinidad and Tobago Dollar | TTD | TT$ | ![]() |
|
| Turkey Lira | TRY | ₺ | ![]() |
|
| Tuvalu Dollar | TVD | $ | ![]() |
|
| Ukraine Hryvnia | UAH | ₴ | ![]() |
|
| UAE-Dirham | AED | د.إ | ![]() |
|
| United Kingdom Pound | GBP | £ | ![]() |
|
| United States Dollar | USD | $ | ![]() |
|
| Uruguay Peso | UYU | $U | ![]() |
|
| Uzbekistan Som | UZS | лв | ![]() |
|
| Venezuela Bolívar | VEF | Bs | ![]() |
|
| Viet Nam Dong | VND | ₫ | ![]() |
|
| Yemen Rial | YER | ﷼ | ![]() |
|
| Zimbabwe Dollar | ZWD | Z$ | ![]() |
|
lineItems
collection of dictionaries
The items to invoice. Total per line is calculated automatically.
Show
"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 limit of 10 invoices on the Free plan. Buy a credit pack or subscribe to the Standard plan to create more invoices: https://invoicingapi.com/pricing"
}
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 includes 10 invoices a month and the Standard plan 2,000. Once they run out, each invoice uses one credit from a credit pack, and without credits the API returns a status 429 code. You can track your usage via the Invoices page.
Sandbox
Every account has a sandbox API key, which you can find on your Profile page. Sandbox keys start with test_ and work with the same endpoints as your live key, so you can build and test your integration without using up your monthly limit.
Sandbox invoices are watermarked with "SANDBOX - NOT A VALID INVOICE", are not saved to your account, do not count towards your monthly limit and never include a payment link. Responses to sandbox requests include the X-Sandbox: true header. You can create up to 200 sandbox invoices per day. When you are ready to go live, swap the sandbox key for your live key.
E-Invoices (XRechnung, ZUGFeRD and Factur-X)
Add an eInvoice object to a Create Invoice request to receive an EN 16931 compliant e-invoice instead of a normal PDF. Set eInvoice.format to one of:
xrechnung: an XRechnung 3.0 invoice (CII syntax) as an XML file. Required by German public sector buyers. See XRechnung e-invoices.zugferdorfactur-x: a PDF/A-3 invoice from your chosen template, with a ZUGFeRD 2.3 / Factur-X 1.07 XML file (EN 16931 profile) embedded asfactur-x.xml. Both values produce the same file. See ZUGFeRD and Factur-X e-invoices.
All amounts are calculated from the line items using the EN 16931 rounding rules, so leave out subTotal, tax and total or make sure they match. ZUGFeRD and Factur-X PDFs show the same amounts as the embedded XML. If anything required is missing, the API returns a 400 response listing every missing field.
All e-invoice formats need these fields, which are optional for PDF invoices:
issuerAddressandrecipientAddress:cityandcountryCode(ISO 3166-1 alpha-2, e.g.DE)issuerAddress.vatNo, unless the invoice is not subject to VAT- for invoices without VAT,
eInvoice.taxCategory(Zzero rated,Eexempt,AEreverse charge,Gexport,Onot subject to VAT) and, except forZ,eInvoice.taxExemptionReason. ZUGFeRD and Factur-X PDFs show the exemption reason above the notes.
XRechnung also needs:
issuerAddressandrecipientAddress:postalCodeissuerAddress:contactName,telephoneandemailrecipientAddress.email, oreInvoice.buyerLeitwegIdfor German public sector buyerseInvoice.buyerReference: the buyer's reference, such as their order number or Leitweg-IDeInvoice.payment.iban, with optionalbicandaccountName
Optional for all formats:
unitCode(UN/ECE Recommendation 20, e.g.C62pieces,HURhours,DAYdays) andtaxPercentageper line item. ZUGFeRD and Factur-X invoices currently need the same tax percentage on every line.eInvoice.paymentfor ZUGFeRD and Factur-X, which adds the bank details for a SEPA credit transfereInvoice.buyerReferenceandeInvoice.buyerLeitwegIdfor ZUGFeRD and Factur-XeInvoice.paymentTerms, free text such as "Payable within 30 days". The due date is always included.eInvoice.deliveryDate, the date the goods or services were delivered, which defaults to the issue date
"eInvoice": {
"format": "zugferd",
"buyerReference": "PO-4711",
"payment": {
"iban": "DE02120300000000202051",
"bic": "BYLADEM1001",
"accountName": "Muster Software GmbH"
},
"paymentTerms": "Payable within 30 days"
}
E-invoices count towards your monthly limit like PDF invoices, and work with your sandbox key for testing. Sandbox e-invoices contain the note "SANDBOX - NOT A VALID INVOICE". ZUGFeRD and Factur-X invoices can be downloaded again from your Invoices page with the XML embedded.
Client Library Downloads
Nuget
Check out our Nuget package here.
