LotsInvoice

API Documentation

RESTful API documentation for developers

Quick Info
Base URL
https://api.lotsinvoice.com
Authentication

API Key (Bearer token or X-API-Key header)

Total Endpoints

92

Getting Started

Authentication

All API requests require authentication using an API key. You can create an API key from your dashboard.

curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.lotsinvoice.com/api/v1/lotsinvoice/businesses/:business_id/support-access

support

POST
/api/v1/lotsinvoice/businesses/:business_id/support-access

Grant Support Access

grant_support_access

Let LotsTech support (support@lotstech.com) into one business for a limited time so they can look at a problem and fix it. Support joins as Editor and can never change billing, payments, the owner or the team. Without confirmed: true it changes nothing and returns the consent text; grant only after the person has read it and said yes. duration is 24h, 7d (default) or 30d. Granting again while access is on changes the end time. It opens a support case for the person.

GET
/api/v1/lotsinvoice/businesses/:business_id/support-access

List Support Access

list_support_access

Whether LotsTech support has access to this business, until when, and what support did there. available false means support access is not set up yet.

DELETE
/api/v1/lotsinvoice/businesses/:business_id/support-access

Revoke Support Access

revoke_support_access

End LotsTech support's access to this business now. Support leaves the team at once.

lotsinvoice

POST
/api/v1/lotsinvoice/invitations/accept

Accept Invitation

accept_invitation

Accept an invitation with the token from its link (signed in with the invited email).

GET
/api/v1/lotsinvoice/admin/abuse-reports

Admin List Abuse Reports

admin_list_abuse_reports

LotsTech admins: abuse reports from emails and portal pages, newest first.

POST
/api/v1/lotsinvoice/admin/businesses/:business_id/suspend

Admin Suspend Business

admin_suspend_business

LotsTech admins: suspend (or unsuspend with suspend: false) a business: sending, editing and its portal stop; reading and export stay.

POST
/api/v1/lotsinvoice/businesses/:business_id/documents/:document_id/apply-credit

Apply Credit

apply_credit

Apply the customer's available credit (overpayments, credit notes) to an invoice.

POST
/api/v1/lotsinvoice/businesses/:business_id/preset

Apply Preset

apply_preset

Set up columns, labels, titles, tax groups and declarations for a region: us_freelancer, us_sales_tax, eu_vat, uk_vat, india_gst, india_export_lut. Tax groups are created only from tax_rates you give (ask the owner; never guess). A starting point to check with their accountant.

POST
/api/v1/lotsinvoice/businesses/:business_id/archive

Archive Business

archive_business

Archive a business: billing for it stops, nothing is deleted, sent links keep working. Owner only.

POST
/api/v1/lotsinvoice/businesses/:business_id/customers/:customer_id/archive

Archive Customer

archive_customer

Archive (or restore: true) a customer. Nothing is deleted.

DELETE
/api/v1/lotsinvoice/businesses/:business_id/invitations/:invitation_id

Cancel Invitation

cancel_invitation

Cancel a pending invitation.

POST
/api/v1/lotsinvoice/businesses/:business_id/templates/check

Check Template

check_template

Check a template (html body + css) without saving: forbidden content, unknown placeholders, missing required data, and warnings.

POST
/api/v1/lotsinvoice/businesses/:business_id/payment-connections/razorpay

Connect Razorpay

connect_razorpay

Start connecting the owner's own Razorpay account. Answers authorize_url: give it to the owner to open and approve; you cannot finish it yourself. Owner only.

POST
/api/v1/lotsinvoice/businesses/:business_id/payment-connections/stripe

Connect Stripe

connect_stripe

Where the owner connects their own Stripe account: answers the settings page and the steps page. Never send a Stripe key here (it is refused); the owner pastes a restricted key on the settings page. Owner only.

POST
/api/v1/lotsinvoice/businesses/:business_id/documents/:document_id/convert

Convert Estimate

convert_estimate

Turn an estimate into a draft invoice.

POST
/api/v1/lotsinvoice/businesses

Create Business

create_business

Create a business (the entity that sends invoices). Each business is one paid unit: it uses a plan slot or LotsTech Credits (new accounts get free credits). Ask the person for the real legal name, address, email and registration IDs; never invent them.

POST
/api/v1/lotsinvoice/billing/checkout

Create Checkout

create_checkout

