Skip to main content

Stripe

Stripe sends the events of your account to webhook endpoints you add in the Dashboard. Add the Flows address as one more endpoint, and a payment by Checkout or a Payment Link, a failed asynchronous payment or a refund starts your flows: a thank-you with the order number, a note that the payment did not go through. No developer is needed, and the endpoint of your shop stays as it is.

Written from Stripe documentation

This page is written from the public documentation of Stripe and has not been checked on a live account yet.

What you need​

  • A Stripe account. Webhooks are not limited by plan; an account can have up to 16 event destinations.
  • Stripe is not available to companies registered in Ukraine — only through a company registered abroad.
  • To get the phone of the buyer, turn on phone number collection in the Payment Link or Checkout. Without it, the event has the email and the name only.

Step 1. Create a connection​

  1. Open Flows → Connections, press Connect a system and choose Stripe.
  2. Press Copy address. It looks like https://events.alphasms.net/hooks/<TOKEN> — keep it secret.

Step 2. Add an event destination in Stripe​

  1. In the Stripe Dashboard open Workbench, the Webhooks tab, and press Create an event destination.

  2. Choose Your account — the events of your own account.

  3. Payload format — Snapshot. Not Thin: thin events come without the data of the payment, with a link to it only. API version — leave the default.

  4. Events:

    • checkout.session.completed;
    • checkout.session.async_payment_succeeded;
    • checkout.session.async_payment_failed;
    • charge.refunded.

    Add payment_intent.succeeded only if you do not use Checkout or Payment Links — otherwise one payment arrives twice.

  5. Press Continue, choose Webhook endpoint and press Continue again.

  6. Endpoint URL — the address from the cabinet; Description — "AlphaFlow".

  7. The Signing secret (whsec_…) is optional: the secret in the address is enough.

Step 3. Send a test​

Make a test payment in a sandbox. What Stripe sent is listed in Event deliveries in the settings of the destination, and Resend sends a delivery again, up to 15 days back. The event appears in Flows → Connections → Event journal within seconds, and the connection shows Recognised: Stripe.

Events​

Stripe eventAlphaFlow eventProperties
checkout.session.completed with payment_status = paidpayment_succeededorder_id, total, currency, status, payment_link, stripe_object_id
checkout.session.completed with payment_status = unpaid or no_payment_required— no event
checkout.session.async_payment_succeededpayment_succeededorder_id, total, currency, status, payment_link, stripe_object_id
checkout.session.async_payment_failedpayment_failedorder_id, total, currency, status, payment_link, stripe_object_id
payment_intent.succeededpayment_succeededtotal, currency, status, stripe_object_id
payment_intent.payment_failedpayment_failedtotal, currency, status, stripe_object_id
charge.refundedrefund_issuedtotal, currency, status, stripe_object_id
  • A completed Checkout Session is not yet a payment. With a delayed method (a bank debit, a voucher) the session completes as unpaid, and AlphaFlow waits: the payment comes later as checkout.session.async_payment_succeeded or checkout.session.async_payment_failed. A session with nothing to pay (no_payment_required) gives no event.
  • order_id is the client_reference_id of the Checkout Session — your order number, if you pass it.
  • total is amount_total of the session or amount of the PaymentIntent or the Charge, in the smallest unit of the currency: 2198 is 21.98 USD.
  • status is the payment status of the session or the status of the PaymentIntent or the Charge; stripe_object_id is the id of the Stripe object.

The contact is found by the phone, the email and the name of the buyer: for a Checkout Session from customer_details, for payment_intent.* and charge.refunded from billing_details, and the email also from receipt_email. The phone comes only if it is collected. An event without a phone and an email is refused with no_contact.

Payment events are not among the events of the ready-made templates (see Recommended events): create the flow From scratch and choose the event as its start.

Good to know​

  • Stripe repeats a delivery that failed: in live mode for up to 3 days with a growing pause, in a sandbox 3 times over a few hours. A repeat has the same event id (evt_…) and is not recorded twice.
  • The address always answers 200. Above the daily event limit the event is refused in AlphaFlow with quota_exceeded and shown in the journal; the destination in Stripe stays on.

Stripe documentation​