Orchestrate
Creating Accounts
Enrollment Plugin

Creating Accounts via the Enrollment Plugin

Learn when and how to create the different account types via the enrollment plugin


Payload accounts can be useful actors in your orchestration layer. Payers and recipients can be modeled as an Account. This guide covers how to create processing accounts using the Enrollment Plugin, including when to use it and how to configure it for your onboarding flow.

Prerequisites

Before writing any code, it’s helpful to learn about the following topics.


When to use the Enrollment Plugin


Create processing accounts via the enrollment plugin when you need an embedded onboarding flow inside your application. By using the plugin, compliance, consent, and other legal requirements are handled automatically and abstracted away.

Use the enrollment plugin when you want a turnkey, compliant, and low-code way to onboard processing accounts without handling sensitive data, terms presentation, or regulatory flow logic yourself. The plugin ensures the submitter is shown and agrees to all required terms, captures attestations, and collects sensitive information directly within a hosted, PCI-compliant environment—removing that responsibility from your application.

Common use cases

  • You want an embedded onboarding flow inside your application (iframe or inline widget) rather than redirecting users to a standalone enrollment link
  • You want a consistent, compliant UX across web, mobile, and low-code platforms
  • You don’t want to handle sensitive identity, business, or financial data directly

Usage

There are two steps to using the plugin: creating an intent and passing that to the plugin on the front end.

The examples below show both steps in two different form factors.

import os
 
import payload
from flask import Flask, jsonify
 
pl = payload.Session(os.getenv('PL_API_KEY'))
app = Flask(__name__)
 
 
@app.route('/enroll_intent')
def get_enroll_intent():
    enroll_intent = pl.Intent.create(type='account_enrollment_plugin')
 
    return jsonify({'token': enroll_intent.token})
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Enroll Button - Vanilla JS</title>
  <script src="https://payload.com/Payload.js"></script>
</head>
<body>
  <button id="enroll-btn" disabled>Open Processing Account Form Modal</button>
 
  <script src="modal.js"></script>
</body>
</html>
const btn = document.getElementById('enroll-btn');
 
// Fetch token and enable button
fetch('/enroll_intent')
  .then(r => r.json())
  .then(data => {
    btn.disabled = false;
    btn.onclick = () => {
      Payload(data.token);
      new Payload.ProcessingAccount()
        .on('success', evt => console.log(evt.account.id))
        .on('closed', evt => console.error('Closed:', evt));
    };
  })
  .catch(err => console.error('Failed to load client token:', err));

This example shows the steps to setting up the plugin as a modal overlay and capturing the result.

  1. Create intent token with type='account_enrollment_plugin' and provide the token value to the front-end
  2. Use the token to launch the EnrollmentPlugin on the front-end
  3. Use the onSuccess(evt) listener to capture the ID of a newly onboarded account

This pattern will create a full processing account via the plugin and initiates the KYC process. To monitor the results of the KYC process, subscribe to the related webhook trigger.

import os
 
import payload
from flask import Flask, jsonify
 
pl = payload.Session(os.getenv('PL_API_KEY'))
app = Flask(__name__)
 
 
@app.route('/enroll_intent')
def get_enroll_intent():
    enroll_intent = pl.Intent.create(type='account_enrollment_plugin')
 
    return jsonify({'token': enroll_intent.token})
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Enroll Form - Vanilla JS</title>
  <script src="https://payload.com/Payload.js"></script>
</head>
<body>
  <h3>Embedded Processing Form</h3>
  <div id="form-container">Loading...</div>
 
  <script src="inline.js"></script>
</body>
</html>
// Fetch token and mount inline form
fetch('/enroll_intent')
  .then(r => r.json())
  .then(data => {
    Payload(data.token);
    new Payload.ProcessingAccount({
      inline: true,
      container: '#form-container'
    })
      .on('success', evt => console.log('Account created:', evt.account.id))
      .on('closed', evt => console.error('Closed:', evt));
  })
  .catch(err => {
    console.error('Failed to load client token:', err);
    document.getElementById('form-container').textContent = 'Failed to load form';
  });

