Collect payables

Learn how to collect an incoming invoice to start the payable flow.

Overview

There are several ways to collect payables into Monite:

When a payable is created from a PDF, PNG, or JPEG file, Monite’s OCR service automatically extracts the invoice information from the file and a new payable is created with the extracted data fields accordingly. The file property of the payable contains the file metadata and the link to access the original source file.

About Monite OCR

Monite OCR uses top-notch Optical Character Recognition (OCR) algorithms to pull text from payables.

  • The OCR process is asynchronous and the processing time may vary according to the document size. The webhook ocr_finished is triggered once the OCR has finished processing the file and storing the extracted data into a payable.
  • The field payable.ocr_status reflects the current status of the OCR process of a payable. Its possible values are processing, error, and success.
  • The maximum image file size is 10 MB.
  • The maximum email size is 25 MB (including all attachments).
  • Files with dimensions smaller than 400x400 px are not considered payables, thus, they are not processed.
  • PDF files must have at least one page with dimensions bigger than 400x400 px to be considered a payable, otherwise, they are not processed.
  • Multipage PDF files can have up to 10 pages.
  • Monite’s OCR service is not executed if the format of the uploaded document is not supported or the number of pages exceeds 10. Therefore, no invoice information is stored. In this case, only the information about the file is stored.
  • You can configure the system to avoid the creation of duplicated payables based on the information obtained by the OCR.

Create a payable from data

If you already have the invoice data (amount in minor units, currency, vendor information, and other details) stored somewhere as individual attributes, you can create a payable with these attributes by calling POST /payables.

You can provide the base64-encoded contents of the original invoice file in the field base64_encoded_file:

1curl -X POST 'https://api.sandbox.monite.com/v1/payables' \
2 -H 'X-Monite-Version: 2024-05-25' \
3 -H 'X-Monite-Entity-Id: ENTITY_ID' \
4 -H 'Authorization: Bearer ACCESS_TOKEN' \
5 -d '{
6 "partner_metadata": {},
7 "currency": "EUR",
8 "description": "Restock office supplies",
9 "due_date": "2023-07-15",
10 "payment_terms": {
11 "name": "2/10, 1/20, net 30",
12 "term_1": {
13 "number_of_days": 10,
14 "discount": 200
15 },
16 "term_2": {
17 "number_of_days": 20,
18 "discount": 100
19 },
20 "term_final": {
21 "number_of_days": 30
22 }
23 },
24 "suggested_payment_term": {
25 "date": "2023-07-25",
26 "discount": 200
27 },
28 "issued_at": "2023-06-15",
29 "counterpart_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
30 "counterpart_bank_account_id": "ee415e8a-4368-4ef8-b192-d25b8e86ad0f",
31 "counterpart_address_id": "d0f2899d-e2b1-4b95-8411-2ed1a9063bce",
32 "counterpart_vat_id_id": "c0d3ca66-bdfa-4cdb-aceb-633d4dfe4f11",
33 "base64_encoded_file": "... Base64-encoded contents of the invoice file ...",
34 "file_name": "invoice.pdf",
35 "tag_ids": [
36 "ea837e28-509b-4b6a-a600-d54b6aa0b1f5"
37 ],
38 "document_id": "DE2287",
39 "sender": "hello@example.com"
40 }'

Notes:

  • The file_name field is optional. If omitted, it defaults to "default_file_name".
  • If the settings are configured to automatically set suggested_payment_term, this object can be omitted from the request body.
  • The fields subtotal and total_amount of the payable are automatically calculated based on the values of the line items, therefore, they are read-only and appear only in the response schema. This feature can be disabled in the partner’s settings by calling PATCH /settings passing the field enable_line_items as false (the default value is true). Once enable_line_items is disabled, the fields amount, subtotal, tax, and tax_amount of the payable object become editable during its creation and update, as they will no longer be calculated/re-calculated based on line items.

