Stripe Charge
Stripe Charge works with the charges in your Stripe account. It can create a new charge to a customer or a card, look up one charge or the list of charges, and change the description of a charge.
For payments that need the customer’s confirmation, or that you want to hold and collect later, use Stripe Payment Intent.
When to use it
- You want to charge a customer who already has a card saved in Stripe when something happens in your flow.
- You want to review a customer’s latest charges to answer a question.
- You want to look up a specific charge to see whether it went through.
- You want to add a description to a charge so it is easier to identify in Stripe.
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 Create. See Operations. |
| Get Mode | Only in Get. By ID looks up one charge; All returns the list of charges. Defaults to By ID. |
| Charge ID | The charge’s identifier in Stripe (starts with ch_). Required in Get with By ID and in Update. |
| Customer ID | The customer’s identifier in Stripe (starts with cus_). In Create, charges the customer’s default payment method. In Get with All, shows only that customer’s charges. |
| Amount | The amount in the smallest unit of the currency, for example cents: 1000 is 10.00. Required in Create. |
| Currency | The currency of the charge, such as eur or usd. Defaults to usd. Only in Create. |
| Source Token | Only in Create. A Stripe card token (starts with tok_). Payment methods that start with pm_ are not accepted; use Stripe Payment Intent for those. |
| Description | Free text saved with the charge. In Create and Update. |
| Limit | Only in Get with All. Maximum number of charges returned, between 1 and 100. Defaults to 100. |
In Create you must fill in at least Customer ID or Source Token.
Operations
- Create: creates a charge for the given amount and currency, to the customer or to the token’s card.
- Get: with
By IDreturns one charge; withAllreturns the list of charges, for one customer if you give one. - Update: changes the description of an existing charge.
Output
The Data output returns the charge that was created, looked up or updated. With Get and All, it returns one item per charge found. Each item includes the identifier, amount, currency and status of the charge, among other Stripe details.
You can connect it to a component that stores the result, to a message for the customer or to a condition that checks the status. 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 training school charges the enrolment fee to students who already have a card saved in Stripe.
- Add Stripe Charge with Operation set to
Create. - In Customer ID, pass the student’s Stripe identifier coming from the enrolment form.
- Set Amount to
25000and Currency toeurto charge 250.00 EUR. - In Description, write “Autumn course enrolment”.
- Connect the Data output to a confirmation email for the student.
Good practices
- Test your flows with Stripe’s test key before you use the live key.
- Remember that amounts are in cents: a wrong amount is really charged with the live key.
Related components
- Stripe Customer: create and manage customers.
- Stripe Refund: refund a charge fully or partly.
- Stripe Payment Intent: payments with confirmation and capture.