Stripe Customer Card
Stripe Customer Card manages the saved cards of a Stripe customer. It can add a new card to the customer, look up one card or all of their cards, and remove a card.
Every operation works on a customer who already exists in Stripe. To create customers, use Stripe Customer.
When to use it
- A customer has entered their card in your payment form and you want to save it on their Stripe record.
- Before renewing a service, you want to check which cards the customer has saved.
- A customer asks you to delete a card they no longer use.
Configuration
You need a Stripe API credential with the secret key of your Stripe account. See Credentials.
| Field | What it does |
|---|---|
| Credential (required) | The Stripe API credential of your account. |
| Operation (required) | The action the component performs. Defaults to Add. See Operations. |
| Mode | Only in Get. By ID looks up one card; All returns all of the customer’s cards. Defaults to By ID. |
| Customer ID (required) | The customer’s identifier in Stripe (starts with cus_). Used in every operation. |
| Card ID | The card’s identifier in Stripe (starts with card_). Required in Get with By ID and in Remove. |
| Source Token | Only in Add, and required there. The token of the card to save (starts with tok_), the one Stripe’s payment form generates. |
Operations
- Add: saves a new card on the customer from its token.
- Get: with
By IDreturns one of the customer’s cards; withAllreturns all of their cards. - Remove: removes a card from the customer.
Output
The Data output returns the card that was added, looked up or removed. With Get and All, it returns one item per card. Each item includes the card’s identifier, brand, last four digits and expiry date.
You can connect it to a confirmation message for the customer or to a condition that checks whether they have any card. The component can also be connected to an Agent as a tool, so the agent decides when to use it. See Tool Mode.
Example
A subscription service wants to save the customer’s card after they enter it on its payment page.
- The payment page sends the customer’s identifier and the card token to the flow.
- Add Stripe Customer Card with Operation set to
Add. - Pass the identifier to Customer ID and the token to Source Token.
- Connect the Data output to an email confirming to the customer that their card ending in the four digits returned has been saved.
Related components
- Stripe Customer: create and manage customers.
- Stripe Charge: charge a customer’s default card.
- Stripe Subscription: your customers’ subscriptions.