A checkout link for a plan (starter, pro, business; monthly or annual) or a credits top-up (amount_usd, minimum 10). Show the link; the person pays in their browser.

POST
/api/v1/lotsinvoice/businesses/:business_id/credit-notes

Create Credit Note

create_credit_note

Draft a credit note. With invoice_id it defaults to that invoice's balance and is applied to it when issued; the rest becomes customer credit.

POST
/api/v1/lotsinvoice/businesses/:business_id/customers

Create Customer

create_customer

Add a customer. Ask for details you do not have; never invent addresses or tax IDs. Returns what is missing.

POST
/api/v1/lotsinvoice/businesses/:business_id/declarations

Create Declaration

create_declaration

Save a statement to print on documents, e.g. "Supply meant for export under LUT without payment of IGST" or "Reverse charge applies".

POST
/api/v1/lotsinvoice/businesses/:business_id/estimates

Create Estimate

create_estimate

Draft an estimate (quote). due_date is "valid until". The customer can accept it in the portal; convert_estimate turns it into an invoice.

POST
/api/v1/lotsinvoice/businesses/:business_id/invoices

Create Invoice

create_invoice

Draft an invoice. Totals are computed exactly (discounts before tax, several taxes per line). It stays a draft: show the totals to the person and ask before send_document.

POST
/api/v1/lotsinvoice/businesses/:business_id/items

Create Item

create_item

Save a product or service with its price, code (SKU, HSN/SAC), unit and default tax.

POST
/api/v1/lotsinvoice/businesses/:business_id/recurring

Create Recurring

create_recurring

Repeat an invoice on a schedule (document_id), e.g. a monthly retainer. Line text may use {period}, {month}, {year}. mode draft (review first) or send (automatic).

POST
/api/v1/lotsinvoice/businesses/:business_id/taxes

Create Tax

create_tax

Save a tax from rates the owner gives you (never guess a rate): one component (name + rate) or several (components), e.g. "GST 18% intra-state" = CGST 9 + SGST 9, or "Sales tax" = State 6.25 + County 2.

POST
/api/v1/lotsinvoice/businesses/:business_id/templates

Create Template

create_template

Save a custom template after it passes check_template. Use it with template "custom:<id>".

DELETE
/api/v1/lotsinvoice/businesses/:business_id/documents/:document_id

Delete Draft

delete_draft

Delete a draft that was never sent.

DELETE
/api/v1/lotsinvoice/businesses/:business_id/payments/:payment_id

Delete Payment

delete_payment

Remove a recorded payment (kept for history, no longer counted).

POST
/api/v1/lotsinvoice/businesses/:business_id/payment-connections/disconnect

Disconnect Payment Provider

disconnect_payment_provider

Disconnect the owner's Stripe or Razorpay account. Preview first: without confirm it changes nothing and answers what would stop (the connection and the open pay links that would be cancelled). Show that to the owner; only after they agree, call again with confirm: true. Payments already made stay. Owner only.

POST
/api/v1/lotsinvoice/businesses/:business_id/documents/:document_id/duplicate

Duplicate Document

duplicate_document

Copy a document into a new draft, optionally for another customer or as another type.

GET
/api/v1/lotsinvoice/businesses/:business_id/export

Export Business

export_business

Everything about the business as JSON, with PDF links valid 7 days. Owner only.

GET
/api/v1/lotsinvoice/businesses/:business_id/reports/aging

Get Aging Report

get_aging_report

Money owed by age (current, 1-30, 31-60, 61-90, 90+ days), per currency and customer.

GET
/api/v1/lotsinvoice/billing

Get Billing

get_billing

Your LotsInvoice plan or credits, businesses in use, rates and plans to choose from.

GET
/api/v1/lotsinvoice/businesses/:business_id

Get Business

get_business

Get one business with its settings and what is still missing (next_steps).

GET
/api/v1/lotsinvoice/businesses/:business_id/customers/:customer_id

Get Customer

get_customer

One customer with open balance, available credit and recent documents.

GET
/api/v1/lotsinvoice/businesses/:business_id/documents/:document_id

Get Document

get_document

One document with lines, totals, versions, payments and activity (viewed, reminders, portal notes). share: true adds ready-to-send messages (email subject and body with a mailto link, WhatsApp text with a wa.me link, the portal link) from the business's message templates, for sending it yourself; editors and owners only, not for drafts.

GET
/api/v1/lotsinvoice/businesses/:business_id/documents/:document_id/pdf

