cURL
curl --request POST \
--url https://api.invopop.com/silo/v1/entries/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/octet-stream' \
--data '<string>'import requests
url = "https://api.invopop.com/silo/v1/entries/import"
payload = "<string>"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/octet-stream"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/octet-stream'},
body: '<string>'
};
fetch('https://api.invopop.com/silo/v1/entries/import', 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/entries/import",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "<string>",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/octet-stream"
],
]);
$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/entries/import"
payload := strings.NewReader("<string>")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/octet-stream")
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/entries/import")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/octet-stream")
.body("<string>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.invopop.com/silo/v1/entries/import")
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/octet-stream'
request.body = "<string>"
response = http.request(request)
puts response.read_body{
"attachments": [
{
"category": "version",
"created_at": "2018-01-01T00:00:00.000Z",
"desc": "Invoice for January 2021.",
"embeddable": true,
"entry_id": "347c5b04-cde2-11ed-afa1-0242ac120002",
"hash": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6",
"id": "<string>",
"key": "pdf",
"meta": {},
"mime": "application/pdf",
"name": "invoice.pdf",
"previous": [
{
"created_at": "2018-01-01T00:00:00.000Z",
"hash": "<string>",
"id": "<string>",
"size": 123
}
],
"private": true,
"size": 12345,
"stored": true,
"url": "<string>"
}
],
"context": "line.item",
"created_at": "2018-01-01T00:00:00.000Z",
"data": {},
"digest": {
"alg": "<string>",
"val": "<string>"
},
"doc_schema": "https://gobl.org/draft-0/bill/invoice",
"draft": true,
"env_schema": "https://gobl.org/draft-0/envelope",
"faults": [
{
"code": "<string>",
"message": "<string>",
"paths": [
"<string>"
],
"provider": "pdf"
}
],
"folder": "sales",
"id": "347c5b04-cde2-11ed-afa1-0242ac120002",
"invalid": true,
"key": "invoice-101",
"meta": [
{
"created_at": "2018-01-01T00:00:00.000Z",
"entry_id": "347c5b04-cde2-11ed-afa1-0242ac120002",
"id": "347c5b04-cde2-11ed-afa1-0242ac120002:source:key",
"indexed": true,
"key": "service-id",
"link_scope": "public",
"link_url": "https://example.com/info",
"owned": true,
"owner_id": "<string>",
"ref": "<string>",
"secure": true,
"shared": true,
"src": "source",
"updated_at": "2018-01-01T00:00:00.000Z",
"value": {
"key": "value"
}
}
],
"signed": true,
"snippet": {
"title": "Sample Title"
},
"state": "sent",
"tags": [
"<string>"
],
"updated_at": "2018-01-01T00:00:00.000Z",
"version": "76f845c125",
"versions": [
{
"at": "2018-01-01T00:00:00.000Z",
"invalid": true,
"signed": true,
"src": "api",
"src_id": "<string>",
"version": "76f845c125"
}
]
}Entries
Import an entry
Create a new silo entry from a document in an external format, such as UBL or CII, sent as the raw request body; its format is detected automatically. An existing entry is never updated. The original document is kept as one of the entry’s files with the “format” category, and any files embedded in it with the “attachment” category. Requests up to 100MB are accepted.
POST
/
silo
/
v1
/
entries
/
import
cURL
curl --request POST \
--url https://api.invopop.com/silo/v1/entries/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/octet-stream' \
--data '<string>'import requests
url = "https://api.invopop.com/silo/v1/entries/import"
payload = "<string>"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/octet-stream"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/octet-stream'},
body: '<string>'
};
fetch('https://api.invopop.com/silo/v1/entries/import', 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/entries/import",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "<string>",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/octet-stream"
],
]);
$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/entries/import"
payload := strings.NewReader("<string>")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/octet-stream")
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/entries/import")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/octet-stream")
.body("<string>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.invopop.com/silo/v1/entries/import")
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/octet-stream'
request.body = "<string>"
response = http.request(request)
puts response.read_body{
"attachments": [
{
"category": "version",
"created_at": "2018-01-01T00:00:00.000Z",
"desc": "Invoice for January 2021.",
"embeddable": true,
"entry_id": "347c5b04-cde2-11ed-afa1-0242ac120002",
"hash": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6",
"id": "<string>",
"key": "pdf",
"meta": {},
"mime": "application/pdf",
"name": "invoice.pdf",
"previous": [
{
"created_at": "2018-01-01T00:00:00.000Z",
"hash": "<string>",
"id": "<string>",
"size": 123
}
],
"private": true,
"size": 12345,
"stored": true,
"url": "<string>"
}
],
"context": "line.item",
"created_at": "2018-01-01T00:00:00.000Z",
"data": {},
"digest": {
"alg": "<string>",
"val": "<string>"
},
"doc_schema": "https://gobl.org/draft-0/bill/invoice",
"draft": true,
"env_schema": "https://gobl.org/draft-0/envelope",
"faults": [
{
"code": "<string>",
"message": "<string>",
"paths": [
"<string>"
],
"provider": "pdf"
}
],
"folder": "sales",
"id": "347c5b04-cde2-11ed-afa1-0242ac120002",
"invalid": true,
"key": "invoice-101",
"meta": [
{
"created_at": "2018-01-01T00:00:00.000Z",
"entry_id": "347c5b04-cde2-11ed-afa1-0242ac120002",
"id": "347c5b04-cde2-11ed-afa1-0242ac120002:source:key",
"indexed": true,
"key": "service-id",
"link_scope": "public",
"link_url": "https://example.com/info",
"owned": true,
"owner_id": "<string>",
"ref": "<string>",
"secure": true,
"shared": true,
"src": "source",
"updated_at": "2018-01-01T00:00:00.000Z",
"value": {
"key": "value"
}
}
],
"signed": true,
"snippet": {
"title": "Sample Title"
},
"state": "sent",
"tags": [
"<string>"
],
"updated_at": "2018-01-01T00:00:00.000Z",
"version": "76f845c125",
"versions": [
{
"at": "2018-01-01T00:00:00.000Z",
"invalid": true,
"signed": true,
"src": "api",
"src_id": "<string>",
"version": "76f845c125"
}
]
}Create a new silo entry from a document in an external format, such as a UBL or CII invoice. Send the raw document as the request body; its format is detected automatically. An existing entry is never updated.
The original document is kept as one of the new entry’s files, with the
To convert a document without storing anything, use import a format to GOBL.
format category, and any files embedded in it, such as a PDF copy of the invoice, are kept with the attachment category. Set private to keep the files private and leave them unlinked from the GOBL document.
Options that would go in the body when creating an entry go in the query instead, as the body is the document. Use key to make imports idempotent: repeating an import with the same key returns the entry already created.
curl -X POST "https://api.invopop.com/silo/v1/entries/import?key=supplier-inv-101&name=invoice.xml" \
-H "Authorization: Bearer $INVOPOP_TOKEN" \
-H "Content-Type: application/xml" \
--data-binary @invoice.xml
Authorizations
Query Parameters
Body
application/octet-stream
Raw document to import.
The body is of type file.
Response
200 - application/json
OK
Was this page helpful?