The successful response returns the id assigned to this payable, along with the information passed in the request. You can use this id in other API calls to update the data of this payable or trigger status transitions:

1{
2 "partner_metadata": {},
3 "id": "aa314fdd-a763-4920-a8c8-6285fc1745c0",
4 "entity_id": "en-your0000-enti-ty00-1D3799b65bcf",
5 "marked_as_paid_with_comment": null,
6 "marked_as_paid_by_entity_user_id": null,
7 "amount_due": 9900,
8 "amount_paid": 0,
9 "amount_to_pay": 9900,
10 "status": "new",
11 "source_of_payable_data": "user_specified",
12 "currency": "EUR",
13 "total_amount": 0,
14 "total_amount_with_credit_notes": 0,
15 "description": "Restock office supplies",
16 "due_date": "2023-07-15",
17 "payment_terms": {
18 "name": "2/10, 1/20, net 30",
19 "term_1": {
20 "number_of_days": 10,
21 "discount": 200
22 },
23 "term_2": {
24 "number_of_days": 20,
25 "discount": 100
26 },
27 "term_final": {
28 "number_of_days": 30
29 }
30 },
31 "suggested_payment_term": {
32 "date": "2023-07-25",
33 "discount": 200
34 },
35 "issued_at": "2022-06-15",
36 "counterpart_id": "8737964a-5246-47f4-8243-8728a2be1e75",
37 "counterpart_bank_account_id": "ee415e8a-4368-4ef8-b192-d25b8e86ad0f",
38 "counterpart_address_id": "d0f2899d-e2b1-4b95-8411-2ed1a9063bce",
39 "counterpart_vat_id_id": "c0d3ca66-bdfa-4cdb-aceb-633d4dfe4f11",
40 "counterpart_bank_id": null,
41 "counterpart_account_id": null,
42 "counterpart_name": "Acme Inc.",
43 "counterpart_address": {
44 "country": "DE",
45 "city": "Berlin",
46 "postal_code": "10115",
47 "state": "BE",
48 "line1": "Flughafenstrasse 52",
49 "line2": "Floor 2"
50 },
51 "payable_origin": "upload",
52 "created_by_role_id": "6ba5a3b8-82c6-4aaa-b010-03bc4128b342",
53 "credit_notes": [...]
54 "was_created_by_user_id": "e4e422fc-6956-4fdd-b091-920329f8b92e",
55 "currency_exchange": {
56 "default_currency_code": "EUR",
57 "rate": 10.0,
58 "total": 0
59 },
60 "file": {
61 "id": "2d14935e-505b-4863-a082-b6a340acabbc",
62 "created_at": "2022-04-05T06:31:31.431Z",
63 "file_type": "payables",
64 "name": "file name",
65 "region": "eu-central-1",
66 "md5": "623470039566983ed5e5945f769ea873",
67 "mimetype": "application/pdf",
68 "url": "https://monite-file-saver-payables-eu-central-1-dev.s3.amazonaws.com/2d14935e.../669bab57c57f.pdf",
69 "size": 49463,
70 "previews": [],
71 "pages": []
72 },
73 "tags": [
74 {
75 "name": "Marketing",
76 "id": "ea837e28-509b-4b6a-a600-d54b6aa0b1f5",
77 "created_at": "2022-09-07T16:35:18.484507+00:00",
78 "updated_at": "2022-09-07T16:35:18.484507+00:00",
79 "created_by_entity_user_id": "efe7eedd-89c5-56f5-984c-0712ee41a2eb"
80 }
81 ],
82 "created_at": "2022-06-17T06:31:31.431Z",
83 "updated_at": "2022-06-17T06:31:31.431Z",
84 "approval_policy_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
85 "document_id": "DE2287",
86 "subtotal": 0,
87 "tax": null,
88 "tax_amount": null,
89 "sender": "hello@example.com"
90}

Automatic calculation of due date

If the values of the fields payment_terms.final_term and issued_at are provided in the payable, the due_date will be automatically calculated based on issued_at plus the number of days defined by payment_terms.final_term.number_of_days.

