Skip to main content

Stripe Webhook Integration

Stripe webhooks enable real-time communication between your Stripe account and Tourism Accelerator. This ensures automatic updates to transaction records and guest details, allowing immediate booking confirmations after successful payments.

Hayden Zammit Meaney avatar
Written by Hayden Zammit Meaney
Updated over 2 months ago

Stripe webhooks enable real-time communication between your Stripe account and Tourism Accelerator. This ensures automatic updates to transaction records and guest details, allowing immediate booking confirmations after successful payments. For example, a guest's booking is automatically confirmed in Tourism Accelerator when they successfully pay for an experience.

Accessing this feature

Go to Stripe integration settings within the Tourism Accelerator platform to retrieve your unique webhook endpoint URL.

How to use it

Configuring Stripe webhooks involves a precise sequence of steps to ensure secure and effective data synchronisation.

Retrieve Your Webhook Endpoint URL:

  1. Log in to your Tourism Accelerator account.

  2. Go to the Stripe integration settings.

  3. Locate and copy the unique Webhook Endpoint URL provided by the Tourism Accelerator platform. This URL is where Stripe will send event notifications.

Access Your Stripe Dashboard:

  1. Log in to your Stripe account.

Go to Webhook Settings in Stripe:

  1. From your Stripe dashboard, click on "Developers" in the left-hand navigation menu.

  2. Select "Webhooks" from the Developers submenu.

Add a New Endpoint:

  1. On the Webhooks page, click the + Add endpoint button.

Configure the Endpoint URL:

  1. In the "Endpoint URL" field, paste the Webhook Endpoint URL you copied from your Tourism Accelerator Stripe integration settings.

  2. Ensure the "Version" field is set to the recommended API version, typically the latest available or the one specified by Tourism Accelerator documentation.

Select Events to Send:

Under "Select events to send", choose the specific events for which you want to receive notifications. To ensure comprehensive synchronisation with the Tourism Accelerator platform, we recommend selecting the following events:

  • `checkout.session.completed`: Notifies when a Checkout Session is completed and a payment is successful.

  • `payment_intent.succeeded`: Indicates a Payment Intent has successfully completed.

  • `charge.refunded`: Signals that a charge has been fully or partially refunded.

  • `customer.created`: Alerts when a new guest object is created.

  • `customer.updated`: Notifies when an existing guest object has been modified.

  • `invoice.paid`: Indicates an invoice has been successfully paid.

  • `invoice.payment_failed`: Signals that an invoice payment has failed.

Selecting only the necessary events optimises performance and reduces unnecessary data traffic.

Generate and Copy the Signing Secret:

  1. After adding the endpoint and selecting events, Stripe will generate a unique "Signing secret" for this webhook endpoint. This secret is crucial for verifying the authenticity of webhook events.

  2. Click the "Reveal" button next to the signing secret, then copy the entire string. Do not share this secret publicly.

Return to Tourism Accelerator and Save Configuration:

  1. Go back to your Tourism Accelerator Stripe integration settings.

  2. Locate the field designated for the "Webhook Signing Secret" or similar.

  3. Paste the signing secret you copied from Stripe into this field.

  4. Save or activate the integration settings within the Tourism Accelerator platform. This step finalises the connection.

Test Your Webhook (Optional but Recommended):

  1. Within the Stripe webhooks dashboard, you can send a test webhook to verify the connection.

  2. Select an event and click "Send test webhook".

  3. Monitor the webhook logs in your Stripe dashboard to confirm successful delivery to your endpoint. The Tourism Accelerator platform may also provide logs or indicators within its Stripe integration settings to confirm receipt and processing of events.

Tips

  • Endpoint security: Always use an HTTPS endpoint for your webhook URL. This encrypts the data transmitted between Stripe and your server, protecting sensitive information from interception.

  • Verify webhook signatures: Implement webhook signature verification within your application. The signing secret provided by Stripe allows you to confirm that incoming webhook events genuinely originate from Stripe and have not been tampered with. This is a critical security measure.

  • Idempotency: Design your webhook handler to be idempotent. This means that processing the same webhook event multiple times will produce the same result, preventing duplicate actions in case of retries or network issues.

  • Handle retries gracefully: Stripe automatically retries sending events if your endpoint does not respond with a 2xx HTTP status code within a reasonable timeframe. Ensure your system can handle these retries without creating duplicate records or erroneous states.

  • Select only necessary events: Configure your webhook to send only the specific events required by your integration. Sending all events can increase unnecessary traffic and processing overhead.

  • Monitor webhook delivery: Regularly review webhook logs in your Stripe dashboard to identify any failed deliveries or processing errors. This proactive monitoring helps in quickly resolving potential integration issues.

  • Use a dedicated webhook endpoint: Use a specific endpoint URL solely for receiving Stripe webhooks. This provides a clear separation of concerns and simplifies management and problem-solving.

  • Test completely: Always test your webhook configuration in a development or staging environment before deploying to production. This ensures all events are correctly received and processed by your application.

Need help?

For further assistance, contact us at [email protected]

Did this answer your question?