POST
/
silo
/
v1
/
entries
curl --request POST \
  --url https://api.invopop.com/silo/v1/entries \
  --header 'Content-Type: application/json' \
  --data '{
  "allow_invalid": true,
  "content_type": "application/json",
  "correct": {
    "credit": true
  },
  "data": {},
  "folder": "<string>",
  "key": "invoice-101",
  "previous_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "sign": false
}'
{
  "attachments": [
    {
      "created_at": "2018-01-01T00:00:00.000Z",
      "desc": "Invoice for January 2021.",
      "entry_id": "347c5b04-cde2-11ed-afa1-0242ac120002",
      "hash": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6",
      "id": "<string>",
      "meta": {},
      "mime": "application/pdf",
      "name": "invoice.pdf",
      "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>",
      "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",
      "key": "service-id",
      "link_scope": "public",
      "link_url": "https://example.com/info",
      "ref": "<string>",
      "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"
}

New Documents

The fastest way to upload data to Invopop is by creating an entry with the data property containing the GOBL JSON of either a pre-built Envelope or a partial document like an Invoice or Party.

Use the key property in the request to ensure idempotency. If the same key is used in the same workspace in another silo entry, the request will be rejected with a 409 Conflict error code.

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%"
          }
        ]
      }
    ]
  }
}

Any data uploaded to the Invopop Silo will first be normalized, calculated, and then validated to check for any errors.

Invopop will attempt to automatically determine the folder in which to store the document based on the schema, but you can override this by including the 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 the previous_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)

Additionally, the 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.

Body

application/json
allow_invalid
boolean

When true, the envelope's contents are allowed to be invalid.

Example:

true

content_type
string

The content type of the data being uploaded.

Example:

"application/json"

correct
object

JSON object containing the GOBL correction option data.

Example:
{ "credit": true }
data
object

Data contents to upload which may either be a GOBL Envelope or Object. Any partial data will be calculated and validated automatically.

folder
string

In which folder the entry should be associated, leave empty to use the automatic rules.

key
string

Key used to identify the entry idempotently within a workspace.

Example:

"invoice-101"

previous_id
string

The UUID of the previous silo entry to copy.

sign
boolean

When true, the GOBL envelope will be signed automatically.

Example:

false

Response

200 - application/json
OK
attachments
object[]

List of attachments for this entry.

context
string

When entry provided within a related query, this is the context within the document.

Example:

"line.item"

created_at
string

The date and time the silo entry was created.

Example:

"2018-01-01T00:00:00.000Z"

data
object

JSON envelope contents when specifically requested.

digest
object
doc_schema
string

Schema URL for the envelope's payload.

Example:

"https://gobl.org/draft-0/bill/invoice"

draft
boolean

Deprecated. When true, indicates that the envelope is not signed.

Example:

true

env_schema
string

Schema URL for the envelope.

Example:

"https://gobl.org/draft-0/envelope"

faults
object[]

List of faults that occurred during the processing of the job associated with the last state.

folder
string

Key for the folder where the entry is located.

Example:

"sales"

id
string

UUID of the silo entry.

Example:

"347c5b04-cde2-11ed-afa1-0242ac120002"

invalid
boolean

When true, the envelope's contents are invalid and need to be reviewed.

Example:

true

key
string

Key used to identify the entry idempotently within a workspace.

Example:

"invoice-101"

meta
object[]

Additional meta fields associated with the entry.

signed
boolean

When true, the envelope has been signed and should not be modified.

Example:

true

snippet
object

JSON object containing a snippet of the document.

Example:
{ "title": "Sample Title" }
state
string

Current state of the silo entry if not a draft.

Example:

"sent"

tags
string[]

Copy of tags stored in the envelope header.

updated_at
string

The date and time the silo entry was last updated.

Example:

"2018-01-01T00:00:00.000Z"