← Back to recipes
Recipe

Payment Reminder

This recipe creates separate SMS and call playbooks, rents one sender number, binds it to both channels, sends reminder texts, and places an escalation call when the account is overdue.

Estimated cost~$0.52 / reminder cycle
ChannelsSMS + Voice
SMSVoice
Get started in docs →
Step 1

Set invoice variables

Define the invoice number, balance, customer phone number, payment link, and area code for number search.

Set invoice variables
export CUSTOMER_PHONE="+19175550654"
export INVOICE_ID="789"
export INVOICE_AMOUNT="$250.00"
export PAYMENT_URL="https://pay.example.com/789"
export AREA_CODE="415"
Step 2

Create the playbooks

Create one SMS playbook for reminders and one call playbook for overdue escalations.

Create the playbooks
SMS_PLAYBOOK_ID=$(spix --json playbook create \
  --type sms \
  --name "Payment reminder texts" \
  --use-case account_notifications \
  | jq -r '.data.playbook_id')

CALL_PLAYBOOK_ID=$(spix --json playbook create \
  --type call \
  --name "Payment collection" \
  --goal "Remind the customer of their overdue invoice and collect a payment commitment or payment date." \
  --persona "Professional, firm but empathetic collections agent" \
  | jq -r '.data.playbook_id')
Step 3

Rent and bind the sender number

Rent a number once, bind it to the call playbook during purchase, then add the SMS binding.

Rent and bind the sender number
SENDER_NUMBER=$(spix --json phone rent --area-code "$AREA_CODE" --limit 1 | jq -r '.data[0].number')

spix --json phone rent \
  --number "$SENDER_NUMBER" \
  --bind-channel call \
  --bind-playbook "$CALL_PLAYBOOK_ID" \
  --confirm

spix --json phone bind "$SENDER_NUMBER" \
  --channel sms \
  --playbook "$SMS_PLAYBOOK_ID"
Step 4

Send the reminder texts

Send the three-day reminder and the due-day reminder from the same SMS sender.

Send the reminder texts
spix --json sms send "$CUSTOMER_PHONE" \
  --sender "$SENDER_NUMBER" \
  --playbook "$SMS_PLAYBOOK_ID" \
  --body "Reminder: Invoice #$INVOICE_ID for $INVOICE_AMOUNT is due in 3 days. Pay at: $PAYMENT_URL"

spix --json sms send "$CUSTOMER_PHONE" \
  --sender "$SENDER_NUMBER" \
  --playbook "$SMS_PLAYBOOK_ID" \
  --body "Invoice #$INVOICE_ID for $INVOICE_AMOUNT is due today. Pay now: $PAYMENT_URL"
Step 5

Escalate overdue accounts to a call

When the invoice is overdue, create the escalation call through the collections playbook.

Escalate overdue accounts to a call
spix --json call create "$CUSTOMER_PHONE" \
  --playbook "$CALL_PLAYBOOK_ID" \
  --sender "$SENDER_NUMBER"
Build your own recipe

Install Spix, then turn this pattern into your own production flow.

Use the docs to adjust the playbook goal, numbers, inboxes, and follow-up messages for your own customers, leads, patients, or operators.

Open the docs →