Billing
Downloads the rendered PDF for an invoice.
The only endpoint whose success response is not a BaseResponse<T> envelope: a
200 is the PDF itself, application/pdf, as a file download named after the invoice’s
display number (e.g. INV-1042.pdf). Errors still use the envelope.
The document is rendered on demand from the invoice’s current data and template, so it reflects the invoice at request time rather than a stored copy. Each successful download is recorded against the invoice as an export event.
GET
/
v1
/
invoices
/
{invoiceId}
/
pdf
Downloads the rendered PDF for an invoice.
curl --request GET \
--url https://api.usw.gorelo.io/v1/invoices/{invoiceId}/pdf \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.usw.gorelo.io/v1/invoices/{invoiceId}/pdf"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.usw.gorelo.io/v1/invoices/{invoiceId}/pdf', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.usw.gorelo.io/v1/invoices/{invoiceId}/pdf",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.usw.gorelo.io/v1/invoices/{invoiceId}/pdf"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.usw.gorelo.io/v1/invoices/{invoiceId}/pdf")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usw.gorelo.io/v1/invoices/{invoiceId}/pdf")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body"<string>"{
"StatusCode": 100,
"IsSuccess": true,
"Data": null,
"DataContext": {
"TraceId": "<string>"
},
"Notifications": [
{
"Code": "070101",
"Message": "<string>",
"PropertyName": "<string>",
"ActionHint": "<string>",
"DocUrl": "<string>"
}
]
}{
"StatusCode": 100,
"IsSuccess": true,
"Data": null,
"DataContext": {
"TraceId": "<string>"
},
"Notifications": [
{
"Code": "070101",
"Message": "<string>",
"PropertyName": "<string>",
"ActionHint": "<string>",
"DocUrl": "<string>"
}
]
}{
"StatusCode": 100,
"IsSuccess": true,
"Data": null,
"DataContext": {
"TraceId": "<string>"
},
"Notifications": [
{
"Code": "070101",
"Message": "<string>",
"PropertyName": "<string>",
"ActionHint": "<string>",
"DocUrl": "<string>"
}
]
}{
"StatusCode": 100,
"IsSuccess": true,
"Data": null,
"DataContext": {
"TraceId": "<string>"
},
"Notifications": [
{
"Code": "070101",
"Message": "<string>",
"PropertyName": "<string>",
"ActionHint": "<string>",
"DocUrl": "<string>"
}
]
}Authorizations
Your Gorelo API key. See Generate API key. If your data is hosted in Australia, click the base URL at the top of this page and select https://api.aue.gorelo.io.
Path Parameters
Invoice identifier.
Response
OK
The response is of type file.
Was this page helpful?
⌘I
Downloads the rendered PDF for an invoice.
curl --request GET \
--url https://api.usw.gorelo.io/v1/invoices/{invoiceId}/pdf \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.usw.gorelo.io/v1/invoices/{invoiceId}/pdf"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.usw.gorelo.io/v1/invoices/{invoiceId}/pdf', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.usw.gorelo.io/v1/invoices/{invoiceId}/pdf",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.usw.gorelo.io/v1/invoices/{invoiceId}/pdf"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.usw.gorelo.io/v1/invoices/{invoiceId}/pdf")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usw.gorelo.io/v1/invoices/{invoiceId}/pdf")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body"<string>"{
"StatusCode": 100,
"IsSuccess": true,
"Data": null,
"DataContext": {
"TraceId": "<string>"
},
"Notifications": [
{
"Code": "070101",
"Message": "<string>",
"PropertyName": "<string>",
"ActionHint": "<string>",
"DocUrl": "<string>"
}
]
}{
"StatusCode": 100,
"IsSuccess": true,
"Data": null,
"DataContext": {
"TraceId": "<string>"
},
"Notifications": [
{
"Code": "070101",
"Message": "<string>",
"PropertyName": "<string>",
"ActionHint": "<string>",
"DocUrl": "<string>"
}
]
}{
"StatusCode": 100,
"IsSuccess": true,
"Data": null,
"DataContext": {
"TraceId": "<string>"
},
"Notifications": [
{
"Code": "070101",
"Message": "<string>",
"PropertyName": "<string>",
"ActionHint": "<string>",
"DocUrl": "<string>"
}
]
}{
"StatusCode": 100,
"IsSuccess": true,
"Data": null,
"DataContext": {
"TraceId": "<string>"
},
"Notifications": [
{
"Code": "070101",
"Message": "<string>",
"PropertyName": "<string>",
"ActionHint": "<string>",
"DocUrl": "<string>"
}
]
}