cURL
curl --request POST \
--url https://api.invopop.com/apps/pdf/v1/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"logo_url": "<string>",
"logo_height": 123,
"locale": "<string>",
"date_format": "<string>",
"hide_promo": true,
"data": {}
}
'import requests
url = "https://api.invopop.com/apps/pdf/v1/preview"
payload = {
"logo_url": "<string>",
"logo_height": 123,
"locale": "<string>",
"date_format": "<string>",
"hide_promo": True,
"data": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
logo_url: '<string>',
logo_height: 123,
locale: '<string>',
date_format: '<string>',
hide_promo: true,
data: {}
})
};
fetch('https://api.invopop.com/apps/pdf/v1/preview', 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.invopop.com/apps/pdf/v1/preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'logo_url' => '<string>',
'logo_height' => 123,
'locale' => '<string>',
'date_format' => '<string>',
'hide_promo' => true,
'data' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.invopop.com/apps/pdf/v1/preview"
payload := strings.NewReader("{\n \"logo_url\": \"<string>\",\n \"logo_height\": 123,\n \"locale\": \"<string>\",\n \"date_format\": \"<string>\",\n \"hide_promo\": true,\n \"data\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.invopop.com/apps/pdf/v1/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"logo_url\": \"<string>\",\n \"logo_height\": 123,\n \"locale\": \"<string>\",\n \"date_format\": \"<string>\",\n \"hide_promo\": true,\n \"data\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.invopop.com/apps/pdf/v1/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"logo_url\": \"<string>\",\n \"logo_height\": 123,\n \"locale\": \"<string>\",\n \"date_format\": \"<string>\",\n \"hide_promo\": true,\n \"data\": {}\n}"
response = http.request(request)
puts response.read_body"<string>"PDF Generator
Generate a PDF preview
Generate a PDF preview of the provided GOBL document.
POST
/
apps
/
pdf
/
v1
/
preview
cURL
curl --request POST \
--url https://api.invopop.com/apps/pdf/v1/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"logo_url": "<string>",
"logo_height": 123,
"locale": "<string>",
"date_format": "<string>",
"hide_promo": true,
"data": {}
}
'import requests
url = "https://api.invopop.com/apps/pdf/v1/preview"
payload = {
"logo_url": "<string>",
"logo_height": 123,
"locale": "<string>",
"date_format": "<string>",
"hide_promo": True,
"data": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
logo_url: '<string>',
logo_height: 123,
locale: '<string>',
date_format: '<string>',
hide_promo: true,
data: {}
})
};
fetch('https://api.invopop.com/apps/pdf/v1/preview', 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.invopop.com/apps/pdf/v1/preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'logo_url' => '<string>',
'logo_height' => 123,
'locale' => '<string>',
'date_format' => '<string>',
'hide_promo' => true,
'data' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.invopop.com/apps/pdf/v1/preview"
payload := strings.NewReader("{\n \"logo_url\": \"<string>\",\n \"logo_height\": 123,\n \"locale\": \"<string>\",\n \"date_format\": \"<string>\",\n \"hide_promo\": true,\n \"data\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.invopop.com/apps/pdf/v1/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"logo_url\": \"<string>\",\n \"logo_height\": 123,\n \"locale\": \"<string>\",\n \"date_format\": \"<string>\",\n \"hide_promo\": true,\n \"data\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.invopop.com/apps/pdf/v1/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"logo_url\": \"<string>\",\n \"logo_height\": 123,\n \"locale\": \"<string>\",\n \"date_format\": \"<string>\",\n \"hide_promo\": true,\n \"data\": {}\n}"
response = http.request(request)
puts response.read_body"<string>"The PDF Preview API converts GOBL Envelopes into PDF documents, allowing you to preview and validate your invoices before submitting them to a workflow. To get started, make sure the PDF Generator app is enabled in your account.
Authorizations
Use the Bearer scheme with a valid JWT token to authenticate requests.
Example: Authorization: Bearer <token>
Body
application/json
URL of the logo to include in the PDF.
Height of the logo in pixels.
Locale to use for the PDF generation (e.g., "es").
Date format to use in the PDF (e.g., "%Y-%m-%d"). Keys: %Y = full year,
%m = month, %d = day.
Whether to hide the Invopop footer.
Layout to use for the PDF (e.g., "Letter").
Available options:
A4, Letter, DIN5008 The complete GOBL Envelope to convert.
Response
Successfully generated PDF preview.
The response is of type file.
Was this page helpful?
⌘I