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-01-31' \
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 "description": "Restock office supplies",
15 "due_date": "2023-07-15",
16 "payment_terms": {
17 "name": "2/10, 1/20, net 30",
18 "term_1": {
19 "number_of_days": 10,
20 "discount": 200
21 },
22 "term_2": {
23 "number_of_days": 20,
24 "discount": 100
25 },
26 "term_final": {
27 "number_of_days": 30
28 }
29 },
30 "suggested_payment_term": {
31 "date": "2023-07-25",
32 "discount": 200
33 },
34 "issued_at": "2022-06-15",
35 "counterpart_id": "8737964a-5246-47f4-8243-8728a2be1e75",
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": null,
40 "counterpart_account_id": null,
41 "counterpart_name": "Acme Inc.",
42 "counterpart_address": {
43 "country": "DE",
44 "city": "Berlin",
45 "postal_code": "10115",
46 "state": "BE",
47 "line1": "Flughafenstrasse 52",
48 "line2": "Floor 2"
49 },
50 "payable_origin": "upload",
51 "created_by_role_id": "6ba5a3b8-82c6-4aaa-b010-03bc4128b342",
52 "was_created_by_user_id": "e4e422fc-6956-4fdd-b091-920329f8b92e",
53 "currency_exchange": {
54 "default_currency_code": "EUR",
55 "rate": 10.0,
56 "total": 0
57 },
58 "file": {
59 "id": "2d14935e-505b-4863-a082-b6a340acabbc",
60 "created_at": "2022-04-05T06:31:31.431Z",
61 "file_type": "payables",
62 "name": "file name",
63 "region": "eu-central-1",
64 "md5": "623470039566983ed5e5945f769ea873",
65 "mimetype": "application/pdf",
66 "url": "https://monite-file-saver-payables-eu-central-1-dev.s3.amazonaws.com/2d14935e.../669bab57c57f.pdf",
67 "size": 49463,
68 "previews": [],
69 "pages": []
70 },
71 "tags": [
72 {
73 "name": "Marketing",
74 "id": "ea837e28-509b-4b6a-a600-d54b6aa0b1f5",
75 "created_at": "2022-09-07T16:35:18.484507+00:00",
76 "updated_at": "2022-09-07T16:35:18.484507+00:00",
77 "created_by_entity_user_id": "efe7eedd-89c5-56f5-984c-0712ee41a2eb"
78 }
79 ],
80 "created_at": "2022-06-17T06:31:31.431Z",
81 "updated_at": "2022-06-17T06:31:31.431Z",
82 "approval_policy_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
83 "document_id": "DE2287",
84 "subtotal": 0,
85 "tax": null,
86 "tax_amount": null,
87 "sender": "hello@example.com"
88}

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-01-31' \
3 -H 'X-Monite-Entity-Id: ENTITY_ID' \
4 -H 'Authorization: Bearer YOUR_PARTNER_TOKEN' \
5 -d '{
6 "payment_priority": "working_capital"
7 }'

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

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

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-01-31' \
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-01-31' \
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).