mercury_create_invoice
Create a new invoice for an existing customer, send it by email instantly, and get back the invoice ID, status, amount, and payment URL.
Instructions
Create a new invoice (one-shot or to be sent recurrently). Requires AR write scope.
USE WHEN: billing a customer that already exists in Mercury (customerId from mercury_create_customer or mercury_list_customers). Set sendEmailOption: "SendNow" to email the invoice immediately to the customer's contact email.
DO NOT USE: when the customer does not exist yet (call mercury_create_customer first). To attach a file to the invoice, use the Mercury web app at creation time — the API attachment-upload endpoint is not exposed by this MCP currently.
SIDE EFFECTS: writes a new invoice to Mercury. Persistent. With sendEmailOption: "SendNow" (the default), Mercury also sends a real email with a payment link to the customer — confirm the customer's email and the line items before calling. Mercury Plus tier required for the AR write scope.
RETURNS: { id, status, amount, paymentUrl, ... } — paymentUrl is the Mercury-hosted page where the customer pays.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| customerId | Yes | Customer ID (created via mercury_create_customer) | |
| destinationAccountId | Yes | Mercury account ID where invoice payments will be deposited | |
| invoiceDate | Yes | Invoice date (YYYY-MM-DD) | |
| dueDate | Yes | Due date (YYYY-MM-DD) | |
| lineItems | Yes | Invoice line items | |
| achDebitEnabled | No | Allow ACH debit payments. Default: true | |
| creditCardEnabled | No | Allow credit card payments. Default: true | |
| useRealAccountNumber | No | Show real (vs virtual) account number on the invoice. Default: false | |
| ccEmails | No | CC emails for notifications | |
| sendEmailOption | No | Whether to email the invoice immediately. Default: SendNow | |
| invoiceNumber | No | Customer-facing invoice number (≤255 chars; Mercury rejects 300+ characters on the edit endpoint) | |
| poNumber | No | Purchase order number | |
| payerMemo | No | Memo shown to payer | |
| internalNote | No | Note visible only to your org | |
| servicePeriodStartDate | No | Service period start (YYYY-MM-DD) | |
| servicePeriodEndDate | No | Service period end (YYYY-MM-DD) |