# 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.

- Workflow type: agent
- Services: Authorize.Net, Gmail, Slack Bot
- Categories: Finance, Operations
- Published: 2026-08-10

## What it does

- 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 you'll need

- 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

## Prompt

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.

## How to customize

- 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

## FAQ

### 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.

Use this prompt in General Input: https://www.generalinput.com/prompts/warn-customers-before-their-saved-card-expires-and-billing-fails