Skip to main content

What you’ll build

You create a Payin in one Payments Account (the receiving account) and attach an allocation_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 example map_tBdQGAAjkqx9).
  • The app-id and secret-key of the receiving account.
  • Sandbox https://api.cleverhub.co; production https://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 /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
No 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

Add allocation_profile to POST /api/v2/payins.
Request
The response includes the applied split:
Response (excerpt)
Add allocation_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
The link is not split yet: nothing has been paid. Once the customer pays, GET /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’s endpoint_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 in errors.message:

Testing in sandbox

  • For non-card methods, use POST /api/v3/payins/simulate with {"uuid": "<payin link uuid>", "action": "completed"} to mark a payin link as paid. Pass a different amount to test under or over payment: the split is recalculated on the amount received.
  • For cards, open payment_url and pay with a test card.