Query a specific delivered document

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

Request

In the JSON API standard, there is the concept of sideposts. This allows us to choose what kind of data we want to retrieve. 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 these. In the following examples, we just expect we would query both right away.

Parameters

Name Value
tenant_id Add your tenant_id to every request URL.
document_id Add the id of the document you are looking for.

Headers

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

Response

In addition to the example response below, you’ll find details about the datastructure here:

Example Response Body

{
    "data": {
        "id": "767",
        "type": "documents",
        "attributes": {
            "created_at": "2020-04-08T06:21:19.650Z",
            "updated_at": "2020-04-24T07:21:28.998Z",

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

            // 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": [{
                "url": "https://extraction.api.parashift.io/...",
                "file_name": "preview-767-1.pdf",
                "mime_type": "application/jpeg"
            }],
            "thumbnail": {
                "url": "https://extraction.api.parashift.io/...",
                "file_name": "thumbnail-767.pdf",
                "mime_type": "application/jpeg"
            }
        },
        "relationships": {
            "accounting_document": {
                "data": {
                    "type": "accounting_document",
                    "id": "16724"
                }
            },
            "sender_address": {
                "data": {
                    "type": "sender_address",
                    "id": "6924"
                }
            },
            "receiver_address": {
                "data": {
                    "type": "receiver_address",
                    "id": "1865"
                }
            }
        }
    },
    "included": [
        {
          "id": "6924",
          "type": "sender_address",
          "attributes": {
              "created_at": "2020-04-08T06:21:19.650Z",
              "updated_at": "2020-04-08T06:21:19.650Z",
              
              "address_id": null,

              // 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
              "vat_id": null
          },
          "relationships": {
              "document": {
                  "meta": {
                      "included": false
                  }
              }
          }
        },
        {
            "id": "16724",
            "type": "accounting_document",
            "attributes": {
                "created_at": "2020-04-08T06:21:19.650Z",
                "updated_at": "2020-04-08T06:21:20.148Z",

                // invoice meta data
                "invoice_date": "2020-05-21",
                "delivery_date": "2020-05-01",
                "number": "12 34 56",
                "order_number": null,
                "invoice_number": null,
                "currency": "EUR",

                // amounts
                "amount_details": {
                    "gross_amount_total": "78.3",
                    "tax_amount_total": "4.32",
                    "net_amount_total": "74.0",
                    "partial_amounts": [
                        {
                            "tax_rate": "8",
                            "net_amount": "54",
                            "tax_amount": "4.32",
                            "gross_amount": "58.30"
                        },
                        {
                            "tax_rate": "0",
                            "net_amount": "20",
                            "tax_amount": "0",
                            "gross_amount": "20"
                        }
                    ]
                }

                // line items
                "items": [
                    {
                        "title": "DSL Internet Verbindung",
                        "amount_total": 270,
                        "tax_rate": null,
                        "article_number": null,
                        "unit": null,
                        "quantity": 0,
                        "discount_rate": null,
                        "amount_unit": null,
                        "order_number": null,
                        "delivery_note_number": null,
                        "delivery_date": null                  }
                ],

                // payment related information
                "payment_conditions": [
                    {
                        "date": "2020-05-21",
                        "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,
                "payment_method": null,
                "refence":null,
              
                // esr
                "esr": {
                    "amount_esr": "123.45",
                    "account_esr": "123456",
                    "reference_esr": "1234567890",
                    "codingline_esr": "12345001234567890123456"
                },
                "es": {
                    "es_amount": "123.45",
                    "es_account": "02-12342",
                    "es_iban": "NL05 INGB 3767 7444 49",
                    "es_purpose": "purpose",
                    "es_creditor": "XZY Bank",
                    "es_ultimate_creditor": "Ben Efficiary"
                },

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