curl --request POST \
--url https://api.invopop.com/silo/v1/gobl/convert/export \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {},
"attachments": [
{
"data": "aSDinaTvuI8gbWludGxpZnk=",
"name": "receipt.pdf",
"desc": "Payment receipt",
"id": "REC-1",
"mime": "application/pdf"
}
],
"formats": [
"ubl+peppol+bis-v3"
]
}
'import requests
url = "https://api.invopop.com/silo/v1/gobl/convert/export"
payload = {
"data": {},
"attachments": [
{
"data": "aSDinaTvuI8gbWludGxpZnk=",
"name": "receipt.pdf",
"desc": "Payment receipt",
"id": "REC-1",
"mime": "application/pdf"
}
],
"formats": ["ubl+peppol+bis-v3"]
}
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({
data: {},
attachments: [
{
data: 'aSDinaTvuI8gbWludGxpZnk=',
name: 'receipt.pdf',
desc: 'Payment receipt',
id: 'REC-1',
mime: 'application/pdf'
}
],
formats: ['ubl+peppol+bis-v3']
})
};
fetch('https://api.invopop.com/silo/v1/gobl/convert/export', 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/silo/v1/gobl/convert/export",
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([
'data' => [
],
'attachments' => [
[
'data' => 'aSDinaTvuI8gbWludGxpZnk=',
'name' => 'receipt.pdf',
'desc' => 'Payment receipt',
'id' => 'REC-1',
'mime' => 'application/pdf'
]
],
'formats' => [
'ubl+peppol+bis-v3'
]
]),
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/silo/v1/gobl/convert/export"
payload := strings.NewReader("{\n \"data\": {},\n \"attachments\": [\n {\n \"data\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"name\": \"receipt.pdf\",\n \"desc\": \"Payment receipt\",\n \"id\": \"REC-1\",\n \"mime\": \"application/pdf\"\n }\n ],\n \"formats\": [\n \"ubl+peppol+bis-v3\"\n ]\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/silo/v1/gobl/convert/export")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {},\n \"attachments\": [\n {\n \"data\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"name\": \"receipt.pdf\",\n \"desc\": \"Payment receipt\",\n \"id\": \"REC-1\",\n \"mime\": \"application/pdf\"\n }\n ],\n \"formats\": [\n \"ubl+peppol+bis-v3\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.invopop.com/silo/v1/gobl/convert/export")
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 \"data\": {},\n \"attachments\": [\n {\n \"data\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"name\": \"receipt.pdf\",\n \"desc\": \"Payment receipt\",\n \"id\": \"REC-1\",\n \"mime\": \"application/pdf\"\n }\n ],\n \"formats\": [\n \"ubl+peppol+bis-v3\"\n ]\n}"
response = http.request(request)
puts response.read_body"<string>"Export GOBL to a format
Convert a GOBL Envelope or Object into an external format without persisting anything. Send a JSON object with the GOBL document in “data”, as with the other GOBL operations, along with any attachments to embed, base64 encoded. JSON requests are limited to 8MB. Larger documents and attachments may be sent instead as a multipart form, which is streamed and accepted up to 100MB: its first part is named “data”, followed by one “attachment” file part per file. Each attachment part may set the standard “Content-ID” and “Content-Description” MIME headers to provide the ID that identifies it in the exported document, and its description; text that is not plain ASCII may use RFC 2047 encoded-words. Formats may be given in the query, or in a JSON request’s “formats”. The response is the converted document as a raw download, with the key of the format used in the “GOBL-Convert-Format” header.
curl --request POST \
--url https://api.invopop.com/silo/v1/gobl/convert/export \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {},
"attachments": [
{
"data": "aSDinaTvuI8gbWludGxpZnk=",
"name": "receipt.pdf",
"desc": "Payment receipt",
"id": "REC-1",
"mime": "application/pdf"
}
],
"formats": [
"ubl+peppol+bis-v3"
]
}
'import requests
url = "https://api.invopop.com/silo/v1/gobl/convert/export"
payload = {
"data": {},
"attachments": [
{
"data": "aSDinaTvuI8gbWludGxpZnk=",
"name": "receipt.pdf",
"desc": "Payment receipt",
"id": "REC-1",
"mime": "application/pdf"
}
],
"formats": ["ubl+peppol+bis-v3"]
}
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({
data: {},
attachments: [
{
data: 'aSDinaTvuI8gbWludGxpZnk=',
name: 'receipt.pdf',
desc: 'Payment receipt',
id: 'REC-1',
mime: 'application/pdf'
}
],
formats: ['ubl+peppol+bis-v3']
})
};
fetch('https://api.invopop.com/silo/v1/gobl/convert/export', 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/silo/v1/gobl/convert/export",
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([
'data' => [
],
'attachments' => [
[
'data' => 'aSDinaTvuI8gbWludGxpZnk=',
'name' => 'receipt.pdf',
'desc' => 'Payment receipt',
'id' => 'REC-1',
'mime' => 'application/pdf'
]
],
'formats' => [
'ubl+peppol+bis-v3'
]
]),
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/silo/v1/gobl/convert/export"
payload := strings.NewReader("{\n \"data\": {},\n \"attachments\": [\n {\n \"data\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"name\": \"receipt.pdf\",\n \"desc\": \"Payment receipt\",\n \"id\": \"REC-1\",\n \"mime\": \"application/pdf\"\n }\n ],\n \"formats\": [\n \"ubl+peppol+bis-v3\"\n ]\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/silo/v1/gobl/convert/export")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {},\n \"attachments\": [\n {\n \"data\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"name\": \"receipt.pdf\",\n \"desc\": \"Payment receipt\",\n \"id\": \"REC-1\",\n \"mime\": \"application/pdf\"\n }\n ],\n \"formats\": [\n \"ubl+peppol+bis-v3\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.invopop.com/silo/v1/gobl/convert/export")
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 \"data\": {},\n \"attachments\": [\n {\n \"data\": \"aSDinaTvuI8gbWludGxpZnk=\",\n \"name\": \"receipt.pdf\",\n \"desc\": \"Payment receipt\",\n \"id\": \"REC-1\",\n \"mime\": \"application/pdf\"\n }\n ],\n \"formats\": [\n \"ubl+peppol+bis-v3\"\n ]\n}"
response = http.request(request)
puts response.read_body"<string>"key from the conversion formats endpoint, filtered by direction=export. List several in order of preference and the first that accepts the document is used. The GOBL-Convert-Format response header names the format chosen. Use specific keys such as ubl+en16931-v2017 or ubl+peppol+bis-v3: generic keys such as ubl and cii are only used to recognise documents on import, and cannot be exported to.
To export an invoice that is already stored, use export an entry instead.
JSON requests
Send the document indata, as with the other GOBL endpoints. Formats go in formats, or in the format query parameter. Any attachments to embed, such as a PDF copy of the invoice, are included with their contents base64 encoded:
{
"formats": ["ubl+peppol+bis-v3"],
"data": {
"$schema": "https://gobl.org/draft-0/bill/invoice",
"...": "..."
},
"attachments": [
{
"id": "INV-1",
"name": "invoice.pdf",
"desc": "PDF copy of the invoice",
"mime": "application/pdf",
"data": "JVBERi0xLjcK..."
}
]
}
id is used as the document reference in the exported file, such as a UBL or CII additional document reference. The mime type is detected from the data when omitted.
JSON requests are limited to 8MB.
Multipart requests
For larger documents or attachments, send amultipart/form-data form instead, which is streamed and accepted up to 100MB. The first part must be named data and hold the GOBL JSON, followed by one attachment part per file. The format keys go in the format query parameter, escaping each + as %2B:
curl -X POST "https://api.invopop.com/silo/v1/gobl/convert/export?format=ubl%2Bpeppol%2Bbis-v3" \
-H "Authorization: Bearer $INVOPOP_TOKEN" \
-F "data=@invoice.json;type=application/json" \
-F "attachment=@invoice.pdf;type=application/pdf;headers=\"Content-ID: INV-1\";headers=\"Content-Description: PDF copy of the invoice\"" \
-o invoice.xml
Content-ID and Content-Description part headers, which are optional.Authorizations
Query Parameters
Key of the format to export to, as listed by /gobl/convert/formats. Repeat the parameter, or separate keys with commas, to offer several in order of preference: the first that accepts the document is used. Required unless given as formats in a JSON request.
["ubl+peppol+bis-v3"]
Body
Response
The exported document. Content type and disposition are set according to the format.
The response is of type file.
Was this page helpful?