For example, if issued_at equals to 2023-06-15 and payment_terms.term_final.number_of_days equals to 10, the due_date will be automatically set to 2023-06-25.

In any other case, the due_date supplied by the user is stored in the payable. The payment_terms and issued_at fields have priority in the calculation of the due_date, even if thedue_date is supplied by the user.

The automatic calculation of the due_date happens when the payable is parsed by the OCR, created with data, or updated.

Suggested payment date

Once the payable is created, Monite automatically fills the payable’s field suggested_payment_term with a suggestion for the payment date and corresponding discount, if available, based on its payment terms (represented by the field payment_terms). When the payable’s issued_at or payment_terms fields are updated, the value for the suggested_payment_term is recalculated.

It is possible to choose the payment term (term_1, term_2, or term_final) to be suggested as default by setting the field payment_priority in the entity’s settings to one of these values:

  • working_capital: Selects the term with the latest possible payment target.

  • bottom_line: Selects the term with the highest discount.

  • balanced: Selects the intermediate term, that is, a balance between duration and drawn discount.

The suggested_payment_term will be calculated based on the field issued_at added by the term_X.number_of_days. Note that this suggestion does not affect the invoice’s due date, which remains the same.

Change the payment priority

To update the payment_priority of in the entity’s settings, call PATCH /entities/{entity_id}/settings, passing the new payment_priority in the body:

1curl -X PATCH 'https://api.sandbox.monite.com/v1/entities/{entity_id}/settings' \
2 -H 'X-Monite-Version: 2024-05-25' \
3 -H 'X-Monite-Entity-Id: ENTITY_ID' \
4 -H 'Authorization: Bearer YOUR_PARTNER_TOKEN' \
5 -d '{
6 "payment_priority": "working_capital"
7 }'

Automatic recalculation with credit notes

When a related credit note transitions from the status approve_in_progress to approved, the associated payable undergoes automatic recalculation. This ensures that the payable reflects the updated amounts and maintains consistency across related records.

The amount_with_credit_notes of the payable is recalculated using the total_amount of the credit note. After the recalculation is complete, the status of the related credit note is updated to applied.

Attach file

You can attach an invoice file to an existing payable, in any status, by calling POST /payables/{payable_id}/attach_file:

1curl -X POST 'https://api.sandbox.monite.com/v1/payables/{payable_id}/attach_file' \
2 -H 'accept: application/json' \
3 -H 'X-Monite-Version: 2024-05-25' \
4 -H 'X-Monite-Entity-Id: ENTITY_ID' \
5 -H 'Authorization: Bearer ACCESS_TOKEN' \
6 -H 'Content-Type: multipart/form-data' \
7 -F 'file=@payable.png;type=image/png'

The provided file is then returned in the file field on the payable object.

1{
2 "partner_metadata": {},
3 "id": "aa314fdd-a763-4920-a8c8-6285fc1745c0",
4 "marked_as_paid_with_comment": null,
5 "marked_as_paid_by_entity_user_id": null,
6 "amount_due": 9900,
7 "amount_paid": 0,
8 "amount_to_pay": 9900,
9 "entity_id": "en-your0000-enti-ty00-1D3799b65bcf",
10 "status": "new",
11 "source_of_payable_data": "user_specified",
12 "currency": "EUR",
13 "total_amount": 0,
14 "description": "Restock office supplies",
15 "due_date": "2022-07-15",
16 "payable_origin": "upload",
17 "file": {
18 "id": "2d14935e-505b-4863-a082-b6a340acabbc",
19 "created_at": "2022-04-05T06:31:31.431Z",
20 "file_type": "payables",
21 "name": "payable",
22 "region": "eu-central-1",
23 "md5": "623470039566983ed5e5945f769ea873",
24 "mimetype": "image/png",
25 "url": "https://monite-file-saver-payables-eu-central-1-dev.s3.amazonaws.com/2d14935e.../payable.png",
26 "size": 49463,
27 "previews": [],
28 "pages": []
29 },
30 "tags": [
31 {
32 "name": "Marketing",
33 "id": "ea837e28-509b-4b6a-a600-d54b6aa0b1f5",
34 "created_at": "2022-09-07T16:35:18.484507+00:00",
35 "updated_at": "2022-09-07T16:35:18.484507+00:00",
36 "created_by_entity_user_id": "ea837e28-509b-4b6a-a600-d54b6aa0b1f5"
37 }
38 ],
39 "created_at": "2023-11-21T15:32:36.695Z",
40 "updated_at": "2023-11-21T15:32:36.695Z",
41 "other_extracted_data": {...},
42 ...
43}

