Wake an agent from Stripe events
Have an agent follow up on failed payments, new subscriptions or disputes. Connect Stripe so Qoren adds the endpoint itself, or paste a URL and Stripe's secret.
On this page
A Stripe trigger wakes an agent when something happens in your Stripe account: an invoice payment fails, a subscription is cancelled, a charge is refunded. The agent can chase the failed payment, update your records, or brief you on who left.
There are two ways to set it up. If Integrations is on your account, connect Stripe once with a restricted key and pick events from a list: Qoren creates the endpoint in Stripe and keeps its secret. Otherwise, or for an event the connected list does not offer, set up an endpoint in Stripe yourself and create a trigger with Stripe's signing secret. For how triggers work in general (rules, Act or Propose only, the delivery log), see let an event wake your agent.
Before you start#
- An agent that has finished setting up.
- Access to the Developers area of your Stripe Dashboard.
The easy way: connect Stripe#
- Connect Stripe with a restricted key and give the agent access, as in connect Stripe to Qoren.
- Open the agent, click Triggers, and under From your connected tools click Add a connected trigger.
- Pick an event, such as Invoice payment failed, Subscription ended or Dispute opened, write the rules, and click Add trigger.
Qoren creates one endpoint in your Stripe account for the whole connection and keeps Stripe's signing secret itself, so there is nothing to copy in either direction. Stripe allows 16 endpoints per mode: if yours are all in use, Qoren says so instead of replacing one. If Stripe switches the endpoint off after repeated failures, Qoren's daily check switches it back on. See wake an agent from a connected tool.
Already have a Stripe trigger with a URL? Once Stripe is connected and the agent has access, open it and click Switch to connected, then delete the old endpoint in Stripe.
Or use a URL and Stripe's secret#
For other Stripe events, such as charge.refunded, or when Integrations is not on your account yet, set the endpoint up by hand in three steps.
1. Add the endpoint in Stripe#
Stripe's own guide is receive Stripe events in your webhook endpoint, and every event is described in types of events.
- In the Stripe Dashboard, open the webhooks area under Developers and add a new endpoint (Stripe may call it an event destination).
- Select the events you want, for example
invoice.payment_failed. - For the endpoint URL, enter a temporary address for now, such as your own website. You replace it in step 3.
- Save, then reveal and copy the endpoint's Signing secret (
whsec_…).
2. Create the trigger in Qoren#
- Open the agent, click Triggers in the tabs under its name, then click Add a trigger.
- Name it in What is this for?, for example "Failed invoices".
- Under Where does it come from?, pick Stripe (1).
- Under Which events?, pick the same events you chose in Stripe (2).
- Write the rules: what the agent should do with each event.
- Paste Stripe's
whsec_…secret into Already have a signing secret? (3).
123- Click Create trigger, and copy the Webhook URL from the section that appears. It is shown only once. The Signing secret shown with it is the Stripe secret you pasted.
The events offered for Stripe are checkout.session.completed, payment_intent.succeeded, payment_intent.payment_failed, invoice.paid, invoice.payment_failed, customer.subscription.created, customer.subscription.updated, customer.subscription.deleted and charge.refunded. You can type any other Stripe event type and press Enter.
3. Point Stripe at the trigger#
- Back in Stripe, open the endpoint you created and edit its URL.
- Replace the temporary address with the Webhook URL from Qoren and save.
Check that it works#
- Cause a real event in Stripe's test mode, or send one with the Stripe CLI's
stripe triggercommand (see trigger webhook events with the Stripe CLI). It should appear in the trigger's Deliveries. - Send a test event in the Qoren trigger sends a made-up Stripe-shaped sample straight to the agent, so you can check your rules without touching Stripe.
- Nothing in Deliveries? Stripe shows the response for each attempt on the endpoint. A refused signature means the secret in Qoren is not this endpoint's secret: create the trigger again with the right one.
What the agent receives#
Stripe puts the event type in the body, so the trigger matches on names like invoice.payment_failed. The agent gets your rules and the full event object Stripe sent, labelled as data from outside, and replies with a short summary for the delivery log.
Qoren checks Stripe's signed timestamp and refuses anything older than five minutes, so an old delivery replayed by someone else is rejected. When Stripe retries an event, Qoren recognises its event id and does not run the agent twice.
Frequently asked questions#
Why can't I just use the secret Qoren makes?
Stripe signs every event with the endpoint's own secret and does not let you set it. Qoren has to check the signature with that same secret, so you paste Stripe's secret in when you create the trigger.
Can I test with Stripe's test mode?
Yes. Test mode endpoints have their own signing secret, so create a separate trigger for them with that secret. A secret that differs from the agent's existing Stripe endpoint gets its own URL.
Which events should I pick?
Only the ones your rules use. Each event that reaches the agent is a paid turn, and some Stripe events fire often.