Twilio + ERP: Send Invoices and Payment Reminders
-
Home
-
Software & Integrations
-
How to Integrate Twilio With Your ERP for Invoices, Messages and Reminders
How to Integrate Twilio With Your ERP for Invoices, Messages and Reminders
Send invoices, payment reminders and updates from your ERP over WhatsApp and SMS with Twilio: architecture, India DLT rules and a Laravel example.
Last updated: 12 November 2026
You can connect Twilio to your ERP so that invoices, payment reminders and order updates go out automatically on WhatsApp or SMS. The ERP fires an event (invoice created, due date approaching, payment received), your integration calls Twilio's Messaging API, and Twilio's status callbacks write the delivery result back into the ERP. In India, SMS needs DLT registration, and WhatsApp messages you start need pre-approved templates.
Key takeaways
- Trigger messages from ERP events, not by hand: invoice issued, reminder due, payment received.
- WhatsApp: outside the 24-hour customer service window you must send an approved template, using
ContentSidandContentVariables. - SMS to India: register your entity, sender header and message templates on a DLT platform, then give Twilio your Entity ID and Template IDs.
- Twilio can schedule a message 15 minutes to 35 days ahead through a Messaging Service, and you can cancel it if the invoice is paid.
- Store every message SID and status in the ERP so your team can see what each customer received.
What can an ERP send through Twilio?
- Invoice notifications with the invoice number, amount, due date and a secure link to the PDF.
- Payment reminders a few days before and after the due date.
- Payment confirmations and receipts.
- Order and delivery updates, such as dispatch and delivery messages.
- Internal alerts, such as approvals or low stock, to your own team.
How does the integration work?
- Event in the ERP. For example, an invoice is posted. Your ERP (or a small middleware service) puts a job on a queue so the ERP screen isn't slowed down.
- Send through Twilio. The job calls Twilio's Messaging API with the customer's number, the template and the variables.
- Status callback. Twilio calls your
statusCallbackURL as the message is sent, delivered, read (WhatsApp) or failed. Your endpoint updates the invoice's message log. - Replies. Customer replies arrive on your incoming-message webhook, where you can route them to the right salesperson or create a task in the ERP.
WhatsApp or SMS?
Twilio's documentation explains that when a customer messages you, a 24-hour window opens in which you can reply freely. Messages you send outside that window, which includes most invoice and reminder messages, must use a WhatsApp-approved template. With Twilio, you create the template in the Content Template Builder and send it with its ContentSid (it starts with HX) plus ContentVariables for the customer name, invoice number, amount and date.
SMS in India
Commercial SMS to Indian numbers falls under TRAI's DLT rules. You register your business (entity), your sender ID (header) and the exact wording of each message template, with variables, on a DLT platform. Twilio requires your Entity ID and Template ID when you send SMS to India, and its help centre explains the documents needed to register an alphanumeric sender ID. Templates must match the text you send, so register one template per message type (invoice, reminder, receipt).
Example: invoices and reminders from a Laravel-based ERP
This example uses Twilio's PHP SDK (composer require twilio/sdk) and a Messaging Service that has your WhatsApp sender in its sender pool. The template SIDs are placeholders for your own approved templates.
use Twilio\Rest\Client;
$twilio = new Client(config('services.twilio.sid'), config('services.twilio.token'));
// 1. Invoice posted: send the "invoice issued" template
$twilio->messages->create('whatsapp:' . $customer->phone, [
'messagingServiceSid' => config('services.twilio.messaging_service_sid'),
'contentSid' => 'HXxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', // invoice_issued
'contentVariables' => json_encode([
'1' => $customer->name,
'2' => $invoice->number,
'3' => number_format($invoice->total, 2),
'4' => $invoice->due_date->format('d M Y'),
]),
'statusCallback' => route('twilio.status'),
]);
// 2. Schedule a reminder 3 days before the due date (must be 15 minutes to 35 days ahead)
$reminder = $twilio->messages->create('whatsapp:' . $customer->phone, [
'messagingServiceSid' => config('services.twilio.messaging_service_sid'),
'contentSid' => 'HXyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy', // payment_reminder
'contentVariables' => json_encode(['1' => $customer->name, '2' => $invoice->number]),
'scheduleType' => 'fixed',
'sendAt' => $invoice->due_date->copy()->subDays(3)->setTime(10, 0)->toDateTime(),
]);
$invoice->update(['reminder_message_sid' => $reminder->sid]);
// 3. Invoice paid early: cancel the scheduled reminder
$twilio->messages($invoice->reminder_message_sid)->update(['status' => 'canceled']);
Twilio only schedules messages between 15 minutes and 35 days ahead, and scheduling requires a Messaging Service. For invoices with longer payment terms, run a daily job in your ERP that schedules the reminders falling inside that window. Twilio also notes that templates are checked at send time, and that scheduled messages to customers who have opted out will fail when they're due.
What to store in the ERP
- The Twilio message SID, channel, template name and send time for every message.
- The latest status from the callback (queued, sent, delivered, read, failed) and any error code.
- The customer's consent and opt-out status, so you never message someone who said no.
- The SID of any scheduled reminder, so it can be cancelled when the invoice is paid.
FAQ
Can I attach the invoice PDF?
Yes. WhatsApp templates can include media such as a document, or you can send a secure, expiring link to the PDF in the template text. A link also lets you track whether the invoice was opened.
Which ERPs can be connected?
Any ERP that can call an API or send a webhook: Tally (through a connector), Odoo, ERPNext, SAP Business One, Microsoft Dynamics or a custom-built ERP. The middleware pattern stays the same.
Do I need DLT registration for WhatsApp?
DLT applies to SMS sent to Indian numbers. WhatsApp has its own approval process for templates and business senders.
How do I stop duplicate reminders?
Save the reminder's message SID against the invoice, cancel it when the invoice is paid, and check that SID before scheduling a new one.
Want this built for your business?
HMINFOSOFT builds ERP integrations, automations and custom software in Pune, including WhatsApp and SMS notifications through Twilio. Get a free quote for your integration.
Sources: Twilio: Message scheduling; Twilio: Send WhatsApp notification messages with templates; Twilio Support: Register your alphanumeric sender ID in India.
Share this post: