Strimz
Guides

Send an invoice

Hosted, branded, paid in USDC.

A Strimz invoice is a payment session with line items, a customer email, and a due date. Strimz renders it as a hosted page, emails a copy with a Pay button, and backs the whole thing with a normal PaymentSession. Your existing webhooks fire exactly as they do for any other session.

Create

const invoice = await strimz.invoices.create({
  customerName: 'Acme Inc.',
  customerEmail: 'ap@acme.com',
  currency: 'USDC',
  lineItems: [
    { description: 'Hosting', quantity: 1, unitAmount: '50000000' }, // 50 USDC
    { description: 'Support', quantity: 2, unitAmount: '10000000' }, // 10 USDC × 2
  ],
  note: 'Net 14',
  dueInDays: 14,
})
 
console.log(invoice.number) // 2026-0001
console.log(invoice.sessionId) // backing PaymentSession.id

The number is a per-merchant sequence (<year>-<NNNN>). The sessionId is a real PaymentSession. The customer pays it like any other one-shot session, except the hosted checkout has a "Download PDF" button and the line-item breakdown.

Send

await strimz.invoices.send(invoice.id)

This emails the customer at customerEmail. The email is templated with your business name and brand color (from your storefront, if configured); it links to the hosted checkout page.

If customerEmail is null, send() returns a 403. Invoices without an email can be paid via direct link, but Strimz won't deliver them for you.

Lifecycle

draft  →  sent  →  paid          (customer paid before due)
              ↘   overdue  →  void  (you voided after dueAt)

A daily cron flips invoices past dueAt (status draft or sent) to overdue and fires invoice.overdue. Use this webhook to chase the customer (or it gets routed to the AutoPay Agent's recovery capability if enabled).

Void

await strimz.invoices.void(invoice.id)

Sets the invoice's status to void and cancels the backing payment session. You can't void an invoice that's already paid. That requires a refund instead.

On this page