Skip to main content

Invoices

Invoices let you send professional billing documents to customers. Each invoice includes a payment link, optional line items, and due date tracking. When the customer pays, the invoice status updates automatically.

Create an Invoice

POST /api/v1/invoices
customer_email
string
required
Email address of the invoice recipient.
customer_name
string
Customer name displayed on the invoice.
amount
number
required
Total invoice amount.
token
string
default:"USDC"
Token to accept: USDC, USDT, SOL.
description
string
required
Invoice description or memo.
line_items
array
Itemized breakdown of the invoice.Each item has:
  • description (string, required): Item description
  • quantity (number, required): Quantity
  • unit_price (number, required): Price per unit
due_date
string
ISO 8601 date when payment is due.
metadata
object
Arbitrary key-value pairs.

Example

curl -X POST https://api.zendfi.tech/api/v1/invoices \
  -H "Authorization: Bearer zfi_test_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "customer_email": "client@company.com",
    "customer_name": "Acme Corp",
    "amount": 2500.00,
    "description": "Web Development - March 2026",
    "line_items": [
      {"description": "Frontend Development", "quantity": 40, "unit_price": 50},
      {"description": "Backend API Work", "quantity": 10, "unit_price": 50}
    ],
    "due_date": "2026-03-15T00:00:00Z"
  }'

Response

{
  "id": "inv_test_abc123",
  "invoice_number": "INV-2026-0042",
  "merchant_id": "merch_xyz789",
  "customer_email": "client@company.com",
  "customer_name": "Acme Corp",
  "amount_usd": 2500.00,
  "token": "USDC",
  "description": "Web Development - March 2026",
  "line_items": [
    {"description": "Frontend Development", "quantity": 40, "unit_price": 50},
    {"description": "Backend API Work", "quantity": 10, "unit_price": 50}
  ],
  "status": "draft",
  "due_date": "2026-03-15T00:00:00Z",
  "created_at": "2026-03-01T12:00:00Z"
}

List Invoices

GET /api/v1/invoices
Returns all invoices for the authenticated merchant.
const invoices = await zendfi.listInvoices();

Get an Invoice

GET /api/v1/invoices/{id}
id
string
required
Invoice ID (e.g., inv_test_abc123).
const invoice = await zendfi.getInvoice('inv_test_abc123');

Send an Invoice

POST /api/v1/invoices/{id}/send
Sends the invoice to the customer via email. The email includes a payment link. The invoice status changes from draft to sent.

Example

curl -X POST https://api.zendfi.tech/api/v1/invoices/inv_test_abc123/send \
  -H "Authorization: Bearer zfi_test_your_key"

Response

{
  "success": true,
  "invoice_id": "inv_test_abc123",
  "invoice_number": "INV-2026-0042",
  "sent_to": "client@company.com",
  "payment_url": "https://checkout.zendfi.tech/pay/pay_test_xyz",
  "status": "sent"
}

Invoice Status Lifecycle

StatusDescription
draftInvoice created but not yet sent
sentInvoice emailed to customer with payment link
paidCustomer payment confirmed on-chain

Webhook Events

EventWhen
InvoiceCreatedInvoice created
InvoiceSentInvoice emailed to customer
InvoicePaidInvoice payment confirmed