Skip to main content

Collecting a Fee on a Payment

Splitting payments is a common use case for many applications. For example, a platform may want to collect a fee on each transaction. This guide will walk you through how to collect a fee on a payment.

To collect a fee on a payment, you will need to create a PaymentIntent with the payment_splits parameter set with an element that includes the amount you want to collect, a description and your partner ID as the value of account_id or a contractor id. The description property with be displayed to the merchant on the payment page to describe the fee.

{
"payment_splits": [
{
"amount": 100,
"description": "Application Fee",
"account_id": "part_1Gqj58Bb9Yj8DZ9C1232"
}
]
}

How Splits Work

Payment Splits are instructions to move funds from the merchant's account to another entity in the system. The funds are moved after the payment is captured. Each split creates a Transfer object that moves funds from the merchant's account to the account specified in the split (this can be the partner or a contractor). The description field is used to annotate the transfer.

Note: Specifying the merchant ID in the payment_splits parameter is unnecessary; only contractor IDs or the partner ID need to be provided.

You can reference our Postman Collection to help you get started. Here you can navigate to Payment Intent > Create Payment Intent and see the payment_split field.