Get Document Pdf

get_document_pdf

A download link (valid 1 hour) for the PDF. Drafts render on demand, marked DRAFT.

GET
/api/v1/lotsinvoice/businesses/:business_id/documents/:document_id/preview

Get Document Preview

get_document_preview

A preview link (HTML, valid 1 hour), or the HTML itself with include_html.

GET
/api/v1/lotsinvoice/businesses/:business_id/documents/:document_id/pay-link

Get Pay Link

get_pay_link

The invoice's stable online pay page (it always charges the current balance), whether online payment works for it and why not, and the provider links made so far. Creates nothing.

GET
/api/v1/lotsinvoice/businesses/:business_id/payment-connections

Get Payment Connections

get_payment_connections

Online payment: which of the business's own payment accounts (Stripe, Razorpay) are connected, test or live, and any problem to fix. Never returns a key.

GET
/api/v1/lotsinvoice/businesses/:business_id/reports/payments

Get Payments Report

get_payments_report

Payments received by method, per currency.

GET
/api/v1/lotsinvoice/businesses/:business_id/customers/:customer_id/portal-link

Get Portal Link

get_portal_link

The customer's portal link (view and download documents, pay, accept estimates), optionally to one document.

GET
/api/v1/lotsinvoice/businesses/:business_id/reports/revenue

Get Revenue Report

get_revenue_report

Revenue (excluding tax) by month and by customer, per currency.

GET
/api/v1/lotsinvoice/businesses/:business_id/settings

Get Settings

get_settings

Numbering, titles, defaults, payment options, reminders, layout (columns, custom fields, blocks, labels), theme and signature, plus next_numbers: the number each document type gets next if issued today (nothing is used up), and payment_email_addresses: whether each extra payment-email address confirmed its link.

GET
/api/v1/lotsinvoice/businesses/:business_id/customers/:customer_id/statement

Get Statement

get_statement

A customer statement: opening balance, invoices, credit notes, payments and closing balance per currency.

GET
/api/v1/lotsinvoice/businesses/:business_id/summary

Get Summary

get_summary

What needs attention: unpaid and overdue invoices, money received this month, drafts, open estimates and upcoming recurring invoices.

GET
/api/v1/lotsinvoice/businesses/:business_id/reports/tax

Get Tax Report

get_tax_report

Tax charged by tax and rate, per currency (invoices minus credit notes).

GET
/api/v1/lotsinvoice/businesses/:business_id/templates/:template_id

Get Template

get_template

One custom template with its html and css, to edit it.

GET
/api/v1/lotsinvoice/template-guide

Get Template Guide

get_template_guide

How to write a custom template: the safe template language, every data path, an example view and the built-in layout source to start from.

POST
/api/v1/lotsinvoice/businesses/:business_id/customers/from-crm

Import Customer From Crm

import_customer_from_crm

Add a customer from a LotsCRM contact you can read (name, email, phone, primary company).

POST
/api/v1/lotsinvoice/businesses/:business_id/customers/import

Import Customers

import_customers

Import customers from CSV text (header row first; up to 1,000 rows). Columns are matched by name (name, email, phone, address, city, state, zip, country, currency, tax id) or by mapping. Try dry_run first.

POST
/api/v1/lotsinvoice/businesses/:business_id/items/import

Import Items

import_items

Import items from CSV (name, description, code/SKU/HSN, unit, price). Up to 2,000 rows.

POST
/api/v1/lotsinvoice/businesses/:business_id/invitations

Invite Member

invite_member

Invite someone (a partner, bookkeeper) as editor or viewer. Emails an accept link valid 7 days. Owner only.

POST
/api/v1/lotsinvoice/businesses/:business_id/leave

Leave Business

leave_business

Leave a business you were invited to.

GET
/api/v1/lotsinvoice/businesses

List Businesses

list_businesses

List the businesses you can invoice from, with your role, settings and whether the sender email is confirmed.

GET
/api/v1/lotsinvoice/businesses/:business_id/customers

List Customers

list_customers

List or search customers (name, contact, email).

GET
/api/v1/lotsinvoice/businesses/:business_id/declarations

List Declarations

list_declarations

Saved declarations (fixed statements printed on documents).

GET
/api/v1/lotsinvoice/businesses/:business_id/documents

List Documents

list_documents

