1 creditInvoice PDF API — invoices straight from JSON
Send line items and parties as JSON; get back a finished, correctly-totalled PDF.
An invoice PDF API turns structured data — buyer, seller, line items, totals — into a finished PDF in a single HTTP request, with no template to open and no document to lay out. ASHDOCS does it at POST /api/v1/tools/invoice-pdf for one credit, and a free version runs in the browser without an account.
Free account. No card required.
How does the Invoice PDF API work?
One HTTP request from any language. Every ASHDOCS endpoint uses the same X-API-Key header.
curl -X POST https://www.ashdocs.com/api/v1/tools/invoice-pdf \
-H "X-API-Key: ash_live_..." \
-H "Content-Type: application/json" \
-d '{"invoice":{"number":"INV-2026-0041","currency":"USD","seller":{"name":"Acme Studio"},"buyer":{"name":"Globex Ltd"},"line_items":[{"description":"Design work","quantity":12,"unit_price":95,"tax_rate":0}]},"options":{"template":"clean","format":"A4"}}'import requests
r = requests.post(
"https://www.ashdocs.com/api/v1/tools/invoice-pdf",
headers={"X-API-Key": "ash_live_..."},
json={
"invoice": {
"number": "INV-2026-0041",
"currency": "USD",
"seller": {
"name": "Acme Studio"
},
"buyer": {
"name": "Globex Ltd"
},
"line_items": [
{
"description": "Design work",
"quantity": 12,
"unit_price": 95,
"tax_rate": 0
}
]
},
"options": {
"template": "clean",
"format": "A4"
}
},
)
job = r.json()
print(job["status"], job["output_files"][0]["url"])const res = await fetch("https://www.ashdocs.com/api/v1/tools/invoice-pdf", {
method: "POST",
headers: { "X-API-Key": "ash_live_...", "Content-Type": "application/json" },
body: JSON.stringify({"invoice":{"number":"INV-2026-0041","currency":"USD","seller":{"name":"Acme Studio"},"buyer":{"name":"Globex Ltd"},"line_items":[{"description":"Design work","quantity":12,"unit_price":95,"tax_rate":0}]},"options":{"template":"clean","format":"A4"}}),
});
const job = await res.json();
console.log(job.status, job.output_files[0].url);using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "ash_live_...");
var body = new StringContent(
"{\"invoice\":{\"number\":\"INV-2026-0041\",\"currency\":\"USD\",\"seller\":{\"name\":\"Acme Studio\"},\"buyer\":{\"name\":\"Globex Ltd\"},\"line_items\":[{\"description\":\"Design work\",\"quantity\":12,\"unit_price\":95,\"tax_rate\":0}]},\"options\":{\"template\":\"clean\",\"format\":\"A4\"}}",
Encoding.UTF8, "application/json");
var res = await client.PostAsync("https://www.ashdocs.com/api/v1/tools/invoice-pdf", body);
var job = await res.Content.ReadAsStringAsync();
Console.WriteLine(job);import java.io.ByteArrayOutputStream;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
public class Sample {
public static void main(String[] args) throws Exception {
String json = "{\"invoice\":{\"number\":\"INV-2026-0041\",\"currency\":\"USD\",\"seller\":{\"name\":\"Acme Studio\"},\"buyer\":{\"name\":\"Globex Ltd\"},\"line_items\":[{\"description\":\"Design work\",\"quantity\":12,\"unit_price\":95,\"tax_rate\":0}]},\"options\":{\"template\":\"clean\",\"format\":\"A4\"}}";
HttpRequest req = HttpRequest.newBuilder(URI.create("https://www.ashdocs.com/api/v1/tools/invoice-pdf"))
.header("X-API-Key", "ash_live_...")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<String> res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
}
}#include <stdio.h>
#include <curl/curl.h>
int main(void) {
CURL *curl = curl_easy_init();
if (!curl) return 1;
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "X-API-Key: ash_live_...");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "{\"invoice\":{\"number\":\"INV-2026-0041\",\"currency\":\"USD\",\"seller\":{\"name\":\"Acme Studio\"},\"buyer\":{\"name\":\"Globex Ltd\"},\"line_items\":[{\"description\":\"Design work\",\"quantity\":12,\"unit_price\":95,\"tax_rate\":0}]},\"options\":{\"template\":\"clean\",\"format\":\"A4\"}}");
curl_easy_setopt(curl, CURLOPT_URL, "https://www.ashdocs.com/api/v1/tools/invoice-pdf");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
CURLcode rc = curl_easy_perform(curl);
printf("\n");
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
return rc == CURLE_OK ? 0 : 1;
}Common use cases
- →Auto-invoice on Stripe payment or Shopify order
- →Monthly billing runs from a cron
- →Invoices from CRM or project-management triggers
Frequently asked questions
Does the invoice PDF API calculate sales tax for me?+
No. It applies the rate you supply and computes the totals from it. It does not determine which rate applies to your transaction.
How much does one invoice cost?+
One credit.
Who calculates the totals?+
The server does. The line total, the subtotal, the tax per rate and the grand total are all computed from the quantities, unit prices and tax rates you send — the client cannot override them, and a total supplied in the payload is ignored.