Skip to main content
Connic
Connectors

Stripe

Stripe webhook events trigger agents for dunning, onboarding, fraud detection, and other tasks.

Last updated
Inbound Mode
Stripe events trigger agent runs asynchronously. Useful for payment-driven workflows like dunning, onboarding, and fraud detection.

How It Works

The Stripe connector receives webhook events from the Stripe account, verifies the signature, and triggers linked agents with the full event payload. Best for dunning, upgrade onboarding, fraud detection, and churn prevention.

Setup Instructions

  1. Create Connector in Connic

    Create a new Stripe connector in the project and give it a name.

  2. Copy the Webhook URL

    After creating the connector, copy the webhook URL from the connector details drawer.

  3. Add Webhook in Stripe Dashboard

    Go to Stripe Dashboard > Developers > Webhooks > Add endpoint. Paste the webhook URL and select the events to receive.

  4. Paste the Signing Secret

    Copy the signing secret from Stripe (starts with whsec_) and paste it in the connector settings, then click Save.

Important: The connector won't process events until the signing secret is added. This verifies all webhooks come from Stripe.

Event Payload

The agent receives the full Stripe event object as input:

event-payload.json
{
  "id": "evt_1234567890",
  "object": "event",
  "type": "payment_intent.payment_failed",
  "data": {
    "object": {
      "id": "pi_1234567890",
      "amount": 2000,
      "currency": "eur",
      "customer": "cus_1234567890",
      "last_payment_error": {
        "code": "card_declined",
        "message": "Your card was declined."
      }
    }
  }
}

Subscription Event Example

subscription-event.json
{
  "id": "evt_1234567890",
  "object": "event",
  "type": "customer.subscription.updated",
  "data": {
    "object": {
      "id": "sub_1234567890",
      "customer": "cus_1234567890",
      "status": "active",
      "plan": {
        "id": "plan_pro",
        "amount": 4900,
        "interval": "month"
      }
    }
  }
}

Example Agent

agents/dunning-agent.yaml
name: dunning-agent
model: connic/gpt-5.6-terra
system: |
  You are a dunning specialist AI. When a payment fails,
  analyze the customer's history and generate a personalized
  recovery message.

# The Stripe event is passed as input
# Access in middleware: input["data"]["object"]["last_payment_error"]
Signature Verification

Connic verifies the Stripe-Signature header using the signing secret. Invalid signatures are rejected.

  • HMAC-SHA256 verification
  • Timestamp validation to prevent replay attacks
  • Rate limiting