Notes:

  • The uploaded file is stored only for reference purposes.
  • The file is not processed by the OCR or validated, therefore, the users need to ensure that the information in the file is correct.
  • If the payable already has a file attached, an error is returned when trying to attach another one.

Cancel duplicated payables automatically

You can configure the system to avoid the creation of duplicated payable based on the information obtained by the OCR.

To enable this feature, send a PATCH request to the /settings endpoint, setting the payable.allow_cancel_duplicates_automatically field to true:

1curl -X PATCH 'https://api.sandbox.monite.com/v1/settings' \
2 -H 'X-Monite-Version: 2024-05-25' \
3 -H 'X-Monite-Entity-Id: ENTITY_ID' \
4 -H 'Authorization: Bearer YOUR_PARTNER_TOKEN' \
5 -d '{
6 "payable": {
7 "allow_cancel_duplicates_automatically": true
8 }
9 }'

This way, once the counterpart is successfully auto-linked and the OCR identifies the invoice number inside the payable, the system verifies if there is any invoice with an identical counterpart ID (counterpart_id field) and invoice number (document_id field) for the given entity. If a payable with this information is found, i.e. the payable already exists, the system automatically sends the newly created payable to the canceled status.

To ensure the automatic cancellation of duplicated payables, it is imperative to have the auto-linking feature enabled.

Upload files via API

You can upload invoices in the PDF, PNG, or JPG format to Monite by calling POST /payables/upload_from_file. The maximum file size is 10 MB:

1curl -X POST 'https://api.sandbox.monite.com/v1/payables/upload_from_file' \
2 -H 'X-Monite-Version: 2024-05-25' \
3 -H 'X-Monite-Entity-Id: ENTITY_ID' \
4 -H 'Authorization: Bearer ACCESS_TOKEN' \
5 -H 'Content-Type: multipart/form-data' \
6 -F 'file=@pdf-invoice.pdf;type=application/pdf'

In return, you receive back the 201 Created response with id and other parameters:

