Send and manage Payouts

Send money from your connected business bank account to a beneficiary, then track the payout through authorisation and processing.

Payouts are asynchronous. A successful API response confirms that Lean accepted the request. It does not confirm that the beneficiary received the funds.

Before you start

Complete Set up payouts and make sure you have:

  • A live direct connection and the source account's account_id.
  • The authorisation options agreed for your application.
  • An API-scoped access token.
  • Webhook subscriptions for beneficiary and payment updates.

The payout lifecycle

StepYou doYou receive
  1. Create a destination
POST /payouts/v1/payment/destinationsThe destination ID, then payment_source.beneficiary.created
  1. Submit the payout
POST /payouts/v1/paymentThe payment identifiers
  1. Authorise
Automatic, or approve in the Lean Dashboardpayment.created, then payment.updated
  1. Track to a final status
Handle webhookspayment.updated with post_initiation_status

Example: one payout with manual authorisation

A customer withdraws AED 100.00 from your platform to their own bank account.

#What happensStatus your application sees
1You create a Payout Destination for the customer's account.payment_source.beneficiary.created, beneficiary ACTIVE
2You submit a payout of 100.00 with authorize_payment: false.payment.created, status: AWAITING_AUTHORIZATION
3A member of your team approves the payout in the Lean Dashboard. Lean submits it to your bank.payment.updated, status: ACCEPTED_BY_BANK or PENDING_WITH_BANK
4The bank completes the transfer.payment.updated, post_initiation_status: PROCESSED
5You mark the withdrawal complete in your own records, once.

If step 3 returns FAILED, or step 4 returns REJECTED, the payout has failed. See Handle failures.

1. Create a Payout Destination

A Payout Destination identifies the beneficiary account that receives the funds. Creating it also registers the beneficiary for your connected source account.

POST https://sandbox.leantech.me/payouts/v1/payment/destinations
Authorization: Bearer <ACCESS_TOKEN>
Content-Type: application/json

Provide the beneficiary's account and recipient details as described in the API reference.

Store the destination ID. You can reuse it for later payouts to the same beneficiary, so you don't need to submit the account details again.

Create Payout Destination API reference →

Check the beneficiary is active

With a direct connection there is no beneficiary cooling-off period. The beneficiary is normally ACTIVE when the payment_source.beneficiary.created webhook arrives.

Check that the status is ACTIVE before you submit a payout to that destination. If it is not, wait for payment_source.beneficiary.updated.

You can also retrieve the destination:

curl --request GET \
  --url 'https://sandbox.leantech.me/payouts/v1/payment/destinations/<DESTINATION_ID>' \
  --header 'Authorization: Bearer <ACCESS_TOKEN>'

Get Payout Destination API reference →

2. Submit a payout

Submit the source account, destination, amount and authorisation choice:

curl --request POST \
  --url 'https://sandbox.leantech.me/payouts/v1/payment' \
  --header 'Authorization: Bearer <ACCESS_TOKEN>' \
  --header 'Content-Type: application/json' \
  --header 'idempotency-key: <UNIQUE_REQUEST_KEY>' \
  --data '{
    "payment_details": [
      {
        "account_id": "<SOURCE_ACCOUNT_ID>",
        "destination_details": [
          {
            "payment_destination_id": "<DESTINATION_ID>",
            "amount": 100.00,
            "description": "Customer withdrawal",
            "authorize_payment": false
          }
        ]
      }
    ]
  }'
FieldPurpose
account_idThe connected source account that funds the payout.
payment_destination_idThe Payout Destination that receives the funds.
amountThe amount to send.
descriptionThe payment reference. Maximum 32 characters.
authorize_paymenttrue for automatic authorisation, false for manual authorisation in the Lean Dashboard. Defaults to false.

The response includes a payment_intent_id for each payout and a payment_id that may be null at this point. Store the payment_intent_id against your own transaction, and add the payment_id when it is available.

Create Payout API reference →

Protect retries with idempotency

Send an idempotency-key header of 50 characters or fewer with every request.

  • Use a new key for each new payout.
  • When you retry the same request, send the same key and the same body.
  • If a request times out, check whether the payout was created before you submit it again with a new key. A missing response does not mean the request failed.

3. Authorise the payout

Every payout is authorised in Lean before Lean submits it to your bank. Two options are available, and you choose one for each payout with authorize_payment.

OptionRequest settingWhat happens next
Automatic authorisationauthorize_payment: trueLean authorises the payout and submits it to your bank straight away. The first webhook shows the bank's response.
Manual authorisation in the Lean Dashboardauthorize_payment: falseThe payout waits with status AWAITING_AUTHORIZATION until a permitted Dashboard user approves it. Lean then submits it to your bank.

