Invoice templates, drafts and published, newest first.
Scope
templates:read
Effect
Read only
MCP tool
list_templates
Retries
Safe to repeat
Parameters
List parameters
Name
In
Type
Notes
limitoptional
query
integer
min 1 · max 50
cursoroptional
query
string
up to 256 chars
stateoptional
query
enum
One of draft, published
Returns
data: Template[]. Pass meta.cursor back as cursor for the next page.
Example requestSample
curl -X GET "https://api.billingmart.com/v1/templates" \
-H "Authorization: Bearer $BILLINGMART_API_KEY"
templates
Create
POST/v1/templates
Create a DRAFT invoice template. Server-side the same block validation the console runs; `state` is forced to draft and publication fields are refused.
Scope
templates:write
Effect
Writes a draft or record
MCP tool
create_template_draft
Retries
Send an Idempotency-Key; a repeat replays the stored answer for 24 hours
Request body
JSON. Money is an integer count of minor units beside its currency; quantities are thousandths.
Render an invoice template — draft or published — over a sample invoice and return a short-lived signed URL. Nothing is sent and no real invoice is used.
Pay-page themes, drafts and published, newest first.
Scope
templates:read
Effect
Read only
MCP tool
list_pay_themes
Retries
Safe to repeat
Parameters
List parameters
Name
In
Type
Notes
limitoptional
query
integer
min 1 · max 50
cursoroptional
query
string
up to 256 chars
stateoptional
query
enum
One of draft, published
Returns
data: PayPageTheme[]. Pass meta.cursor back as cursor for the next page.
Example requestSample
curl -X GET "https://api.billingmart.com/v1/pay-themes" \
-H "Authorization: Bearer $BILLINGMART_API_KEY"
pay themes
Create
POST/v1/pay-themes
Create a DRAFT pay-page theme. The three seam tokens must be present and pass the contrast check in both themes; `logoUrl` must be inside this tenant’s own Storage prefix.
Scope
templates:write
Effect
Writes a draft or record
MCP tool
create_pay_theme_draft
Retries
Send an Idempotency-Key; a repeat replays the stored answer for 24 hours
Request body
JSON. Money is an integer count of minor units beside its currency; quantities are thousandths.
An InvoiceTemplate document — a STRUCTURED DOCUMENT, never markup. The AI emits schema-validated JSON and never HTML, CSS or script; out-of-schema fields are discarded, not stored. A generated template is a DRAFT until a human publishes it. The renderer is a real pdf-lib renderer, so what is previewed is what is sent.
Template fields
Field
Type
Notes
idrequired
Id
—
tenantrequired
TenantRef
—
namerequired
string
Untrusted text—
staterequired
PublishState
—
originoptional
enum
ai is what makes the draft-until-published rule non-negotiable. api is a draft written through REST or MCP: still a draft until a person publishes it.
blocksrequired
TemplateBlock[]
Ordered layout blocks. A closed vocabulary is the point: an open one is markup with extra steps.
pageSizeoptional
enum
—
accentTokenNameoptional
string
A semantic token name from brand/tokens, not a hue. A consumer that references blue-500 cannot be re-themed.
rationaleoptional
string
Untrusted textThe Designer's one or two sentences on why this layout fits. Shown to the person editing, never rendered on the invoice.
aiRawoptional
string
The model's raw answer, verbatim and digit-masked, kept beside the human-edited copy so "what did it actually propose" survives the edit. Written by the generator, never by a client.
createdByoptional
Id
—
publishedAtoptional
IsoTimestamp
—
publishedByoptional
Id
The human who published. Absent while draft — an AI cannot fill this in.
createdAtrequired
IsoTimestamp
—
updatedAtoptional
IsoTimestamp
—
lastWriteActoroptional
WriteActor
Who last wrote this record, and when — stamped by the server core. An EDIT_CONFLICT names it, so the person refused knows who saved the newer version.
Object
PayPageTheme
PayPageTheme is computed by the server for this request, not a stored document, so no contract describes it. Its fields are the TypeScript type of the same name that the handler returns.
Next section
Messages and activity
The delivery log of every email and text, the audit trail of who did what, and your own notifications and their settings.
We use Google Analytics on our website by default to understand visits. Choose Decline to turn it off; you can change this at any time on the Cookies page. We never send Google your name, email or account. Cookie policy