Klevr Product Documentation logo

Using Payment Processor Sub Accounts in Klevr

Klevr now supports Payment Processor Sub Accounts, allowing organisations to route payments through different Stripe sub accounts while still using a...

Klevr now supports Payment Processor Sub Accounts, allowing organisations to route payments through different Stripe sub accounts while still using a single Klevr environment. This is particularly useful for scenarios such as multi brand organisations, cost centre separation, or region based payment processing.

This article explains what Payment Processor Sub Accounts are, where they can be configured, and how Klevr determines which sub account is used when a payment is processed.

What is a Payment Processor Sub Account?

A Payment Processor Sub Account is a new entity in Klevr that represents a sub account under your primary payment processor. Currently the product functionality only suports Stripe Connect Accounts.

This entity can be referenced from multiple parts of the Klevr data model, allowing payment processing to dynamically select the correct sub account based on context.

Since everything in Stripe linked to the customer (payment method, payments, etc) needs to live in the same sub-account, we have assumed that a contact can only have 1 sub account, and once set, that it won't change. This also helps drive the priority selection explained further below.

Where Sub Accounts Can Be Referenced

Lookup fields to Payment Processor Sub Account have been added to the following entities:

  • Contact
  • Payment / Financial Transaction
  • Scheduled Payment
  • Online Donation

These lookup fields are not added to forms or views by default.

They can either:

  • Be automatically populated via business logic or integrations, or
  • Be manually added to forms and views if users need to set them explicitly.

How Klevr Chooses Which Sub Account to Use

When a payment is processed (including actions such as charging a card or adding a payment method), Klevr determines the Payment Processor Sub Account using the following priority order:

  1. Contact Record (Highest Priority)

If the Contact associated with the payment has a Payment Processor Sub Account specified, this will always be used first.

This enables a “default” sub account per donor or customer.

  1. Transaction Specific Record

If no sub account is found on the Contact, Klevr will look for one on the record driving the payment, such as:

  • Online Donation
  • Payment
  • Scheduled Payment

This allows individual transactions or campaigns to set the default for the contact. Keep in mind once it is set on a contact, it should not change, and therefore the contact record will then drive the default for future transactions.

Main Payment Processor Account (Fallback)

If no sub account is found anywhere, Klevr will fall back to the primary Stripe account, maintaining standard behaviour.

✅ This ensures backward compatibility and safe defaults.

Portal Behaviour: Payment Generator Configuration

The Klevr Portal has been updated to support sub accounts when generating payments.

New Configuration Field

On the Payment Generator page, a new mapping field is available:

Payment Processor Sub Account

This field should be configured with the schema name of the lookup field on the source entity that contains the sub account value.

Example

If payments are being generated from an Online Donation record:

  • The Payment Processor Sub Account lookup already exists on Online Donation entity. Ensure it is set in realtime for the portal payment processor to pick it up. E.g. On create, use a plugin to set the value immediately.
  • Configure the Payment Generator mapping with the schema name of that field. This will then be mapped to the Financial Transaction record being created. Keep in mind that if a contact is present, and they already have an sub account specified, the contact sub account will be used instead.

Portal Sub Account Selection Logic

When a user makes a payment through the portal, the sub account is selected using the following logic:

  1. Contact Sub Account (if present)
    • The Contact record of the logged in user is checked first
    • If a value exists, it takes precedence
  2. Mapped Record Sub Account
    • If the Contact does not have a sub account (or the user is anonymous)
    • The value from the mapped source record (e.g. Online Donation) is used
  3. Value Written to Financial Transaction
    • The resolved sub account is stored on the resulting Financial Transaction
    • This ensures full traceability and consistent downstream processing

Anonymous Donations

For anonymous donations:

  • There is no Contact sub account to evaluate
  • The system will rely entirely on the mapped source record
  • If no value is present there either, the main Stripe account is used

Key Design Principles

  • Contact first precedence ensures consistent donor behaviour
  • Safe fallback prevents misconfiguration from blocking payments
  • Portal and CRM behave consistently, using the same priority rules

Summary

Payment Processor Sub Accounts provide a powerful, flexible way to control how payments are routed in Klevr without duplicating environments or processors.

By configuring sub accounts at the Contact level, transaction level, or via portal mappings, organisations can support complex financial structures while maintaining a clean and predictable payment flow.

Known Issues and pitfalls

All items in the chain of Stripe processing must be linked to the same sub-account. The customer, payment method, Payment Intent, Schedule, etc must all be created in the same sub account. This solution relies on the sub account being configured preferably automatically on account create, or on Online Donation record create for anonymous donations, and not to be changed after creation. There is currently no support for changing from one connected account to another, or from the main account to a connected account.

To force a customer onto a new account, you can delete the "Contact Payment Processor" record for the contact, and set the sub account. Delete or deactivate any existing payment methods and scheduled payments. Recapture a payment method or initiate a new payment for the integration to then identify it as a new Stripe customer and create all records using the specified sub account on the contact record. Do not attempt to use a payment method created in the main account or a sub account, on a customer that is created in a different sub account, Stripe will return errors, and the product will not process the payment.

Last updated on