List invoices, estimates and credit notes. Filters: type, status (comma list), customer_id, from/to (issue date), overdue, search (number).

GET
/api/v1/lotsinvoice/businesses/:business_id/items

List Items

list_items

Saved products and services.

GET
/api/v1/lotsinvoice/businesses/:business_id/members

List Members

list_members

People with access to this business, and pending invitations (owner).

GET
/api/v1/lotsinvoice/businesses/:business_id/payments

List Payments

list_payments

Payments, newest first: recorded by hand and paid online (source, provider, refunded, is_test). Filters: source online|manual, test true|false.

GET
/api/v1/lotsinvoice/businesses/:business_id/recurring

List Recurring

list_recurring

Recurring invoices and their next dates.

GET
/api/v1/lotsinvoice/businesses/:business_id/taxes

List Taxes

list_taxes

Saved taxes. A tax has one or more components applied together.

GET
/api/v1/lotsinvoice/businesses/:business_id/templates

List Templates

list_templates

Built-in designs, custom templates and regional presets.

POST
/api/v1/lotsinvoice/businesses/:business_id/documents/:document_id/mark-sent

Mark Document Sent

mark_document_sent

Issue a draft without emailing it (you delivered it yourself): assigns the number and locks it. channel (email, whatsapp, link, other) records that the person sent it themselves, also for a document already issued. Ask the person first.

POST
/api/v1/lotsinvoice/businesses/:business_id/recurring/:recurring_id/pause

Pause Recurring

pause_recurring

Pause a recurring invoice.

POST
/api/v1/lotsinvoice/businesses/:business_id/templates/preview

Preview Template

preview_template

Render a template (template key, or unsaved html/css) with sample data at 1 to 200 lines; returns HTML.

POST
/api/v1/lotsinvoice/businesses/:business_id/documents/:document_id/payments

Record Payment

record_payment

Record money received for an invoice (partial allowed). LotsInvoice does not move money. Any amount above the balance becomes customer credit, and the tool refuses an invoice that is already paid or a payment that looks already recorded (same reference, or same amount and date unless both payments have different references) unless you pass allow_overpayment or allow_duplicate.

POST
/api/v1/lotsinvoice/businesses/:business_id/payments/:payment_id/record-refund

Record Refund

record_refund

Record a refund you made outside LotsInvoice (a bank transfer back, or in your payment account) of a payment recorded by hand. LotsInvoice does not move money. The invoice opens again for the refunded amount; if it will not be collected again, issue a credit note for the invoice so it closes. Online payments: use refund_payment.

POST
/api/v1/lotsinvoice/businesses/:business_id/payments/:payment_id/refund

Refund Payment

refund_payment

Refund an online payment (full, or part with amount) from the business's own Stripe or Razorpay account back to the client. Preview first: without confirm it changes nothing and answers the invoice, the payment, the amount and "This sends X back to your client from your <provider> account". Show that to the owner; only after they agree, call again with confirm: true and the same amount. Owner only.

POST
/api/v1/lotsinvoice/businesses/:business_id/confirm-email

Resend Email Confirmation

resend_email_confirmation

Send the business email confirmation link again. Sending documents needs a confirmed email.

POST
/api/v1/lotsinvoice/businesses/:business_id/restore

Restore Business

restore_business

Restore an archived business (needs plan room or credits).

POST
/api/v1/lotsinvoice/businesses/:business_id/recurring/:recurring_id/resume

Resume Recurring

resume_recurring

Resume a recurring invoice.

POST
/api/v1/lotsinvoice/businesses/:business_id/documents/:document_id/revise

Revise Document

revise_document

Change a sent invoice or estimate: a new locked version with a reason (the number stays). Not for paid or void documents: use a credit note.

POST
/api/v1/lotsinvoice/businesses/:business_id/customers/:customer_id/portal-link/rotate

Rotate Portal Link

rotate_portal_link

Revoke every earlier portal link for this customer and make a new one.

POST
/api/v1/lotsinvoice/businesses/:business_id/documents/:document_id/send

Send Document

send_document

Email the document with its PDF and portal link (from LotsInvoice, replies go to the business). A draft gets its number and is locked. Ask the person before sending.

POST
/api/v1/lotsinvoice/businesses/:business_id/documents/:document_id/remind

Send Reminder

send_reminder

Email a payment reminder now for a sent, unpaid invoice.

POST
/api/v1/lotsinvoice/businesses/:business_id/numbering

