/ar/invoices

Creates an invoice.

This endpoint creates an invoice and immediately sends it to the customer specified in the customerId body parameter.

If you do not provide an invoiceNumber parameter in the body, the system will attempt to generate one based on the last invoice sent to this customer.

🚧

When creditCardEnabled is set to true in the request body, the API validates that a Stripe account is connected to your organization's Mercury account and performs basic checks to ensure the Stripe account can accept card payments. If these checks fail, the invoice creation request will fail with a 400 response. However, intermittent Stripe errors may still cause credit card payments to fail.

Response Schema

{  
  "id": string,  
  "dueDate": date,  
  "invoiceDate": date,  
  "invoiceNumber": string,
  "poNumber": string | null,  
  "payerMemo": string | null,   
  "internalNote": string | null, 
  "customerId": string,
  "ccEmails": [string | null],  
  "slug": string,   
  "status": "Unpaid" | "Paid" | "Cancelled",
  "amount": decimal,  
  "destinationAccountId": string, 
  "creditCardEnabled": boolean,  
  "achDebitEnabled": boolean,  
  "useRealAccountNumber": boolean,
  "lineItems": [  
    {  
      "name": string,
      "unitPrice": decimal,
      "quantity": number,
      "salesTaxRate": number | null,   
    }
  ],
  "createdAt": date-time,
  "updatedAt": date-time,
  "canceledAt": date-time | null,
}

Language
Credentials
Header