Skip to main content
connic
Connectors

Stripe

Start agents from Stripe webhook events, such as failed payments, subscription changes, and disputes.

Last updated
ModesInbound
YAML typestripe
CredentialsThe webhook signing secret from Stripe, in config.webhook_secret
BridgeNot supported
Custom domainSupported
Linked agentsOne or more. An event starts every linked agent.
While pausedEvents get 200 with {"status": "ignored"} and start no runs. connic doesn't store or replay them.

Set up

  1. Open the agent. In Connector Flow, click Add inbound connector, then Create New Connector, and select Stripe. Leave Webhook Signing Secret empty for now and click Create.

  2. Copy the Webhook URL from the details drawer. To reopen it, hover over the connector in the flow and click the eye icon.

  3. In the Stripe Dashboard, open Developers > Webhooks and add an endpoint with the webhook URL. Select the events the agents should receive: connic starts runs for every event Stripe sends.

  4. Copy the endpoint's signing secret, which starts with whsec_. In the details drawer, click Edit, paste it into Webhook Signing Secret, and click Save Changes. Until then, connic rejects every event with 400. A connector defined in code can't be edited in the dashboard; set webhook_secret in its file and redeploy, as described under In code.

In code

Declare the connector in connectors/*.yaml. The webhook URL exists only after the first deploy, so deploy once without webhook_secret and add the URL from the details drawer in Stripe. Then store the signing secret in an environment variable, reference it as webhook_secret, and deploy again. The dashboard's Edit is disabled for connectors in code, so the file is the only place to set the secret. A literal secret in the file fails the deploy.

connectors/stripe-events.yaml
type: stripe
domain: hooks.example.com      # optional custom domain
config:
  webhook_secret: ${STRIPE_WEBHOOK_SECRET}
agents:
  - dunning-agent

Configuration

The fields of a Stripe connector, the same in connectors/*.yaml, the REST API, and connic MCP. The descriptions name the matching setting in the dashboard. Connectors in code describes the fields every connector shares, such as agents and environments.

FieldTypeStatusDescription
typestringRequiredstripe.
domainstringOptionalHostname or ID of an active custom domain for the webhook URL. Dashboard: Domain.
configobjectOptionalStripe settings.
webhook_secretstringOptionalSigning secret of the Stripe endpoint, starting with whsec_. Without it, connic rejects every event. Secret. In YAML, use a ${NAME} reference. Dashboard: Webhook Signing Secret.

Generated values

connic creates the Webhook URL when the connector is created and keeps it across updates and deploys. It uses the connector's custom domain when one is set. Copy it from the details drawer.

Agent input

Every event starts a run for each linked agent. The input is the Stripe event object as Stripe sent it:

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."
      }
    }
  }
}

The model receives the event as JSON text. Middleware reads it as context["payload"], for example context["payload"]["data"]["object"]["last_payment_error"].

Stripe can deliver an event more than once. A repeated delivery has the same event id, so each agent reuses the run the event already started and no duplicate runs start.

Signature verification

connic checks the Stripe-Signature header of every request before it starts runs. The signature is an HMAC-SHA256 of the timestamp and the raw body, keyed with the signing secret. A request passes when one of its v1 signatures matches and its timestamp is at most 5 minutes from connic's current time, which blocks replays. Other requests get 401 and start no runs.

A connector holds one signing secret, and every Stripe endpoint has its own. Use one connector per endpoint, for example one for test mode and one for live mode.

Limits and errors

LimitValue
Request body10 MiB
Age of the signature timestamp5 minutes
StatusMeaning
200Accepted. The body lists the run_ids the event started. Paused connectors answer {"status": "ignored", "reason": "disabled"}, and a connector without linked agents answers No agents linked; neither starts a run.
400The connector is active but has no signing secret yet, or the body isn't a JSON object.
401The Stripe-Signature header is missing, or the signature or its timestamp doesn't pass the check.
404No Stripe connector exists at this URL.
413The body is larger than 10 MiB.
429A platform limit is reached. Retry after the seconds in Retry-After.