Manage invoices
Learn how to manage invoices and change invoice statuses.
Update an invoice
All newly created invoices start in the draft
status. You can edit draft invoices before issuing them to a counterpart.
To edit a draft invoice, send a PATCH
request to the /receivables/{receivable_id}
endpoint with the request body containing the updated properties. You can update counterpart data, payment terms, invoice memo, existing line items data, and other details.
When updating an invoice’s counterpart, you must also provide the new counterpart’s counterpart_billing_address_id
in the request object to update the counterpart_billing_address
object.
Update invoice line items
You can modify an invoice’s line items to add, remove, or update the products and product details on the invoice. To update an invoice’s line items, send a PUT
request to the /receivables/{receivable_id}/line_items
endpoint. In the request body, use the data
field to specify an array of the invoice’s new line items.
A successful request overwrites the invoice’s existing line items and replaces them with the newly defined array of line item objects.
Preview an invoice’s email
After creating an invoice, you can preview an invoice’s email before issuing it. This step can be used when troubleshooting email template layouts for an invoice to ensure that the final presentation aligns with your template design.
To preview an invoice’s template, send a POST
request to the /receivables/{receivable_id}/preview
endpoint. The language
field determines the language of the email template used to preview the invoice. If a value is not provided, it defaults to en
.
The values of the subject_text
and body_text
fields will replace the subject_text
and body_template
variables if they were used when creating your custom templates. For more information, see Create and manage email templates and Variables list.
Only invoices in the draft
, issued
, overdue
, and partially_paid
statuses can be previewed. Attempting to preview an invoice in any other status will return a 409 Conflict
error.
Connect an invoice to a payment link
All created invoices have an assigned QR code. By default, all invoices’ QR codes point to the Monite homepage. Connecting a payment link to an invoice automatically assigns a payment page dedicated to the specific invoice and updates the invoice’s QR code destination to point to that payment page.
The process of connecting payment links to an invoice varies slightly between using Monite’s payment links or your custom payment links. However, the payment_page_url
field on the invoice object determines the payment link embedded in the invoice PDF’s QR code.
Using Monite’s payment links
Before using Monite’s payment link, you must first create a payment link connected to the invoice. To connect a payment link to an invoice, send a POST
request to the /payment_links
endpoint.
In the request body, include the object.id
field representing the invoice ID. For more information about connecting a payment link to an invoice, see Payment links.
A successful request generates and returns the payment link for the invoice in the object.id
field. The payment link generated can be found on the payment_page_url
field of the invoice object.
You can only generate payment links for invoices in the issued
and overdue
statuses. Attempting to create a payment link for an invoice in any other status will throw an error.
Using external payment links
If you use custom payment rails, you can connect an external payment link to an invoice. To do this, provide your custom invoice payment link in the payment_page_url
field when creating or updating an invoice:
When using external payment links, the payment_page_url
field can only be updated for invoices in the draft
status. Attempting to connect an external payment link after issuing an invoice will throw an error.
Record payments on an invoice
When using external payment rails, you must manually send all invoice payment information to Monite. This can be either one complete or multiple partial payments. To send information about a payment, call POST /payment_records
:
A successful request contains details of the payment record created and includes details of the invoice’s updated status. Monite automatically reconciles and transitions the invoice to the appropriate status. For more information, see Create a payment record and Invoice reconciliation.
Notes
- This endpoint can be used for invoices in the
issued
,partially_paid
, andoverdue
statuses. - The
amount
field must always be less than or equal to the current value of the invoice’samount_due
field.
Mark an invoice as paid
If the counterpart has paid an invoice in full, you can mark this invoice as paid by calling POST /receivables/{receivable_id}/mark_as_paid
. Optionally, you can provide a JSON body containing the following fields:
paid_at
- Date and time of the payment. This value will be saved to thepaid_at
field of the invoice object. If omitted, it defaults to the date and time of the/mark_as_paid
request.comment
- Additional notes about the paid invoice. For example, which payment method was used. This comment will be saved to thecomment
field of the invoice object.
Notes
- Only invoices in the
issued
,overdue
, andpartially_paid
statuses can be marked as fully paid. - If the invoice is already
paid
, a call to/receivables/{receivable_id}/mark_as_paid
has no effect on the invoice, and the specifiedpaid_at
andcomment
values are ignored.
Alternatively, you can use POST /payment_records
to record a full payment for the invoice, as shown above. The main differences from /mark_as_paid
are that you need to provide the payment amount
in the request and that a payment record will be created to reflect the payment. To get the amount due for use in the /payment_record
request, you can use the amount_to_pay
field of the invoice object.
Customize invoice number
Invoice numbers are customized in the entity settings. Customizing an invoice number will affect all invoices subsequently issued by the entity. The document_id
on previously issued invoices will not be affected by this change. To customize invoice numbering, make a PATCH
request to the /entities/{entity_id}/settings
endpoint as shown:
For more information on customizing invoice numbering, see Document number customization.
Mark an invoice as uncollectible
If an invoice is overdue and the counterpart cannot pay it due to insolvency, you can write off this invoice as uncollectible. To do this, call POST /receivables/{receivable_id}/mark_as_uncollectible
. This will change the invoice status
to “uncollectible”.
Optionally, you can provide a JSON request body with the comment
field containing an arbitrary comment. This comment will be saved to the comment
field of the invoice object.
Clone an invoice
You can clone an invoice of any status by sending a POST
request to the /receivables/{receivable_id}/clone
endpoint. Cloning an invoice copies the updated entity and counterpart information associated with the invoice.
A successful request returns an object with the newly cloned invoice details.
All newly cloned invoices will have a draft
status regardless of the status of the original invoice they were cloned from. Therefore, all previously updated values related to issuing and paying the original invoice will be reset.
Delete an invoice
Draft invoices can be deleted by calling DELETE /receivables/{receivable_id}
. It’s important to note that this action is irreversible, and once deleted, invoices can no longer be accessed.
Only invoices in the draft
status can be deleted successfully. Attempting to delete an invoice with any other status will fail.
Cancel an invoice
Invoices in the issued
and overdue
statuses can be canceled if they have not been paid in full yet. For example, an entity may want to cancel an invoice if it was issued by mistake or if some data in the invoice is missing or incorrect. Depending on the entity settings (mentioned below), canceling an invoice can automatically create and issue a credit note for this invoice.
To cancel an invoice, call POST /receivables/{invoice_id}/cancel
:
A successful request will return the 204 status code. Additionally, if the entity setting receivable_edit_flow
is “compliant”, a new credit note is automatically created and issued for the remaining invoice amount. Note that credit notes are not automatically sent to counterparts, but the entity can send the documents manually.
To find the created credit note, you can call:
Notes
- Canceled invoices cannot be reissued. If the reason for cancelling was to fix missing or incorrect data in the invoice, the entity will need to create a new invoice with the corrected data.
- An invoice cannot be canceled if a draft credit note exists for this invoice and the entity setting
receivable_edit_flow
is “compliant”. - Another way to cancel an invoice is to manually create and issue a credit note for the remaining invoice amount. In this case, the invoice status is changed to “canceled” automatically.
List all invoices
To get a list of all invoices generated by an entity, call GET /receivables?type=invoice
:
You can sort and filter the results by the amount, counterpart name, and other fields. For the full list of available sort and filter parameters, see the description of the GET /receivables
endpoint.
Some examples:
GET /receivables?type=invoice&counterpart_name=Acme%20Inc.
- get all invoices issued to Acme Inc.GET /receivables?type=invoice&amount__gte=15000
- get all invoices where the total amount is €150 or more.GET /receivables?type=invoice&status__in=draft&status__in=issued
- get all draft and issued invoices.GET /receivables?type=invoice&created_at__gte=2024-01-01T00%3A00%3A00
- get all invoices created on or after January 1, 2024.
Retrieve an invoice
To get information about a specific invoice, call GET /receivables/{receivable_id}
and provide the invoice ID.