1{
2 "partner_metadata": {},
3 "id": "61257ac9-ef71-4977-9e40-c9e027c7d539",
4 "entity_id": "9d2b4c8f-2087-4738-ba91-7359683c49a4",
5 "marked_as_paid_with_comment": null,
6 "marked_as_paid_by_entity_user_id": null,
7 "amount_due": 9900,
8 "amount_paid": 0,
9 "amount_to_pay": 9900,
10 "status": "draft",
11 "source_of_payable_data": "ocr",
12 "currency": "EUR",
13 "total_amount": 0,
14 "total_amount_with_credit_notes": 0,
15 "description": null,
16 "due_date": null,
17 "payment_terms": null,
18 "suggested_payment_term": null,
19 "issued_at": null,
20 "counterpart_bank_account_id": "ee415e8a-4368-4ef8-b192-d25b8e86ad0f",
21 "counterpart_address_id": "d0f2899d-e2b1-4b95-8411-2ed1a9063bce",
22 "counterpart_vat_id_id": "c0d3ca66-bdfa-4cdb-aceb-633d4dfe4f11",
23 "counterpart_bank_id": null,
24 "counterpart_id": null,
25 "counterpart_account_id": null,
26 "counterpart_name": null,
27 "counterpart_tax_id": null,
28 "counterpart_address": null,
29 "payable_origin": "upload",
30 "created_by_role_id": null,
31 "credit_notes": [...],
32 "was_created_by_user_id": null,
33 "currency_exchange": null,
34 "file": {
35 "id": "eac016c4-e06e-4cea-8ebf-3ec72dc8b49d",
36 "created_at": "2023-03-20T18:24:24.808836+00:00",
37 "file_type": "payables",
38 "name": "8d545f97-bcb3-4dfc-8ccf-1aa62d887781",
39 "region": "eu-central-1",
40 "md5": "89746feb534f35364e6760e2d834fe19",
41 "mimetype": "application/pdf",
42 "url": "https://monite-file-saver-payables-eu-central-1-dev.s3.amazonaws.com/2d14935e.../669bab57c57f.pdf",
43 "size": 18095,
44 "previews": [],
45 "pages": []
46 },
47 "tags": null,
48 "created_at": "2023-03-22T08:09:06.650657+00:00",
49 "updated_at": "2023-03-22T08:09:06.650669+00:00",
50 "other_extracted_data": {
51 "total": 9900,
52 "currency": "EUR",
53 "line_items": [
54 {
55 "unit": "item",
56 "quantity": 1.22,
57 "unit_price": 1200,
58 "description": "Services , Products & Goods",
59 "total_excl_vat": 1200,
60 "vat_percentage": 2000,
61 "line_item_ocr_id": "65379361795af74184f49608_3_c2e0d25bcef3edc8037218a553abcff2"
62 }
63 ],
64 "document_id": "FA - 000001",
65 "tax_payer_id": null,
66 "payment_terms": null,
67 "counterpart_name": "Mindspace Germany GmbH",
68 "document_due_date": "2022-01-22",
69 "counterpart_address": null,
70 "counterpart_account_id": null,
71 "document_issued_at_date": "2022-01-04",
72 "counterpart_address_object": {
73 "city": "Berlin",
74 "line1": "Witter . 30 , Haus F",
75 "line2": null,
76 "state": null,
77 "country": null,
78 "postal_code": "13509",
79 "original_country_name": null
80 }
81 },
82 "approval_policy_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
83 "document_id": null,
84 "subtotal": 0,
85 "tax": null,
86 "tax_amount": null,
87 "sender": null,
88 "ocr_request_id": "d31562e6-8e7d-4dbd-ba53-a8a62b6c2a62",
89 "ocr_status": "success"
90}

You will also receive a webhook indicating that this payable resource has been created:

1{
2 "id": "aa314fdd-a763-4920-a8c8-6285fc1745c0",
3 "created_at": "2024-03-04T20:06:48.593225+00:00",
4 "action": "payable.created_from_file_upload",
5 "api_version": "2024-05-25",
6 "entity_id": "en-your0000-enti-ty00-1D3799b65bcf",
7 "description": "Action has been performed on the invoice: created_from_file_upload.",
8 "object": {
9 "id": "aa314fdd-a763-4920-a8c8-6285fc1745c0"
10 },
11 "object_type": "payable",
12 "webhook_subscription_id": "c7f37127-44e5-494a-833a-21e60585f187"
13}

Note that at this stage the payable resource is incomplete and waiting for the results of the OCR service, which automatically scans the details from the uploaded invoice and maps the information from the invoice to the corresponding data field in the system.

When the OCR scanning is finished (this might take up to 5-7 minutes), you will receive the payable.ocr_finished webhook event:

1{
2 "id": "aa314fdd-a763-4920-a8c8-6285fc1745c0",
3 "created_at": "2024-03-04T20:09:32.593225+00:00",
4 "action": "payable.ocr_finished",
5 "api_version": "2024-05-25",
6 "entity_id": "en-your0000-enti-ty00-1D3799b65bcf",
7 "description": "Action has been performed on the invoice: ocr_finished.",
8 "object": {
9 "id": "aa314fdd-a763-4920-a8c8-6285fc1745c0"
10 },
11 "object_type": "payable",
12 "webhook_subscription_id": "c7f37127-44e5-494a-833a-21e60585f187"
13}

