Query delivered documents

GET /v1/[tenant_id]/documents?include=accounting_document,sender_address
The API responds with a collection of documents matching the criteria.

Request

In the JSON API standard, there is the concept of sideposts. This allows to choose what kind of data is retrieved. In our specific case the endpoint URL already includes accounting_document and sender_address as an example, so you get them right away. If you don’t need those, you can just remove it. In the following examples we expect to query both.

Parameters

Name Value
tenant_id Add your tenant_id to every request URL.
filter Add any filter parameters to match your needs.
page Add parameters to paginate your collection.

Headers

Name Value
Content-Type application/vnd.api+json
Authorization Bearer [Your API Token]

Response

In addition to the example response below, you can find details about the data structure here:

Example Response Body

{
    "data": [
        {
            "id": "767",
            "type": "documents",
            "attributes": {
                "created_at": "2018-05-08T06:21:19.650Z",
                "updated_at": "2018-09-24T07:21:28.998Z",

                // meta data, current status etc
                "current_status": "done",
                "extraction_process": "basic-extraction",
                "download_errors": null,
                "error_codes": [
                    "payment_credentials_unclear"
                ],
                "custom_fields": {
                    "customer_id": "1234"
                },
                "document_type": "receipt",

                // converted files
                "enhanced_pdf": [
                    {
                        "url": "https://extraction.api.parashift.io/...",
                        "file_name": "filename.pdf",
                        "mime_type": "application/pdf"
                    }
                ],
                "signed_pdf": {
                    "url": "https://extraction.api.parashift.io/...",
                    "file_name": "signed_filename.pdf",
                    "mime_type": "application/pdf"
                },
                "previews": [],
                "thumbnail": null
            },
            "relationships": {
                "accounting_document": {
                    "data": {
                        "type": "accounting_document",
                        "id": "16724"
                    }
                },
                "sender_address": {
                    "data": {
                        "type": "sender_address",
                        "id": "6924"
                    }
                }
                "receiver_address": {
                    "data": {
                        "type": "sender_address",
                        "id": "1235"
                    }
                }
            }
        },
        {
            "id": "768",
            "type": "documents",
            "attributes": {
                ...
            }
        }
    ],
    "included": [
        {
            "id": "6924",
            "type": "sender_address",
            "attributes": {
                "address_id": null,
                "type": "sender_address",

                // company address
                "company_name": "Tiefbauamt Stadt Thun",
                "contact_person_name": "",
                "street": "Industriestrasse ",
                "house_number": "2",
                "post_office_box": null,
                "postal_code": "3602",
                "city_name": "Thun",
                "country_code": "CH",

                // company and tax id for identification
                "company_id": null,
                "vat_id": null
            },
            "relationships": {
                "document": {
                    "meta": {
                        "included": false
                    }
                }
            }
        },
        {
            "id": "16724",
            "type": "accounting_document",
            "attributes": {
                "created_at": "2018-05-08T06:56:49.948Z",
                "updated_at": "2018-05-10T07:26:49.123Z",

                // document type
                "type": "receipts",

                // invoice meta data
                "invoice_date": "2018-02-21",
                "number": "12 34 56",
                "order_number": null,
                "currency": "EUR",
                "delivery_date": "2018-06-01",
                "including_tax": true,
                "additional_information": null,

                // line items
                "items": [
                    {
                        "title": "DSL Internet Verbindung",
                        "amount_total": 270,
                        "nominal_account": "491"
                    }
                ],

                // payment related information
                "payment_conditions": [
                    {
                        "date": "2018-03-07",
                        "type": "payment_condition",
                        "percentage": null,
                        "fixed_price": null,
                        "number_of_days": 14
                    }
                ],
                "bank_accounts": [
                    {
                        "bic": "BIC12345678",
                        "iban": "CH12 1234 1234 1234 1234"
                    }
                ],
                "discount_rate": null,
                "discount_total": null,
                "payment_method": null,
                "amount_total": 270,
                "reference": null,

                // ocr text
                "text": null,
            },
            "relationships": {
                "document": {
                    "meta": {
                        "included": false
                    }
                }
            }
        }
    ],
    "meta": {},
    "jsonapi": {
        "version": "1.0"
    }
}