← Back to blog

Receipt Email API (2026): Send Payment Receipts with Rovela

How to send a receipt email with Rovela: HTML plus text, optional PDF (2 MB JSON cap, 413 if over), Idempotency-Key per payment, and delivery status via GET or webhooks.

Updated November 10, 2026
Receipt Email API (2026): Send Payment Receipts with Rovela

A receipt email API is transactional mail with a paper trail

A receipt email API is how your product sends “you paid, here is the record” — usually one recipient, an amount and a reference in the body, and optionally a PDF. It is transactional mail: the person caused it, and they are waiting for it. Rovela sends that as a normal POST /emails from a verified domain, with an Idempotency-Key so a retried payment webhook does not mail two receipts.

This is the product-search guide for receipts. The PDF-attachment how-to is already Send an Invoice Email with a PDF Attachment and the invoice attachment example. The Stripe-shaped recipe is Stripe Webhook Receipt Email. Order-lifecycle copy is E-Commerce Order Emails. Use those when you need the specialized walkthrough; use this when you want the API shape of a receipt.

Start from the Email API product page, the Quick Start, the Send Email API, and Authentication.

Related product guides in this series:

Put the facts in the body, then attach the file

The transactional email page lists invoices and receipts as a first-class use: attach the PDF in the same API call, and the message log shows whether each one was delivered or bounced. The attachment example also insists that the essentials live in the body — number, amount, due date — because a preview pane or a phone notification will not open the PDF.

curl -X POST https://api.rovela.dev/emails \
  -H "Authorization: Bearer re_your_sending_key" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: receipt-order-1042" \
  -d '{
    "from": "Acme <receipts@mail.acme.com>",
    "to": "alice@example.com",
    "subject": "Your Acme receipt for order 1042",
    "html": "<p>Thanks for your order.</p><p>Order <b>1042</b> — total <b>$42.00</b>.</p>",
    "text": "Thanks for your order. Order 1042 — total $42.00.",
    "tags": { "kind": "receipt", "orderId": "1042" }
  }'

That example is a valid receipt with no attachment: HTML plus text, a stable Idempotency-Key (receipt-order-1042), and tags you can correlate later. When you do attach a file, the field is an array of { filename, content (base64), content_type }. Encode the bytes on a single line — the decoder rejects line breaks inside the base64 (Invoice attachment example, Email Attachments Guide).

Use reply_to for a mailbox people can actually reach, while from stays on the verified sending subdomain. Prefer a sending_access key on the billing worker (Email API Authentication).

Size, batching, and idempotency

The invoice attachment example states that the whole JSON request is capped at 2 MB. Base64 makes a file about a third larger, so that leaves roughly 1.5 MB for attachments together. A request over the limit is rejected with 413 before anything is sent. That covers a typical receipt; for large statements, put the file in your own storage and send a link instead.

The same page recommends sending invoices one request each rather than through /emails/batch: the batch shares the same 2 MB body. POST /emails/batch is also the wrong place if you wanted a stored template (that field is rejected on batch) (Batch Transactional Email API, HTML Email API).

Key the request to the payment, not to the attempt: receipt-order-1042 or receipt:${paymentId}. Payment providers retry webhooks; without a stable key you will double-send (Email API Retries, Idempotency Keys for Email APIs, Webhook-Driven Email Automation).

After you have the id

A 200 means queued, not that the customer can see the receipt. For a single payment you can GET /emails/:id (or /events) with a full_access key while debugging. In production, subscribe to email.delivered and email.bounced (Email Delivery Status API, Transactional Email Webhooks). If the status is suppressed, the address is on the suppression list and the API will not deliver — fix the address, not the PDF (Email API Logs).

FAQ

Is a receipt different from an invoice in the API? Not as a separate endpoint. Both are POST /emails with a body (and optional attachment). The distinction is in your copy, filename, and idempotency key.

Should I use a template? You can, via template: { id, variables } on POST /emails, mutually exclusive with html and text. Attachments still go on that same request if you need a PDF. See Email Templates API Guide.

Can I trigger this from any payment provider, not just Stripe? Yes, as long as the hook runs on your server, you verify that provider’s signature, and you call Rovela with a key derived from your payment id. The Stripe-specific verification steps stay in Stripe Webhook Receipt Email.

Charge once, mail once

Persist the payment id, send one POST /emails with a matching Idempotency-Key, put the amount in both HTML and text, and attach a small PDF only when it helps. Then watch delivery like any other transactional message — by id, or by webhook — not by hoping the customer will complain.