hdls Billing

hdls Billing is a headless, MCP-native subscriptions & billing backend. It manages customers, subscriptions, and invoices, operated entirely through named tools your AI assistant calls. It stands in for tools like Chargebee, Recurly — same job, no UI to run.

💬 Just ask

"Create an invoice for Acme for $2,000 and show me what's overdue."

You don't call these tools yourself — just tell your assistant in plain English. Everything below is the reference for when you (or your assistant) want the exact details.

How Billing is organized

The headline entity is the subscription — start there, then attach the rest to it. Records connect by reference: an invoice links to a customer and a subscription; an invoice_line links to an invoice and a plan. The billing_event table is an append-only timeline — every change and note lands there and is never edited or deleted.

EntityPurposeRelates to
subscriptionA customer enrolled on a plan, tracking billing period and lifecycle status.customer, plan
customerThe billed party: holds billing identity, currency, running balance, and dunning status.
planA priced, recurring offering (flat/per_unit/tiered/usage) that subscriptions reference.
invoiceA billing document totalling line items for a customer, optionally tied to a subscription.customer, subscription
invoice_lineA single charge line on an invoice (subscription, usage, one_time, discount, tax, credit).invoice, plan
billing_eventAppend-only audit log shared by customers, subscriptions, and invoices (polymorphic via entity_type/entity_id).

Common workflows

Each line is one real sequence of tool calls — your assistant chains them for you.

  • Set up a subscription end to end: create_customerstart_subscriptionrecord_usage

Tools

Call these at https://hdls.ai/api/mcp/billing. Required fields you must supply; optional fields refine the call. You never pass tenant_id — it is stamped server-side.

Create

ToolWhat it doesRequiredOptional
create_customerCreate a new customer.nameemail, company, status, currency, billing_address, tax_id

Update & advance

ToolWhat it doesRequiredOptional
start_subscriptionStart a subscription.customer_idplan_id, status, quantity, currency, current_period_start, current_period_end
record_usageRecord a usage.id
issue_invoiceIssue an invoice.customer_idsubscription_id, number, status, currency, subtotal, tax

Find & read

ToolWhat it doesRequiredOptional
list_invoicesSearch invoices by free-text and/or column filters (tenant-scoped, paginated).search, filters, limit, orderBy

Field lists come from the product's live schema and are embedded in each tool's own description — read the tool description for the exact, current fields.

Field reference

Every field you can set on each record. Custom fields you add live alongside these in data.

subscription

FieldTypeRequiredNotes
customer_ididYesLinks to a customer.
plan_ididLinks to a plan.
statustextLifecycle state.
quantitynumeric(14,3)
currencytext
current_period_starttimestamp
current_period_endtimestamp
trial_endtimestamp
cancel_attimestamp
cancelled_attimestamp
datajsonFree-form JSON — custom fields live here.

customer

FieldTypeRequiredNotes
nametextYesDisplay name.
emailtext
companytext
statustextLifecycle state.
currencytext
billing_addresstext
tax_idtextExternal identifier.
balancenumeric(14,2)
datajsonFree-form JSON — custom fields live here.

plan

FieldTypeRequiredNotes
nametextYesDisplay name.
codetext
descriptiontext
pricing_modeltext
intervaltext
amountnumeric(14,2)
currencytext
is_activetrue / false
datajsonFree-form JSON — custom fields live here.

invoice

FieldTypeRequiredNotes
customer_ididYesLinks to a customer.
subscription_ididLinks to a subscription.
numbertext
statustextLifecycle state.
currencytext
subtotalnumeric(14,2)
taxnumeric(14,2)
totalnumeric(14,2)
amount_paidnumeric(14,2)
issued_attimestamp
due_attimestamp
paid_attimestamp
datajsonFree-form JSON — custom fields live here.

invoice_line

FieldTypeRequiredNotes
invoice_ididYesLinks to an invoice.
plan_ididLinks to a plan.
descriptiontextYes
line_typetext
quantitynumeric(14,3)
unit_amountnumeric(14,2)
amountnumeric(14,2)
period_starttimestamp
period_endtimestamp
datajsonFree-form JSON — custom fields live here.

Tailor it with custom fields

Add fields without a schema change. add_custom_field defines one, list_custom_fields shows what's defined, and promote_custom_field (admin) shares a personal field with the whole workspace. The value lives in each row's data (JSON) and is set and read through the normal record tools. See Products, tools & custom fields for the full model.

Roles & safety

  • Tenant isolation is automatic. Your credential is pinned to one workspace; you never pass tenant_id, and you can only ever see your own data (enforced by Postgres row-level security).
  • Role-gated. Permissions run reader < member < admin < owner. Installing a product and promoting a custom field workspace-wide need admin/owner.
  • History is append-only. The billing_event timeline is never edited or deleted — it's your audit trail.

Connect

On the concierge (https://hdls.ai/api/mcp), run install_product({ slug: "billing" }) (admin/owner) to enable it for your workspace, then add https://hdls.ai/api/mcp/billing as a connector in your assistant — see Connect your assistant.

A worked example

The literal call your assistant makes when you ask it to create the headline record:

Tool: create_customer
Arguments: {
  "name": "Acme Corp"
}

See All products · Connect your assistant · Automation