Skip to content
Use caseInvoices & receipts

Invoices and receipts, delivered with a paper trail

Attach the PDF, pass the order details as template variables, and send exactly once — even when your billing job retries. Every message keeps an id, an event history and its attachment list for later lookups.

  • Up to 20 attachments per email
  • Invoice number as idempotency key
  • reply_to your finance inbox
  • Event history per message
email api request
ready
send-invoice.tsattachments
await fetch("https://sendix.dev/api/v1/emails", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.SENDIX_API_KEY,
    "Content-Type": "application/json",
    "Idempotency-Key": "invoice-" + invoice.number,
  },
  body: JSON.stringify({
    from: "Acme Billing <[email protected]>",
    to: [customer.email],
    reply_to: "[email protected]",
    template_id: INVOICE_TEMPLATE_ID,
    template_data: { number: invoice.number, total: invoice.total },
    attachments: [{
      filename: "invoice-" + invoice.number + ".pdf",
      content: pdf.toString("base64"),
      contentType: "application/pdf",
    }],
  }),
});
attachmentsreply_toIdempotency-Key
Short answer

How do I email invoices and receipts with Sendix?

POST /v1/emails with the PDF in attachments (base64 content, filename and contentType; up to 20 attachments per message), the invoice fields in template_data and an Idempotency-Key such as the invoice number. Store the returned email id with the invoice so finance or support can check GET /v1/emails/{id}/events and GET /v1/emails/{id}/attachments later.

How it works

Four steps from app event to delivered email.

What your code does, what Sendix does, and where to look when something goes wrong.

  1. 01
    your app

    Generate the document

    Render the PDF in your billing system and base64-encode it for the attachments array.

  2. 02
    Idempotency-Key

    Send once per document

    Use the invoice or order number as the Idempotency-Key, so retries never email a customer twice.

  3. 03
    email id

    Keep the email id

    Save the id returned with 202 Accepted next to the invoice record for support and audit lookups.

  4. 04
    webhooks

    Handle failures

    On email.bounced or email.failed, alert your billing team or fall back to another contact on the account.

Best practices

Details that keep this mail reliable.

Habits that protect deliverability and your users, whichever provider you use.

Put key facts in the body

Amount, due date and invoice number in the email itself make it useful even before the PDF is opened.

Route replies to finance

Set reply_to to a monitored inbox, or receive replies through Sendix inbound and route them to your helpdesk.

Use a billing sender

A consistent billing@ address helps customers recognise and filter financial mail.

Keep attachments lean

Compress PDFs and avoid unnecessary files; smaller messages are faster to process and less likely to be rejected.

Send over SMTP if your platform does

E-commerce and billing tools that only speak SMTP can use smtp.sendix.dev:587; MIME attachments pass through.

Keep billing separate from marketing

Don’t add promotions to invoices; it blurs the transactional nature of the message.

Webhook events

The events worth subscribing to.

Sendix signs each webhook with X-Sendix-Signature and keeps the same events on the message at GET /v1/emails/{id}/events.

email.sentWhat to do with itQueued for delivery.
email.deliveredWhat to do with itAccepted by the customer’s mail server.
email.bouncedWhat to do with itPermanent failure — update the billing contact.
email.failedWhat to do with itSendix could not deliver the message.
email.complainedWhat to do with itMarked as spam by the recipient.
FAQ

Frequently asked questions

Short answers to the questions teams ask while wiring this up.

Can I attach PDF invoices?

Yes. The API accepts up to 20 attachments per message, each with a filename, base64 content and an optional contentType. Over SMTP, standard MIME attachments are passed through.

How do I avoid emailing an invoice twice?

Send the invoice number as the Idempotency-Key. A repeated request with the same key returns the original email id instead of creating a new message.

Where do customer replies go?

To the reply_to address you set. If you enable receiving on a domain, replies can also arrive in Sendix as parsed messages and trigger an email.received webhook.

Can support find a sent invoice later?

Yes. With the stored email id, GET /v1/emails/{id} returns the message, /events its delivery history and /attachments the files that were sent.

Free to start

Try it on the free plan, keep the same integration as you grow.

The free plan includes 1,000 emails per month. Paid plans change volume and limits, not your API calls or SMTP settings.

Ready to send your first email?

1,000 emails free every month. No credit card required. Upgrade only when you outgrow the free tier — and we will let you know when that time comes.

Managed SaaS platform · Native SMTP engine · SOC 2 in progress