Now, you can call GET /payables/{payable_id} to retrieve the results of the OCR scanning:

1{
2 "partner_metadata": {},
3 "id": "aa314fdd-a763-4920-a8c8-6285fc1745c0",
4 "entity_id": "en-your0000-enti-ty00-1D3799b65bcf",
5 "marked_as_paid_with_comment": null,
6 "marked_as_paid_by_entity_user_id": null,
7 "amount_due": 9900,
8 "amount_paid": 0,
9 "amount_to_pay": 9900,
10 "status": "new",
11 "source_of_payable_data": "ocr",
12 "currency": "EUR",
13 "total_amount": 9900,
14 "total_amount_with_credit_notes": 9900,
15 "description": "",
16 "due_date": "2023-07-15",
17 "payment_terms": {
18 "name": "2/10, 1/20, net 30",
19 "term_1": {
20 "number_of_days": 10,
21 "discount": 200
22 },
23 "term_2": {
24 "number_of_days": 20,
25 "discount": 100
26 },
27 "term_final": {
28 "number_of_days": 30
29 }
30 },
31 "suggested_payment_term": {
32 "date": "2023-07-25",
33 "discount": 200
34 },
35 "issued_at": "2023-06-15",
36 "counterpart_bank_account_id": "ee415e8a-4368-4ef8-b192-d25b8e86ad0f",
37 "counterpart_address_id": "d0f2899d-e2b1-4b95-8411-2ed1a9063bce",
38 "counterpart_vat_id_id": "c0d3ca66-bdfa-4cdb-aceb-633d4dfe4f11",
39 "counterpart_bank_id": "DEUTDE2HXXX",
40 "counterpart_id": "8737964a-5246-47f4-8243-8728a2be1e75",
41 "counterpart_account_id": "123456789012",
42 "counterpart_name": "Acme Inc.",
43 "counterpart_address": {
44 "country": "DE",
45 "city": "Berlin",
46 "postal_code": "10115",
47 "state": "BE",
48 "line1": "Flughafenstrasse 52",
49 "line2": "Floor 2"
50 },
51 "payable_origin": "upload",
52 "created_by_role_id": null,
53 "credit_notes": [...],
54 "was_created_by_user_id": "e4e422fc-6956-4fdd-b091-920329f8b92e",
55 "currency_exchange": null,
56 "file": {
57 "id": "2d14935e-505b-4863-a082-b6a340acabbc",
58 "created_at": "2022-04-05T06:31:31.431Z",
59 "file_type": "payables",
60 "name": "invoice-example.pdf",
61 "region": "eu-central-1",
62 "md5": "623470039566983ed5e5945f769ea873",
63 "mimetype": "application/pdf",
64 "url": "https://monite-file-saver-payables-eu-central-1-dev.s3.amazonaws.com/2d14935e.../669bab57c57f.pdf",
65 "size": 49463,
66 "previews": [],
67 "pages": [
68 {
69 "id": "ad712600-bab8-4e0d-9da7-5d561484f1b1",
70 "mimetype": "image/png",
71 "size": 219712,
72 "number": 0,
73 "url": "https://monite-payables.com/1a95c387.../ac02c56d2a3d.png"
74 }
75 ]
76 },
77 "tags": [],
78 "created_at": "2022-04-05T06:31:31.431Z",
79 "updated_at": "2022-04-05T06:31:31.431Z",
80 "ocr_request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
81 "ocr_status": "success",
82 "other_extracted_data": {
83 "total": 52649,
84 "currency": "EUR",
85 "line_items": [
86 {
87 "unit": "items",
88 "quantity": 0.25,
89 "unit_price": 38500,
90 "description": "Open Space - monthly rent",
91 "total_excl_vat": 9625,
92 "vat_percentage": 1900,
93 "line_item_ocr_id": "65391e037952904f8af4dbb2_0_cb9bdddf14bd17bf789a24f9d99a94bf"
94 },
95 {
96 "unit": "m",
97 "quantity": 1.0,
98 "unit_price": 38500,
99 "description": "Open Space - extra requests",
100 "total_excl_vat": 38500,
101 "vat_percentage": 700,
102 "line_item_ocr_id": "65391e037952904f8af4dbb2_1_3332ec854a09518fccd73598795147e7"
103 }
104 ],
105 "document_id": "202008476",
106 "tax_payer_id": "DE 302071443",
107 "payment_terms": null,
108 "counterpart_name": "Mindspace Germany GmbH",
109 "document_due_date": "2021-02-01",
110 "counterpart_address": null,
111 "counterpart_account_id": "DE 57550104000595963377",
112 "document_issued_at_date": "2021-02-01",
113 "counterpart_address_object": {
114 "city": "Berlin",
115 "line1": "Wittestr . 30 , Haus F",
116 "line2": null,
117 "state": null,
118 "country": null,
119 "postal_code": "13509",
120 "original_country_name": null
121 }
122 },
123 "approval_policy_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
124 "document_id": "DE2287",
125 "subtotal": 9000,
126 "tax": 1000,
127 "tax_amount": 250,
128 "sender": "hello@example.com"
129}