This example shows the steps to setting up the plugin as an inline form embedded directly in your page.

  1. Create intent token with type='account_enrollment_plugin' and provide the token value to the front-end
  2. Use the token to mount the inline form using inline: true and specify a container
  3. Use the onSuccess(evt) listener to capture the ID of a newly onboarded account

This pattern will create a full processing account via the plugin and initiates the KYC process. To monitor the results of the KYC process, subscribe to the related webhook trigger.

Enrollment Plugin Options

The Intent schema defines the structure and properties of intent objects in the Payload API. Intents represent various types of user interactions and requests, including checkout links, payment forms, enrollment links, and more.

Intent Options

Available fields that can be used when creating the intent object

account_enrollment_plugin
object
Configuration for the account enrollment plugin intent. Use this type to embed an onboarding form in your application using the Payload JavaScript SDK. The enrollment plugin allows businesses to sign up for payment processing, providing their business information and undergoing verification. Returns a token for rendering the enrollment UI with the SDK. Required when type is account_enrollment_plugin.
account_template
object
Pre-filled account information for the enrollment. Includes the account ID (to link to an existing account) and account type (processing). Use this to pre-populate account details or associate the enrollment with an existing account record.
entity
object
A list of prefilled values for the enrolled account's legal entity. When provided, these values will populate the corresponding fields in the enrollment form.
country
enum[string]
The country that the enrolled legal entity is registered in. Valid countries to register are currently Canada ("CA") and the United States of America ("US").
Values: CA, US
legal_name
string
Pre-filled legal name for the entity being enrolled. For businesses, this is the registered legal business name. For individuals, this is the person's full legal name. When provided, this value will populate the legal name field in the enrollment form.
type
enum[string]
The type of legal entity being enrolled. Must be either "business" (for companies, organizations, or business entities) or "individual" (for individual persons). Determines which onboarding fields and verification requirements apply.
Values: business, individual
id
string
Pre-filled unique identifier for the account being enrolled. When provided, this existing account will be used. If not provided, a new account will be created during enrollment. Use this to link enrollment to an existing account record.
payment_methods
array
A list of payment method templates with prefilled values that will be applied to payment methods associated with this merchant account during enrollment.
type
enum[string]
The type of account being enrolled. Currently only "processing" is supported for account enrollment, which creates a merchant/processor account capable of receiving payments and sending payouts.
Values: processing

Plugin Options

Available fields that can be used when setting up the enrollment plugin on the front-end

hide_fee_schedule
boolean
Optional boolean that, when set to true, suppresses the display of the fee schedule on the enrollment form. Use this when you need a cleaner or simplified onboarding experience and prefer to manage fee disclosures separately.
inline
boolean
Optional boolean that, when set to true, renders the enrollment form inline within your page container instead of using a modal overlay. Use this when the form should feel native to your application's layout or when modal interactions are not desired.
container
object
Optional DOM element that specifies where the enrollment form should be rendered when inline is set to true. Provide an HTML element or selector to embed the form directly into your page's layout.

Next Steps

Configure payment routing, monitor KYC results, and build payment flows


Configure Processing Settings and Monitor Onboarding

Set up Processing Settings to configure payment routing and processing preferences, monitor identity verification with KYC Results, subscribe to Webhook Events for account and KYC status updates, and review Processing Accounts Overview to understand processing account capabilities.

Create Payment Flows for Merchants

Accept payments on behalf of processing accounts with Creating Payment Intents, store and manage customer payment methods using Payment Methods, and send payouts to processing accounts with Creating Transfers.

Build Reporting and Reconciliation

Track enrollment and payment metrics with Reporting Overview, create custom reports using Building Report Queries, and monitor payment activity with Transaction Reports for financial reconciliation.

Explore Alternative Onboarding Methods

Generate shareable enrollment URLs with Enrollment Link for email or SMS distribution, or use Accounts API for full programmatic control over account creation and onboarding workflows.


Related articles