GC Logo
Developer Docs

Guides

Collect Payments
Overview
Setting up MandatesDirect Debit Mandates Verified Mandates Collecting mandates offline Importing Mandates
One-off PaymentsOne-off Direct Debit Instant Bank Payment
Recurring PaymentsSubscription Instalments Variable Recurring Payments Instant Bank Payment + Direct Debit
Integration TypesGoCardless Hosted Pages Javascript Drop-in Flow Custom Payment Pages
Events & WebhooksMandate Events Billing Requests Events
Managing paymentsFX Payments Reconciling Payouts
Scheme guidanceACH and PAD Consent Types Billing Request Purpose Codes VRP Commercial Payment Purpose Codes PayTo Agreements and Payments

Javascript Drop-in Flow

View as Markdown

What is the JavaScript Drop-in Flow?

Embed a pre-built payment flow directly in your website. The customer completes mandate setup and payment authorisation without leaving your domain.

Supports: Direct Debit only.
Does not support Instant Bank Pay or Commercial VRP.

For these payments, use Hosted Payment Pages or Custom Payment Pages. 
See how all of our integration types compare.

Best for:

  • Keeping customers on your site throughout the payment flow

  • Moderate customisation with less development than a full custom build

  • Modern web applications (React, Vue, etc.)

  • Balance between speed of implementation and control

How it works

  • Create a Billing Request and Billing Request Flow via the API (same as Hosted Pages)

  • Include the GoCardless Drop-in JavaScript library on your page

  • Initialise the component with the flow ID

  • The component renders the payment flow inline on your page

  • Listen for completion events and webhooks

Customisation:

  • Style the component to match your brand colours and fonts

  • Control the container element and placement

  • Handle events (success, exit, error) in your application code

Step-by-step guide

Pre-collecting customer details  Optional 

If you already have the customer's name, email, and address, submit them before creating the flow. The hosted page skips those fields or locks them if you prefer.