Because the choice is made per payout, you can combine both. For example, authorise transfers between your own accounts automatically and hold payouts to third parties for manual approval.

Payouts cannot be approved in your bank's portal. Approve them in the Lean Dashboard.

Limit manual approval to the team members who should approve payments. Before approving, check the beneficiary, amount and description.

4. Track the payout

Use payment.created and payment.updated to follow each payout. Read the status fields in the payload. The event name alone does not tell you whether the payout succeeded.

Initiation status

The status field shows where the payout is in authorisation and submission to the bank.

StatusMeaningWhat to do
AWAITING_AUTHORIZATIONThe payout is waiting for manual approval.Approve it in the Lean Dashboard.
PENDING_WITH_BANKThe payout has been submitted and is pending with the bank.Wait for post_initiation_status. Do not create a replacement because it is still pending.
ACCEPTED_BY_BANKThe bank has accepted the payout.Wait for post_initiation_status.
FAILEDAuthorisation or submission failed.Treat the payout as failed. Review the failure details before creating a new payout.

Final outcome

post_initiation_status reports the final outcome after the payout has been submitted to the bank.

ValueMeaningWhat to do
nullNo final outcome yet.Keep tracking.
PROCESSEDThe bank reports the payout as completed.Treat the payout as successful.
REJECTEDThe bank rejected the payout after accepting it.Treat the payout as failed. Create a new payout if you still need to pay the beneficiary.

An update can contain status: ACCEPTED_BY_BANK and post_initiation_status: REJECTED. Check both fields, so that the bank's initial acceptance does not hide a later rejection.

Lean enables final-outcome updates for your application during setup. Confirm with Lean that they are enabled before you go live.

Processing time depends on your bank and the payment rail. Transfers submitted outside your bank's cut-off times, at weekends or on public holidays may complete on the next business day.

Process updates safely

  • Match each event to your stored identifiers.
  • Expect the same event more than once, and events out of order. Apply the duplicate-handling rules in the webhooks guide.
  • Keep the payout outcome separate from the business action it triggers. For example, repeated notifications must not deduct a withdrawal from your customer's balance more than once.

5. Retrieve payouts and payment history

Use API lookups to investigate a payout or recover after missed webhooks.

List payouts

curl --request GET \
  --url 'https://sandbox.leantech.me/payouts/v1/payments?page_number=0&page_size=50' \
  --header 'Authorization: Bearer <ACCESS_TOKEN>'

You can filter by amount, creation time and update time. Retrieve every page when checking a time window.

List Payouts API reference →

Retrieve payment history

curl --request GET \
  --url 'https://sandbox.leantech.me/payouts/v1/payments/<PAYMENT_ID>/history' \
  --header 'Authorization: Bearer <ACCESS_TOKEN>'

The history shows each status change, so you can compare it with the updates your application processed.

Payment History API reference →

6. Handle failures and uncertain outcomes

IssueWhat to do
The beneficiary is not ACTIVEWait for payment_source.beneficiary.updated or retrieve the destination. Do not submit the payout until it is active.
The request is rejectedRead the error response and correct the request or configuration.
The payout is AWAITING_AUTHORIZATIONApprove it in the Lean Dashboard.
The payout is FAILEDReview the failure details and resolve the cause. Create a new payout, with a new idempotency key, only if you still need to pay.
post_initiation_status is REJECTEDTreat the payout as failed. Create a new payout only if you still need to pay.
The payout stays PENDING_WITH_BANKKeep tracking through webhooks and API lookups. Contact Lean Support if the outcome remains unresolved.
The submission times outCheck for an existing payout and follow the idempotency guidance before retrying.
A webhook is missedRetrieve the payout and its history. You can also resend webhooks from the Lean Dashboard or recover event records through the Events API.

When contacting Lean Support, include the environment, request time, payment_intent_id, payment_id and any correlation ID.

Test your integration

Before going live, test in Sandbox:

  • Creating a Payout Destination and handling the beneficiary webhooks.
  • Automatic authorisation and manual authorisation in the Dashboard.
  • Processed and rejected final outcomes.
  • Request timeouts and duplicate-submission protection.
  • Repeated, delayed and missed webhooks.

Testing with your bank's UAT environment is a separate step that Lean runs with you during setup. Lean also makes two go-live test payouts on your production connection, with your approval.

Test your integration →

Next steps

To return funds from an eligible reconciled payment to its original account, use the refund flow.

Issue and manage refunds →


Did this page help you?