Welcome to Xendit’s latest documentation. For legacy content, access the previous documentation here or the previous API reference here.

Route & Split Payments for Sub-Accounts

Prev Next

One powerful feature Platforms can utilize with xenPlatform is the ability to route payments for their merchants. There are multiple ways to route your payments based on your use cases.

Split Payments allows you to set up automatic fee deduction or payment splitting between multiple parties. It offers flexible payment routing options to suit various business needs. After a customer completes a payment, the Platform can decide how the incoming funds would be split once the funds settle.

Use Cases

From Merchant to Platform

Example use cases: Multi-Branch Business, Payment resellers, Bookkeeping

Customer

Master Account

Sub-account

Payment

-IDR 100.000

+IDR 100.000

Transfer

+IDR 30.000

-IDR 30.000

Ending Balance

IDR 30.000

IDR 70.000

From Merchant to Merchant

Example use cases: Food delivery SaaS, Dropshipping

Customer

Sub-account 1

Sub-account 2

Payment

-IDR 100.000

+IDR 100.000

Transfer

-IDR 50.000

+IDR 50.000

Ending Balance

IDR 50.000

IDR 50.000

From Platform to Merchant

Example use cases: Online Marketplace

Customer

Master Account

Sub-account

Payment

-IDR 100.000

+IDR 100.000

Transfer

-IDR 30.000

+IDR 30.000

Ending Balance

IDR 70.000

IDR 30.000

Multiple Destinations

You can also set multiple destinations for a split (each with its own flat or percentage amount), by setting different destination_account_id in the routes array.

Implementation

Create a Split Rule via API

The first step is creating your Split Rules, which is an object that could be created in our system to set a rule for splitting payments in your platform.

  • Send a POST request to https://api.xendit.co/split_rules

  • Split Rules lets you set a flat or percent amount from each transaction

  • You also need to specify one of our supported currencies regardless of flat or percentage amount: IDR, PHP, THB, VND, MYR

  • Add the destination account where the amount will be routed. If destination account is null, it will default to Platform account.

  • Xendit will transfer the calculated Split Rule amount from the total transaction amount minus transaction fees.

    • Note that the amount split must leave some remainder for transaction fees, otherwise the split will fail upon settlement. A 100% split rule will fail because the fee cannot be deducted after transferring the entire amount.

An example of how the split is calculated is as follows:

Customer

Master Account

Sub-account

Payment

-IDR 100.000

+IDR 100.000

Split Rule - 50% to Platform

+IDR 50.000

-IDR 50.000

Fees & VAT

-IDR 700

Ending Balance

IDR 50.000

IDR 49.300

You can also create multiple split rules based on your needs. E.g: as a franchise business you're looking to receive 5,000 flat fee for each transaction made in Jakarta stores, and 5% of revenue made by stores in Bali. You can create two fee rules that take 5% IDR percent fee and 5,000 IDR flat fee.

You can view the API Reference here.

Multiple Routes

You can define several routes in a single transaction. E.g: For incoming funds to Sub-account A, transfer 5% to the Platform and an additional 3% to Sub-account B.

Create a Transaction via API with the Split Rule

You can apply a fee rule to a specific transaction. Use with-split-rule header on the API call when you are creating a transaction on behalf of your partners. The set up of your API request will be depend on how do you want the flow of the money

for-user-id header

with-split-rule header

Sub-account to Master account

Sub-account Business ID

Split rule with destination set to the platform

Sub-account to Sub-account

Sub-account Business ID

Split rule with destination set to the sub-account

Master account to sub-account

Split rule with destination set to the sub-account

Steps to create Transaction with Split Rule:

  • Create a charge of any type (Credit Cards, E-Wallets, etc.) using with-split-rule header containing the unique fee ID

  • Include a for-user-id header to transact on behalf of a sub-account (for Sub-account to Master Account and Sub-account to Sub-account flows)

  • You can find Split ID on Split Payments Dashboard

with-split-rule header is set up on the transaction level, so you can customize the amounts based on your needs. Some common examples are:

  • As an online marketplace, you want to take 10% commission only from apparel purchase transactions. You can apply different fee rule to this transaction type only.

  • You want to charge your merchants different commission rates based on the payment method selected by the customer. E.g. 5% for Credit Cards, and 3% for E-Wallets

Monitor and track Splits on your Dashboard

You can also monitor all the split payments and track the split rules that have been created in your system.

Track Split Rules created

You can track the list of created Split Rules on the dashboard and filter through the search bar using Split Rule ID. This page shows the details of each rule including its name, ID, date created, amount and reference.

Monitor and Export Split Payments

You can track all the processed split fees in the Split Payments page. This list displays succesful, pending and failed splits, which you can filter or search. Each split contains its details including the ID, reference, date created, source and destination Account IDs, amount, etc.

Split fees for each sub-account will be shown in the consolidated Transaction or Balance reports.


FAQ

Why did my split payment fail even when the payment itself succeeded?

When a payment succeeds, but only the split fee fails to be processed, then the amount settled will still remain in the balance of the account that receives the funds. There are several possibilities on why this happens:

  1. The amount that is split exceeds the remaining funds after deducting fees and VAT

  2. The destination account cannot receive transfers

To resolve this, you may reconcile and execute a Transfer.