cURL
curl --request POST \
--url https://api.invopop.com/silo/v1/entries \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"allow_invalid": true,
"content_type": "application/json",
"correct": {
"type": "credit-note"
},
"data": {},
"folder": "<string>",
"key": "invoice-101",
"previous_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sign": false
}
'import requests
url = "https://api.invopop.com/silo/v1/entries"
payload = {
"allow_invalid": True,
"content_type": "application/json",
"correct": { "type": "credit-note" },
"data": {},
"folder": "<string>",
"key": "invoice-101",
"previous_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sign": False
}
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({
allow_invalid: true,
content_type: 'application/json',
correct: {type: 'credit-note'},
data: {},
folder: '<string>',
key: 'invoice-101',
previous_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
sign: false
})
};
fetch('https://api.invopop.com/silo/v1/entries', 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",
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([
'allow_invalid' => true,
'content_type' => 'application/json',
'correct' => [
'type' => 'credit-note'
],
'data' => [
],
'folder' => '<string>',
'key' => 'invoice-101',
'previous_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'sign' => false
]),
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/entries"
payload := strings.NewReader("{\n \"allow_invalid\": true,\n \"content_type\": \"application/json\",\n \"correct\": {\n \"type\": \"credit-note\"\n },\n \"data\": {},\n \"folder\": \"<string>\",\n \"key\": \"invoice-101\",\n \"previous_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"sign\": false\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/entries")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"allow_invalid\": true,\n \"content_type\": \"application/json\",\n \"correct\": {\n \"type\": \"credit-note\"\n },\n \"data\": {},\n \"folder\": \"<string>\",\n \"key\": \"invoice-101\",\n \"previous_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"sign\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.invopop.com/silo/v1/entries")
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 \"allow_invalid\": true,\n \"content_type\": \"application/json\",\n \"correct\": {\n \"type\": \"credit-note\"\n },\n \"data\": {},\n \"folder\": \"<string>\",\n \"key\": \"invoice-101\",\n \"previous_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"sign\": false\n}"
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
Create an entry without UUID
Create a new silo entry without an explicit UUID.
POST
/
silo
/
v1
/
entries
cURL
curl --request POST \
--url https://api.invopop.com/silo/v1/entries \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"allow_invalid": true,
"content_type": "application/json",
"correct": {
"type": "credit-note"
},
"data": {},
"folder": "<string>",
"key": "invoice-101",
"previous_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sign": false
}
'import requests
url = "https://api.invopop.com/silo/v1/entries"
payload = {
"allow_invalid": True,
"content_type": "application/json",
"correct": { "type": "credit-note" },
"data": {},
"folder": "<string>",
"key": "invoice-101",
"previous_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sign": False
}
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({
allow_invalid: true,
content_type: 'application/json',
correct: {type: 'credit-note'},
data: {},
folder: '<string>',
key: 'invoice-101',
previous_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
sign: false
})
};
fetch('https://api.invopop.com/silo/v1/entries', 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",
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([
'allow_invalid' => true,
'content_type' => 'application/json',
'correct' => [
'type' => 'credit-note'
],
'data' => [
],
'folder' => '<string>',
'key' => 'invoice-101',
'previous_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'sign' => false
]),
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/entries"
payload := strings.NewReader("{\n \"allow_invalid\": true,\n \"content_type\": \"application/json\",\n \"correct\": {\n \"type\": \"credit-note\"\n },\n \"data\": {},\n \"folder\": \"<string>\",\n \"key\": \"invoice-101\",\n \"previous_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"sign\": false\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/entries")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"allow_invalid\": true,\n \"content_type\": \"application/json\",\n \"correct\": {\n \"type\": \"credit-note\"\n },\n \"data\": {},\n \"folder\": \"<string>\",\n \"key\": \"invoice-101\",\n \"previous_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"sign\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.invopop.com/silo/v1/entries")
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 \"allow_invalid\": true,\n \"content_type\": \"application/json\",\n \"correct\": {\n \"type\": \"credit-note\"\n },\n \"data\": {},\n \"folder\": \"<string>\",\n \"key\": \"invoice-101\",\n \"previous_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"sign\": false\n}"
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"
}
]
}New Documents
The fastest way to upload data to Invopop is by creating an entry with thedata property containing the GOBL JSON of either a pre-built Envelope or a partial document like an Invoice or Party.
Use the key property to ensure idempotency. If the same key is used in the same workspace in another silo entry, the request will be rejected with 409 Conflict. Note that idempotency using this method is intended for repeat requests whereby the system has had the opportunity to persist the first, we recommend using the put method in concurrent scenarios.
Invoice Payload Example
{
"key": "invoice-DEMO-001",
"data": {
"$schema": "https://gobl.org/draft-0/bill/invoice",
"series": "DEMO",
"code": "001",
"currency": "USD",
"supplier": {
"name": "Provide One Inc.",
"tax_id": {
"country": "US"
},
"addresses": [
{
"num": "16",
"street": "Jessie Street",
"locality": "San Francisco",
"region": "CA",
"code": "94105",
"country": "US"
}
],
"emails": [
{
"addr": "billing@provideone.com"
}
]
},
"customer": {
"name": "Sample Consumer",
"emails": [
{
"addr": "email@sample.com"
}
]
},
"lines": [
{
"quantity": "20",
"item": {
"name": "Development services",
"price": "90.00",
"unit": "h"
},
"discounts": [
{
"percent": "10%",
"reason": "Special discount"
}
],
"taxes": [
{
"cat": "ST",
"percent": "8.5%"
}
]
}
]
}
}
folder field in the request.
If there are any validation issues with the uploaded data, the service will respond with an error message including a key and message. Additionally, the fields property may include a nested structure to help identify the specific property with a validation fault.
Creating Entries from Previous Documents
You can create new entries based on a previous entry by using theprevious_id field. This allows you to provide patch data instead of a full new document by setting the patch type in the content_type field to one of the following:
application/json-patch+json- for JSON Patch (RFC 6902)application/merge-patch+json- for JSON Merge Patch (RFC 7396)
previous_id field can be used to create corrective documents by including corrective option data in the correct field. For more details, refer to the GOBL documentation on correction options.Authorizations
Body
application/json
Response
200 - application/json
OK
Was this page helpful?