Skip to content

Stripe Webhook Input

The Stripe input is specifically designed to receive and validate webhook events from Stripe, such as payment confirmations, subscription updates, and invoice notifications.

Stripe Input

How It Works

When you create a Stripe input, Relaye generates a unique webhook URL that you can configure in your Stripe dashboard. When a Stripe event occurs:

  1. Stripe sends the event data to your Relaye webhook URL
  2. Relaye validates the Stripe signature (if configured)
  3. The event data is stored as an incoming log
  4. Any enabled connections linked to this input are triggered
  5. Each connection applies its template to the event data
  6. The formatted notification is sent to the configured output

The Stripe input includes signature verification to ensure that webhook events come from Stripe and not unauthorized sources.

Creating a Stripe Input

To create a Stripe input:

  1. Go to the Inputs section
  2. Click New Input
  3. Select Stripe as the input type
  4. Give your input a descriptive name
  5. You can leave Stripe webhook secret blank for now
  6. Save to generate your unique webhook URL

New Stripe Input Form

After saving, you'll see your unique webhook URL. This is the URL you'll configure in your Stripe dashboard.

Configuring Stripe

To use your Stripe input with Stripe:

  1. Go to your Stripe Dashboard
  2. Click Add endpoint
  3. Enter your Relaye webhook URL
  4. Select the events you want to receive (or choose "Select all events")
  5. Click Add endpoint
  6. Copy the Signing secret provided by Stripe
  7. Update your Relaye Stripe input with this signing secret

Stripe Webhook Configuration

Signature Verification

Stripe includes a signature with webhook events to verify their authenticity. To enable signature verification:

  1. Get the webhook signing secret from your Stripe dashboard
  2. Edit your Stripe input in Relaye
  3. Add the signing secret to the Webhook Secret field
  4. Save your changes

With signature verification enabled, Relaye will validate each incoming webhook event and reject any with invalid signatures.

Danger

If you leave this section blank, all incoming webhooks will be processed with no verification.

Stripe Event Data Structure

Stripe events have a standardized structure that includes:

  • id: A unique identifier for the event
  • type: The type of event (e.g., payment_intent.succeeded)
  • data: The specific object related to the event
  • created: When the event occurred

Example Stripe Event Data

{
  "id": "evt_1KjLd7J2nTHGnBqV2mnnz81k",
  "object": "event",
  "api_version": "2020-08-27",
  "created": 1647987654,
  "data": {
    "object": {
      "id": "pi_3KjLd7J2nTHGnBqV0Ld8EcVu",
      "object": "payment_intent",
      "amount": 2000,
      "currency": "usd",
      "status": "succeeded",
      "customer": "cus_LZ8YJpLY1TqvRt",
      "payment_method": "pm_1KjLd7J2nTHGnBqVGh6Vj4dw",
      "receipt_email": "customer@example.com"
    }
  },
  "livemode": false,
  "type": "payment_intent.succeeded",
  "pending_webhooks": 1
}

Common Stripe Event Types

Here are some of the most commonly used Stripe event types:

  • payment_intent.succeeded: A payment has been successfully processed
  • payment_intent.payment_failed: A payment attempt has failed
  • customer.subscription.created: A new subscription has been created
  • customer.subscription.updated: A subscription has been updated
  • customer.subscription.deleted: A subscription has been canceled
  • invoice.payment_succeeded: An invoice has been paid
  • invoice.payment_failed: An invoice payment has failed
  • charge.refunded: A charge has been refunded

You can find a complete list of event types in the Stripe documentation.

Common Uses

Stripe inputs are typically used for:

  • Payment Notifications: Get notified when payments succeed or fail
  • Subscription Management: Track subscription creations, updates, and cancellations
  • Invoice Monitoring: Monitor invoice payments and failures
  • Dispute Alerts: Get notified about customer disputes
  • Revenue Tracking: Track revenue across your Stripe account

Example Notification

Telegram

Troubleshooting

Common Issues

Event Not Received

If your Stripe event isn't being received:

  1. Verify the webhook URL is correct in your Stripe dashboard
  2. Check that you've selected the correct event types to receive
  3. Test the webhook in your Stripe dashboard
  4. Check the incoming logs in Relaye

Signature Verification Failures

If events are being rejected due to signature verification failures:

  1. Verify that your webhook secret is correct
  2. Check that you're using the latest webhook secret from Stripe
  3. Ensure your server time is synchronized correctly

Viewing Stripe Event Logs

You can view all incoming Stripe events by:

  1. Going to the Inputs section
  2. Clicking on your Stripe input
  3. Navigating to the Incoming Events tab

This will show you all received events, their data, validation status, and processing status.

Best Practices

  • Always use signature verification for production environments
  • Create separate inputs for different Stripe accounts
  • Be selective about which event types you subscribe to
  • Use template conditionals to format different event types appropriately
  • Monitor failed signature verifications as they may indicate attempted fraud