How it works without Apex
Receipts and password resets usually go out from a background job, and the job retries when the email service is slow to answer. The first email already went out, so customers get two receipts for one charge. Moving off SendGrid is a good moment to give every email a key.
How Apex does it for you
Apex sends receipts and resets through its transactional API, signed with your domain. For 24 hours, a request with the same Idempotency-Key and body replays the first answer and sends nothing new.
How to set this up in 5 steps
Verify your sending domain
Add the DNS records Apex gives you, once per organization.
Make a transactional key
Under Settings, Workspace, Transactional API, mint a key for your server.
Swap the send call
Replace SendGrid's mail send with Apex's transactional send.
Pass one key per email
Use the receipt id or reset attempt as the Idempotency-Key so a retry replays instead of sending again.
Test in sandbox
Send with the sandbox header first, then switch it off.
Two receipts for one charge
Most apps send receipts and password resets from a background job. When the email service is slow to answer, the job gives up and tries again. The first email already went out, so the customer gets two.
Two password resets are a nuisance. Two receipts look like a double charge, and some of those customers write to support or dispute the payment.
Moving off SendGrid's mail send is a good moment to fix it, because the change touches every send call anyway.
Move the send call and give every email a key
Verify your sending domain. Add the DNS records Apex gives you. It's once per organization, and Apex signs every send with your domain. See Migrating from SendGrid.
Make a transactional key. Under Settings → Workspace → Transactional API, mint an
apex_tx_key for your server.Point the send call at Apex. Swap SendGrid's mail send for
POST /api/v1/transactional/send. The body is smaller: oneto, a subject and html or text, or a template id with variables. See the Transactional Email API.Pass the receipt's own id as the Idempotency-Key. For 24 hours, the same key with the same body replays the first answer instead of sending again. Use one key per email: the receipt id, or the reset attempt.
Test in sandbox first. Send with
X-Apex-Mode: sandbox. Apex simulates the outcome and logs it without reaching an inbox.
The TypeScript client makes up a key for each call and reuses it across its own retries. When your job queue runs the job again, that is a new call with a new key. Pass your own key and it wins.
Worked example: one bookkeeping app's month (illustrative)
Tallyhouse sends about 6,200 receipts and 2,300 password resets a month. Every number is an illustrative assumption.
| Idempotency-Key | |
|---|---|
| Receipt | receipt-inv_20418 |
| Password reset | reset-user_5521-attempt_3 |
In plain terms:
- About 51 sends a month time out on Tallyhouse's side. With 2 retries each and no key, that is 102 extra emails.
- With the receipt id as the key, each retry gets the first answer back and nothing new is sent. Devon Price gets one receipt.
- Each reset attempt gets its own key, so a customer who asks twice still gets the second email.
What this costs to run
The table reads live from Apex's published rate card. Each receipt or reset Apex delivers counts as a send.
Live Apex pricing · Pay-as-you-go
Estimated Apex cost for 8,500 receipts and password resets a month
$0 / month
Fully inside Apex's free monthly allowances (resets every calendar month).
| Apex meter / schedule | Scenario volume | Free allowance / basis | Rate | Apex cost |
|---|---|---|---|---|
Messages 6,200 receipts + 2,300 password resets | 8,500 / mo | 10K / month | $60.00 per 100K messages | $0 |
A replayed retry sends nothing, so it is not a new send. Sandbox sends never reach a real inbox. Individual event history stays queryable for 13 months without a card, 3 years with a card on file, and 7 years once you've paid an invoice. See the live pricing page.
Third-party and campaign costs (not paid to Apex)
| Expense | Typical range | Notes |
|---|---|---|
| SendGrid | Your current plan, until you switch off | Paid to Twilio. Keep it during the move if you like, then cancel once every send goes through Apex. |
Limits worth knowing before you start
The key lasts 24 hours. A retry after that is treated as a new email.
Same key, different body is refused. Apex answers with a conflict rather than guess which email you meant. Use one key per email, never one per customer.
A retry while the first is still sending waits. Apex says the send is in flight. Retry shortly.
Your SendGrid reputation doesn't move. Apex sends from its own shared pool, signed with your domain. Templates, your suppression list and past sends aren't imported.
This page is about receipts and resets. These emails have no unsubscribe link. Marketing email from SendGrid is a separate move.

