Mercoa currently offers AI agent support for accounts receivable with our Invoicing Agent, MAi. MAi can:

  • Read and understand complex B2B contracts
  • Contact customers to collect overdue payments
  • Contact vendors to send upcoming invoices on time
  • Edit invoices and billing schedules with natural language

To make our agentic workflows fully embeddable, we expose API endpoints you can use to control and respond to these behaviors from within your platform.

Contract Understanding

MAi actions upon B2B contracts by breaking each contract down into contract details and payment schedules.

To start using MAi, you can pass a contract PDF to our Generate Contract endpoint as a Base64 encoded string:

MAi will respond with a Contract object with the following structure:

Contract Object

FieldDescription
summaryA natural language summary of the contract details
recurrencesA list of ContractRecurrence objects

ContractRecurrence Object

FieldDescription
rruleA string representation of this recurrence rule (as defined by RFC 5545). Note that the DTSTART must be set in this string along with the RRULE fields.

Example: DTSTART:20250201T000000ZRRULE:FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=1
justificationA natural language justification for this recurrence
filteredContractSummaryA natural language summary of the contract details, filtered to only include information relevant to this recurrence
invoiceSchemaA schema for all invoices that will be created by this recurrence

You can also create or update a Contract directly via our CRUD endpoints.

Automated Invoice Creation + Payment Collection

Once contracts have been set up, MAi automatically creates a draft Mercoa Invoice a week before the invoice should be sent out. You can then edit the created invoice using natural language, and send the invoice out for payment using Mercoa’s Invoice API endpoints or the accounts receivable UI components.

MAi will then continue to monitor the invoice until it is paid, and will automatically send collection emails to the customer if the invoice is overdue.

Natural Language Editing

MAi also supports editing contracts and invoices with natural language.

Contract Editing

Let’s say a user provides a sentence describing a change they would like to make to the Contract MAi initially generated. You can accomplish this with one API call to the Apply Contract Feedback endpoint:

Invoice Editing

When MAi doesn’t have all the information it needs (e.g. how many units were sold this month), it may create an incomplete or incorrect Invoice object. When this happens, you can complete the Invoice object with the Apply Invoice Feedback endpoint:

Built with