The other_extracted_data field in the response contains individual text labels and values extracted by OCR.

You can use this data to review and double-check the recognized text, but keep in mind that the structure of this object can change or even be null depending on the OCR results and various types of invoices:

1"other_extracted_data": {
2 "total": 52649,
3 "currency": "EUR",
4 "line_items": [
5 {
6 "unit": "items",
7 "quantity": 0.25,
8 "unit_price": 38500,
9 "description": "Open Space - monthly rent",
10 "total_excl_vat": 9625,
11 "vat_percentage": 1900,
12 "line_item_ocr_id": "65391e037952904f8af4dbb2_0_cb9bdddf14bd17bf789a24f9d99a94bf"
13 },
14 {
15 "unit": "m",
16 "quantity": 1.0,
17 "unit_price": 38500,
18 "description": "Open Space - extra requests",
19 "total_excl_vat": 38500,
20 "vat_percentage": 700,
21 "line_item_ocr_id": "65391e037952904f8af4dbb2_1_3332ec854a09518fccd73598795147e7"
22 }
23 ],
24 "document_id": "202008476",
25 "tax_payer_id": "DE 302071443",
26 "payment_terms": null,
27 "counterpart_name": "Mindspace Germany GmbH",
28 "document_due_date": "2021-02-01",
29 "counterpart_address": null,
30 "counterpart_account_id": "DE 57550104000595963377",
31 "document_issued_at_date": "2021-02-01",
32 "counterpart_address_object": {
33 "city": "Berlin",
34 "line1": "Wittestr . 30 , Haus F",
35 "line2": null,
36 "state": null,
37 "country": null,
38 "postal_code": "13509",
39 "original_country_name": null
40 }
41}

Some comments about the line_items field:

  • unit: This can be any string that describes the units involved. It can be “m”, “h”, “items”, or anything else. It does not affect any numerical values.
  • quantity: The number of items in float format, for example, 0.25 or 10.0. The quantity is used to calculate the total amount and subtotal of the line item and the overall payable.
  • unit_price: The price per unit expressed in minor unit of currency. This value influences the total amount and subtotal of the line item and the overall invoice.
  • description: The description of the line item.
  • total_excl_vat: The total amount before taxes that equals to quantity * unit_price. It is also measured in minor units and its value is used to calculate the total amount of the line item and the overall invoice.
  • vat_percentage: The taxes as a percentage, expressed in minor units, for example, 1900 represents 19%. This value influences the total amount of the line item and the overall invoice ( = subtotal + applying taxes).