Set Next Number

set_next_number

Set the next document number (only forward), e.g. to continue from another tool.

PUT
/api/v1/lotsinvoice/businesses/:business_id/payment-options

Set Payment Options

set_payment_options

How customers pay, shown on invoices, emails and the portal: a pay link (Stripe Payment Link, PayPal, Venmo, Cash App, Square), bank details, Zelle, UPI (India, with a QR code), check address, instructions. LotsInvoice never handles the money.

PATCH
/api/v1/lotsinvoice/businesses/:business_id/theme

Set Theme

set_theme

Change the default template and look: template (classic, modern, minimal, bold, compact, formal, studio, executive, ledger or custom:<id>; ledger is the full-page grid Indian tax invoice), color, accent, font (inter, plex, serif, mono), density (compact, normal, comfortable), logo_position, logo_size, paper (letter, a4), accent_style (bar, band, none).

PATCH
/api/v1/lotsinvoice/businesses/:business_id

Update Business

update_business

Update business details. Changing the email sends a confirmation link.

PATCH
/api/v1/lotsinvoice/businesses/:business_id/customers/:customer_id

Update Customer

update_customer

Update a customer. Documents already sent keep the details they were sent with.

PATCH
/api/v1/lotsinvoice/businesses/:business_id/declarations/:declaration_id

Update Declaration

update_declaration

Update or archive a declaration.

PATCH
/api/v1/lotsinvoice/businesses/:business_id/documents/:document_id

Update Document

update_document

Edit a draft (any document field; lines replaces all lines). Sent documents: use revise_document.

PATCH
/api/v1/lotsinvoice/businesses/:business_id/items/:item_id

Update Item

update_item

Update or archive (archived: true) an item.

PATCH
/api/v1/lotsinvoice/businesses/:business_id/members/:user_id

Update Member

update_member

Change a member's role or remove them (remove: true). Owner only.

PATCH
/api/v1/lotsinvoice/businesses/:business_id/recurring/:recurring_id

Update Recurring

update_recurring

Change a recurring invoice (name, mode, end_date, max_count, next_date, template).

PATCH
/api/v1/lotsinvoice/businesses/:business_id/settings

Update Settings

update_settings

Change settings. Give only what changes, under settings: numbering {invoice:{prefix,padding,reset}} (prefix tokens {YYYY} {YY} for the calendar year, {FY} for the financial year such as 2026-27; reset never, yearly (1 January) or financial_year), financial_year {start_month: 1-12, default 4 = April}, titles {invoice:"Tax Invoice"}, defaults {notes,terms,footer,estimate_valid_days,template,line_treatment,second_currency}, reminders {enabled,offsets,subject,message}, layout {columns:[{key,label,visible,type}], custom_fields:[{key,label,scope,visible}], blocks:{tax_summary,words,signature,…}, fields:{due_date,po_number,reference,place_of_supply}, labels:{…}, words_system, show_registration_ids}, theme {color,accent,font,density,logo_position,logo_size,paper,accent_style}, signature {name,title,image_url}, messages {invoice|estimate|credit_note: {email_subject,email_body,whatsapp}} (templates for sending yourself; null = default; placeholders {customer} {business} {number} {total} {balance} {due_date} {link} {pay_link}), notifications {payment_email: {enabled, members: {<user id>: true|false}, extra_emails: [up to 5]}} (who gets an email when a client pays online; the owner by default; each extra address gets a one-time confirmation link and nothing else until it confirms, see payment_email_addresses in the answer; test payments email only the owner; only the owner changes it, a member may switch it for themselves).

PATCH
/api/v1/lotsinvoice/businesses/:business_id/taxes/:tax_id

Update Tax

update_tax

Rename, change components, or archive (archived: true). Sent documents keep their taxes.

PATCH
/api/v1/lotsinvoice/businesses/:business_id/templates/:template_id

Update Template

update_template

Update (re-checked) or archive a custom template. Sent documents keep their version.

POST
/api/v1/lotsinvoice/businesses/:business_id/images

Upload Image

upload_image

Upload the logo, a signature image or a company seal (stamp) image (PNG, JPEG, WebP or GIF, 1 MB max, base64) and save it on the business.

POST
/api/v1/lotsinvoice/businesses/:business_id/documents/:document_id/void

Void Document

void_document

Void a sent invoice or credit note (keeps its number). Not when payments or credits are recorded.