Overview
Learn how to build multiparty crypto payments with Pluto.
Pluto allows you to split crypto payments between multiple parties. Suppose you've built an online marketplace where developers can sell their games, and you want to take a 5% transaction fee whenever a game is sold. Using Pluto Connect, you can specify an application_fee
whenever a purchase is made, which will automatically route the transaction fee to your wallet and send the remainder to the developer's wallet.
There are two types of Pluto accounts:
- Platform accounts can view and make requests on behalf of connected accounts, in addition to having all the functionality of a Connect account.
- Connect accounts are managed by platform accounts. They can create invoices, payment intents, customers, and more.
In our game marketplace example, each developer using the marketplace would have a connect account linked to your platform account in order to receive payouts.
Create a connected account
Once you've created a platform account, you can send users an authorization link which grants your account access to their account. The authorization link formatted as follows:
https://pluto.com/connect/{PLATFORM_ACCOUNT_ID}?redirect={REDIRECT_URI}
At this link, the user will be able to log in via Pluto OAuth and choose which Pluto account they'd like to connect. After authorization, the user will be redirected to the URL specified in the redirect query parameter. To retrieve information about the connected account, listen for the connect.account.updated
webhook or use the API.
Making requests on behalf of connected accounts
You can make requests on behalf of connected accounts using the Pluto SDKs by setting the plutoAccount
option to the ID of the target account.
const { Pluto } = require('@plutohq/pluto-node');
const pluto = new Pluto(process.env.PLUTO_SECRET_KEY);
const customer = await pluto.customers.retrieve(
'{{CONNECT_CUSTOMER_ID}}',
{},
{ plutoAccount: '{{CONNECT_ACCOUNT_ID}}' }
);
If you're interacting directly with the API, you can make requests on behalf of connected accounts by adding the Pluto-Account
header to the request.
Updated 6 months ago