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.
Define the invoice number, balance, customer phone number, payment link, and area code for number search.
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"Create one SMS playbook for reminders and one call playbook for overdue escalations.
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')Rent a number once, bind it to the call playbook during purchase, then add the SMS binding.
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"Send the three-day reminder and the due-day reminder from the same SMS sender.
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"When the invoice is overdue, create the escalation call through the collections playbook.
spix --json call create "$CUSTOMER_PHONE" \
--playbook "$CALL_PLAYBOOK_ID" \
--sender "$SENDER_NUMBER"Use the docs to adjust the playbook goal, numbers, inboxes, and follow-up messages for your own customers, leads, patients, or operators.