Warn customers before their saved card expires and billing fails

Each month, spot the saved cards about to expire, email the customers still on recurring billing, and rank the revenue at risk in Slack.

Agentic Task
Authorize.NetGmailSlack BotFinanceOperationsEmail AutomationNotifications & Alerts
PromptCreate

On the first of each month at 8am, check my Authorize.Net stored payment profiles for cards that expire within the next 60 days, so I can get ahead of the failures before they happen. This is a preventive workflow. These cards have not failed yet, and the entire point is to fix them before they do, so do not turn this into a post failure dunning flow that reacts to declined charges.

Start with Get Customer Payment Profile List (CIM) to pull the stored payment profiles and identify the cards expiring in the next 60 days. Card expiration is formatted YYYY-MM, so compare on year and month rather than an exact day. Page through the results with the paging object, using a limit of up to 1000 and a 1-based offset, incrementing the offset until fewer than limit rows come back.

Then call Get Subscription List (ARB) filtered to active subscriptions, and match those subscriptions back to the customers whose cards are expiring. Skip any stored profile that has no active recurring subscription so we are not emailing dormant customers. For each customer who survives that filter, call Get Customer Profile (CIM) to pull their name and email address.

For every customer whose expiring card is attached to active recurring billing, send a personalized Gmail message with Send a Message, asking them to update their card on file before their next billing date. Reference only the card brand, the last four digits, and the expiry month. Never ask the customer to reply with card details and never put a full card number in the email. Write each message individually so it reads like a note from us rather than a bulk blast.

Finally, post a summary to my billing Slack channel using the Slack Bot Send a Message operation, ranked by monthly revenue at risk. List each customer, their subscription amount, and the month their card expires, and lead with the total monthly revenue at risk across the whole list.

Two Authorize.Net API details to handle carefully. Every response carries a top-level messages.resultCode of either Ok or Error, which must be checked before reading the payload. JSON responses also begin with a UTF-8 byte order mark that needs stripping before parsing, or the parse will fail.

Because the window is 60 days and this runs monthly, a customer can surface on two consecutive runs. That is intended and acts as a natural second reminder. When someone is being contacted a second time, word the email as a friendly follow up rather than repeating the first message verbatim.

What does this prompt do?

  • Checks your stored customer cards on the first of each month and flags every one set to expire within the next 60 days.
  • Cross-checks each flagged card against your active recurring billing, so only customers who are actually being charged get contacted.
  • Emails each of those customers a personal note asking them to update their card before their next billing date, referencing only the card brand, last four digits, and expiry month.
  • Posts a Slack summary to your billing channel ranked by monthly revenue at risk, showing each customer, their subscription amount, and the month their card expires.

What do I need to use this?

  • An Authorize.Net merchant account with saved customer payment profiles and recurring billing in use
  • A Gmail account to send the customer emails from
  • A Slack workspace and the channel where your billing updates should land

How can I customize it?

  • Change the 60 day warning window, or run the check weekly instead of monthly
  • Adjust the email wording and how far ahead the first reminder goes out
  • Point the summary at a different Slack channel, or rank it by subscription count instead of revenue

FAQs

Does this ask my customers for card numbers over email?
No. The email never requests card details and never asks anyone to reply with a number. It simply tells the customer which card is expiring, using only the brand, last four digits, and expiry month, and asks them to update it through your normal payment page.
What happens to customers who do not have a subscription?
They are skipped. Dormant saved cards are ignored entirely, so you are not emailing people who are not being billed and have no reason to hear from you.
Is this the same as chasing a payment that has already failed?
No, it is the opposite. This runs on a schedule before anything declines, so you catch the card while the customer is still happily subscribed instead of apologizing after a charge bounces.
How far ahead does it warn me?
60 days by default, which usually means a customer is flagged one to two billing cycles before their card stops working. You can widen or narrow that window to suit your billing cadence.
Could the same customer be emailed twice?
Possibly, and that is by design. A card expiring inside the 60 day window can appear on two consecutive monthly runs, and the second email is written as a friendly follow up rather than a repeat of the first.

Related templates

Build a credential rotation checklist when someone leaves

When someone leaves, we check which shared passwords they used in their final months and post a ranked rotation list to your security channel.

1Password
Rippling
Slack Bot
+1
Agentic Task
Trace phishing emails to the sending IP and report abuse

Every 15 minutes, forwarded phishing reports get traced back to the server that really sent them, with a verdict in Slack and the worst senders reported.

AbuseIPDB
Gmail
Slack
Agentic Task
Weekly Amazon S3 bucket security audit posted to Slack

Every Monday, check every S3 bucket for public exposure, missing encryption and weak backup settings, then get the risks ranked in Slack.

Amazon S3
Slack Bot
Google Sheets
Agentic Task
Log Agorapulse social conversations to HubSpot contacts

Twice every weekday, the conversations from your social inbox land on the right HubSpot contact timelines, with a Slack recap for sales.

Agorapulse
HubSpot
Slack Bot
Agentic Task
Clean up HubSpot contacts from your Amazon SES suppression list

Every morning, find the addresses that hard bounced or filed a spam complaint, update the matching HubSpot contacts, and post a short Slack recap.

Amazon SES
HubSpot
Slack Bot
Agentic Task
Draft polite follow-ups for emails that never got a reply

Every weekday at 4pm, spot the threads that went quiet, stage a ready-to-send nudge in your mailbox, and get a ranked Slack recap.

Aurinko
Google Sheets
Slack Bot
Agentic Task

Stop losing customers to a card you could have fixed.

Get ahead of expiring cards every month so your recurring revenue keeps flowing and nobody has to send an awkward failed payment email.