Print invoice
/documents/invoices/{id}/pdfCosts 2 rate-limit points · Rate limits
Renders the invoice PDF (or reuses the stored one when nothing changed) and returns a signed download URL valid for one week, the file name and when it was generated. Records a download in the invoice history. To only get the link, read the invoice instead (pdf.url); use this for a fresh render or when no PDF is stored yet.
Rendering a new PDF counts against a free plan invoice limit; reusing a stored one does not. To only get the link, read GET /documents/invoices/:id first: pdf.url is the signed link whenever pdf.available is true. Call this when it is false or the merchant wants a fresh render.
Also searched asdownload invoice pdfget invoice pdfprint invoiceregenerate invoice pdfinvoice pdf linkrender invoice
Path parameters
idstringRequired
Request body
regeneratebooleantrue renders the PDF again even when the stored one is current (default false).
template_idintegerTemplate to render with. Default: the shop default for this document type.
Returns
idintegerExample:980191015urlstring, nullablefilenamestring, nullablegenerated_atstring, nullable
Errors
Missing or unknown X-Auth-Token, or the shop uninstalled the app.
v3_required: the shop still runs the previous dashboard. paid_plan_required: API access needs a paid plan.
The resource does not exist for this shop, or no action is registered at this path.
The request failed validation. Nothing was saved.
Rate limited: cost-weighted per key (reads cost less than writes). Wait Retry-After seconds; see X-RateLimit-* headers.
Every error has the same shape: see Errors.
curl -X POST "https://app.invoicefalcon.com/api/v3/external/documents/invoices/980191059/pdf" \
-H "X-Auth-Token: $INVOICE_FALCON_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'const res = await fetch("https://app.invoicefalcon.com/api/v3/external/documents/invoices/980191059/pdf", {
method: "POST",
headers: {
"X-Auth-Token": process.env.INVOICE_FALCON_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({}),
});
const data = await res.json();import os
import requests
res = requests.post(
"https://app.invoicefalcon.com/api/v3/external/documents/invoices/980191059/pdf",
headers={"X-Auth-Token": os.environ["INVOICE_FALCON_API_KEY"]},
json={},
)
data = res.json()require "net/http"
require "json"
uri = URI("https://app.invoicefalcon.com/api/v3/external/documents/invoices/980191059/pdf")
req = Net::HTTP::Post.new(uri, "X-Auth-Token" => ENV["INVOICE_FALCON_API_KEY"], "Content-Type" => "application/json")
req.body = {}.to_json
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)curl -X POST "https://app.invoicefalcon.com/api/v3/external/documents/invoices/980191059/pdf" \
-H "X-Auth-Token: $INVOICE_FALCON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"regenerate": true,
"template_id": 311
}'const res = await fetch("https://app.invoicefalcon.com/api/v3/external/documents/invoices/980191059/pdf", {
method: "POST",
headers: {
"X-Auth-Token": process.env.INVOICE_FALCON_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"regenerate": true,
"template_id": 311
}),
});
const data = await res.json();import os
import requests
res = requests.post(
"https://app.invoicefalcon.com/api/v3/external/documents/invoices/980191059/pdf",
headers={"X-Auth-Token": os.environ["INVOICE_FALCON_API_KEY"]},
json={
"regenerate": True,
"template_id": 311
},
)
data = res.json()require "net/http"
require "json"
uri = URI("https://app.invoicefalcon.com/api/v3/external/documents/invoices/980191059/pdf")
req = Net::HTTP::Post.new(uri, "X-Auth-Token" => ENV["INVOICE_FALCON_API_KEY"], "Content-Type" => "application/json")
req.body = {
regenerate: true,
template_id: 311
}.to_json
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body){
"id": 980191015,
"url": null,
"filename": null,
"generated_at": null
}{
"errors": [
"Invalid API key"
],
"code": "unauthorized"
}{
"errors": [
"API access requires a paid plan"
],
"code": "paid_plan_required"
}{
"errors": [
"Resource not found"
],
"code": "not_found"
}{
"errors": [
"id is missing"
]
}{
"errors": [
"Rate limit exceeded"
],
"code": "rate_limited"
}