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

Response

200 - application/json
OK

The response is of type object.