> ## Documentation Index
> Fetch the complete documentation index at: https://docs.easner.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Holding funds until the work is done

> How a freelancer platform or marketplace takes a client's payment and pays the person after the work is approved.

Easner has no escrow object. A client payment lands on your Business balance through [Checkout](https://docs.easner.com/checkout.md). A [credit](https://docs.easner.com/connect-money.md) only records what you owe a person, and a [payout](https://docs.easner.com/connect-money.md#payouts) sends that amount to the Easner account they linked. The condition that releases the money — the client approved the work, a milestone cleared, a dispute closed — lives in your own job record.

Use this when a freelancer platform, marketplace, or gig site takes the client's money first and pays the person later. For a label, affiliate, or creator payout with no client payment sitting on the job, follow [Platform patterns](https://docs.easner.com/connect-patterns.md) and credit when you already know the earning.

> [!NOTE]
>
> **Scopes:** `checkout` and `refunds.write` for the client's payment. `payees.write` to create the person, `payees.credit` to record the earning, `payouts.write` to pay it out. Live credits and payouts use your secret key. Amounts are whole cents in USD.

## Who does what

| Step | Where it lives |
| - | - |
| The client pays for the job | [Checkout](https://docs.easner.com/checkout.md). Funds land on your Business balance |
| The job is funded, in progress, released, refunded, or disputed | Your database. Store the Checkout session id on the job |
| The person who does the work | One Connect [payee](https://docs.easner.com/payees.md), created once, with your user id as `reference` |
| What you owe them after you release | A credit. Your fee is the part you never credit |
| The money in their Easner account | A payout from `payee_balance`. Fulfil the job on `payout.completed` |

The client's payment and every other funded job share one Business balance. Keep that balance at least as large as every job you have not released, plus every payee balance you have not paid out. If it falls short, the payout waits with `pending_reason: funds` and goes out on its own when you add money. The person sees Pending. They are not told your balance is short.

## Take the client's payment

Create the payee once, when the person joins. Open a link session and pass `client_secret` to `EasnerConnect.connect`. Later jobs use the same payee.

When the client pays, create a Checkout session for the full job amount and store `cs_…` on the job. Mark the job funded on [`checkout.completed`](https://docs.easner.com/webhook-events). Treat the money as spendable on [`payment.available`](https://docs.easner.com/webhook-events). Leave the payee balance at zero while the work is in progress.

A credit with `available_at` in the future is only a time hold. It ends when that time arrives. The client's approval is your status change, so create the credit at release.

## Release

Credit the person's share. Keep your fee on the Business balance by leaving it out of the credit. One `reference` per job means a retry returns the first credit.

```bash theme={null}
curl https://api.easner.com/v1/payees/pye_…/credits \
  -H "Authorization: Bearer $EASNER_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: job-1042" \
  -d '{ "amount": 85000, "reference": "job-1042", "description": "Logo project" }'
```

Then pay that balance out. A program set to payee requests pays when you, or the withdraw sheet, ask. A program set to automatic pays available earnings once a day.

```bash theme={null}
curl https://api.easner.com/v1/payouts \
  -H "Authorization: Bearer $EASNER_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: payout-job-1042" \
  -d '{ "payee": "pye_…", "amount": 85000, "source": "payee_balance" }'
```

The payout can still wait on a limit, a tax form, or a review rule. Fulfil on `payout.completed`. A `failed` payout restores both balances.

To let the person withdraw on your site, open a payout session and pass `client_secret` to [`EasnerConnect.withdraw`](https://docs.easner.com/connect-components).

A job with milestones is one Checkout payment and several releases. Credit each milestone as it is approved, with its own reference (`job-1042-m1`, `job-1042-m2`). The unreleased remainder stays in your job record.

## Cancel or dispute

You decide the outcome. Easner does not sit between the client and the person.

If you have not credited the person, leave the payee balance at zero and refund the Checkout payment. See [Refunds](https://docs.easner.com/refunds.md). The API refund works until the payment has been credited to your Business balance. After that, `POST /v1/refunds` returns `409 already_settled` and support does the refund. A job that runs for days is usually already settled by the time the client cancels.

If you already credited them and the credit is still available, reverse it with `POST /v1/credits/:id/reversals`. If the payout already completed, the reversal is recovered from their later credits. It does not pull the money back out of their Easner account.

## Expected

* Store the Checkout session on the job, and the credit id on the release.
* Credit the person's share when you release. Credit nothing while the job is only funded.
* Your fee is the amount you do not credit.
* Run [reconciliation](https://docs.easner.com/connect-ops.md) after each release day. Send what your ledger says each person is owed and has not been paid.
* A payout caught short of funds waits. It does not fail, and it does not take money from another person's Easner account.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.