You are viewing beta documentation for Formie 4.x.
Payments

Stripe

Connect Stripe to take payments through the provider configured for your form. You need access to configure the form in Craft and credentials for the destination account. The steps below establish the connection; finish by sending a test submission to verify the result.

Step 1. Create the Integration

  1. Navigate to Formie → Settings → Payments.
  2. Click the New Integration button.
  3. Select Stripe as the Integration Provider.

Step 2. Connect to the Stripe API

  1. Go to your Stripe Developers - API Keys page in your Stripe dashboard.
  2. On the top-right of your screen, ensure the Test Mode lightswitch is in the off position if you wish to use Live details, or on if you wish to use Test details.
  3. Copy the Publishable Key from Stripe and paste in the Publishable Key field in Formie.
  4. Copy the Secret Key from Stripe and paste in the Secret Key field in Formie.
  5. We strongly recommend you use .env variables to store these keys.

Step 3. Test Connection

  1. Save this integration.
  2. Click on the Refresh button in the right-hand sidebar.

Step 4. Configure Webhooks (for Subscriptions)

  1. In order for subscriptions to work, you must populate some settings for webhooks.
  2. In Stripe, on the left-hand sidebar menu, click Developers.
  3. On the top sub-menu, click Webhooks.
  4. Click the Create an event destination button.
  5. Copy the Webhook URL from the Formie integration settings and paste it into the Endpoint URL in Stripe. This URL uses the integration’s stable UID, so changing its handle does not disconnect Stripe.
  6. Click the Select Events button under the "Select events to listen to" heading.
  7. We recommend emitting all possible events, but the required events are:
    • customer.subscription.created
    • customer.subscription.deleted
    • customer.subscription.updated
    • invoice.created
    • invoice.payment_failed
    • invoice.payment_succeeded
    • payment_intent.succeeded
    • payment_intent.payment_failed
    • payment_intent.canceled
    • plan.deleted
    • plan.updated
  8. Once created look for the Signing secret item and click Reveal Secret.
  9. Copy the Signing secret from Stripe and paste in the Webhook Signing Secret field in Formie.

Step 5. Field Setting

  1. Go to the form you want to enable this integration on.
  2. Add a Payment field to your form.
  3. Select Stripe for the Payment Provider.

Your form must use the Ajax (Client-side) submission method when using the Stripe payment integration in your form.

The Stripe payment integration supports both once-off payments and subscription-based payments.

Formie records subscription setup separately from money collected. Each paid or failed Stripe invoice is retained as its own payment, while trials, pauses, past-due periods and scheduled cancellation remain part of the subscription lifecycle. Cancelling from Formie defaults to the end of the current billing period; API callers can explicitly request immediate cancellation.

Subscription Payment Limits

For subscription payments, you can optionally limit how many recurring payments Stripe collects before the subscription is cancelled automatically.

  1. Edit your Payment field and set Payment Type to Subscription.
  2. Under Payment Limit, choose Fixed Value or Dynamic Value.
  3. For a fixed limit, enter the number of payments (for example 3 for three installments).
  4. For a dynamic limit, select a field that provides the payment count (for example a Number field).

When a limit is set, Formie creates the subscription through a Stripe subscription schedule. Stripe cancels the subscription after the configured number of successful billing cycles. Leave Payment Limit set to No limit for ongoing subscriptions.

Subscription Setup Fees

For subscription payments, you can optionally charge a one-time setup fee on the first invoice, in addition to the recurring subscription amount.

  1. Edit your Payment field and set Payment Type to Subscription.
  2. Under Setup Fee, choose Fixed Value or Dynamic Value.
  3. For a fixed fee, enter the amount (for example 50).
  4. For a dynamic fee, select a field that provides the fee amount.
  5. Optionally set Setup Fee Description for the Stripe invoice line item.

The setup fee is added to the first subscription invoice through Stripe add_invoice_items. It works with both standard subscriptions and subscriptions that use a payment limit schedule.

You can modify subscription payloads through the modifySubscriptionPayload and modifySubscriptionSchedulePayload events.

Verify a Submission

Save the form, open it on your site and submit recognisable test values. Complete a test payment and inspect both the saved submission and the provider’s transaction record. Confirm the amount, currency and final payment state before enabling live payments.

If nothing arrives, check whether integration conditions matched, whether the submission was complete and non-spam, and whether Craft’s queue has processed the job. A successful connection check verifies credentials; it does not prove that field mapping and delivery work. See Connect and Test an Integration for a complete mapping and verification workflow.