Send payables by email

Each entity has a dedicated mailbox in Monite to which the payables can be sent. The entity or entity user can send invoices as attachments in PDF, PNG, or JPEG format to this mailbox (the maximum file size is 10 MB).

The Monite OCR service scans the information inside each email’s attachments. Then, Monite automatically creates a draft payable invoice for each occurrence found. The email of the sender of these files is saved in the field sender of the invoice.

To find the mailbox assigned to a specific entity, call GET /v1/mailboxes:

1curl -X GET 'https://api.sandbox.monite.com/v1/mailboxes' \
2 -H 'X-Monite-Version: 2024-05-25' \
3 -H 'X-Monite-Entity-Id: ENTITY_ID' \
4 -H 'Authorization: Bearer YOUR_PARTNER_TOKEN'

The successful response contains information about the mailbox:

1[
2 {
3 "id": "e8c884f8-bed3-4d92-afc9-3538c5079014",
4 "entity_id": "68fdd6b5-b60c-4f4d-8642-1cd7f2fa31e8",
5 "status": "active",
6 "related_object_type": "payable",
7 "mailbox_name": "1102737648192968373_payables",
8 "mailbox_full_address": "1102737648192968373_payables@mg.sandbox.monite.com",
9 "belongs_to_mailbox_domain_id": null
10 }
11]

By default, the automatically created mailboxes belong to the Monite domain (the web address that comes after @ in an email address), but the partners can set up their own email domain for better convenience.

Uploading already paid payables

Uploaded payables that are already paid can be automatically recognized as such for automatic payment approval. Once the payable is recognized as paid, its status will be changed to paid or partially paid according to the this rule:

  • If the value of the amount_paid is greater or equal to the amount_to_pay, the payable status is automatically changed to the paid status.
  • If the value of the amount_paid is greater than 0 and the value of the amount_paid is greater or equals to the amount_to_pay, the payable status is automatically changed to the partially_paid status.

To enable this behavior, set the field skip_approval_for_paid_invoice to true in the partner settings:

1curl -X PATCH 'https://api.sandbox.monite.com/v1/settings' \
2 -H 'X-Monite-Version: 2024-05-25' \
3 -H 'X-Monite-Entity-Id: ENTITY_ID' \
4 -H 'Authorization: Bearer YOUR_PARTNER_TOKEN' \
5 -d '{
6 "payable": {
7 "skip_approval_for_paid_invoice": true
8 }
9 }'

The skip_approval_for_paid_invoice default value is false.

Automatic matching of purchase orders with payables

Every time a payable is created or updated, Monite automatically tries to link this payable to its corresponding purchase order, which is already created in the system. The conditions for the purchase order autolinking to be performed are:

  • The counterpart name on the payable must match, with a certain tolerance, the counterpart name on the purchase order.
  • The line items` name and price on the payable must match those on the purchase order.
  • The total amount of the payable or unit price for the line items on the payable must match those on the purchase order.

Once the corresponding purchase order is found, its ID is added to the payable.purchase_order_id field. If more than one applicable purchase order is found, the most recently created is selected.

The automatic matching is enabled by default. To disable this behavior, call PATCH /entities/{entity_id}/settings, passing the field allow_purchase_order_autolinking as false in the body.

The payable can also be manually matched by calling PATCH /payables/{payable_id}, passing the purchase_order_id in the body.

Tolerance match

The matching is performed considering these tolerance rules:

  • Minor variations in the counterparts` names are accepted (e.g., “Ltd” vs. “Limited”).
  • The billed quantity may vary slightly within a small allowable range.
  • The total amount of the payable or the unit price on the payable may exceed the agreed-upon price by 5%.

Payables that do not meet the exact or tolerance match criteria require a manual review. This process includes:

  • Checking for typos or data entry errors.
  • Verifying explanations for discrepancies (e.g., price changes, shipping fees).