What you’ll build
You create a Payin in one Payments Account (the receiving account) and attach anallocation_profile. When the Payin is paid, Hello Clever keeps your platform fee in the receiving account and moves each merchant’s share into its own Payments Account (the recipient accounts).
For how the split is calculated and when it is applied, see Platform Fees.
Prerequisites
- A Clever Connect account on Dedicated Balance.
- Fund splitting enabled for the Payin currency. Contact your account manager.
- An active allocation profile in that currency, created in the Merchant Portal. Note its
uuid(for examplemap_tBdQGAAjkqx9). - The
app-idandsecret-keyof the receiving account. - Sandbox
https://api.cleverhub.co; productionhttps://api-merchant.helloclever.co.
The allocation_profile object
Send this object on the Payin request:
1
List the accounts you can split to
Call Get Allocation Recipient Accounts (GET No
/api/v2/merchant_allocation_profiles/accounts) with the receiving account’s keys. It returns the other Payments Accounts in the same currency. The receiving account is always left out.Request
Response
currency is needed: it is taken from the receiving account behind the app-id.2
Create the Payin with an allocation profile
Add
allocation_profile to a v2 Payin or a Payment Gateway 3 payin link. Both are shown below.3
Read the split back
Fetch the Payin or the payin link. The applied split is returned in
allocation_profile.Option A: v2 Payins
Addallocation_profile to POST /api/v2/payins.
Request
Response (excerpt)
Option B: Payment Gateway 3 payin links
Addallocation_profile to POST /api/v3/payin_links. payin_method_code is optional: leave it out to let the customer pick a method at checkout.
Request
Response
/api/v3/payin_links/{uuid} returns the split in transaction_info.allocation_profile:
Response (excerpt)
For card payments,
allocation_profile appears once the card has been charged. Hello Clever waits for the card brand to apply the right processing fee before splitting.Response fields
allocation_profile is only returned on a Payin that was split.
The split is saved when it is applied. Later edits to the allocation profile do not change Payins that were already split.
Webhooks
The webhook for the Payin is sent to the receiving account’sendpoint_url, as for any other Payin. Recipient accounts do not receive a separate webhook for their share.
Errors
The request is rejected with one of these messages inerrors.message:
Testing in sandbox
- For non-card methods, use POST
/api/v3/payins/simulatewith{"uuid": "<payin link uuid>", "action": "completed"}to mark a payin link as paid. Pass a differentamountto test under or over payment: the split is recalculated on the amount received. - For cards, open
payment_urland pay with a test card.