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

# Settlements and payouts

> Captures flush into a settleBatch. Fulfill the order only when the poll says CONFIRMED.

SohoPay settles USDC on Base by batch. About every 60 seconds the flusher folds outstanding captures into one `SohoSettlementV2.settleBatch` transaction. The merchant is paid the net amount (`amount - fee`) to the registry payout address. The borrower's debt increases by the billed amount.

You never submit that transaction. You poll.

## Poll

```bash
curl https://staging.api.sohopay.ai/api/v1/facilitator/settle/status/by-payment/$PAYMENT_ID \
  -H "Authorization: Bearer $SOHO_API_KEY"
```

`paymentId` comes from the capture receipt and is valid immediately. Poll about every 2 seconds. The same status is available by batch job id at `GET /api/v1/facilitator/settle/status/:jobId` once a batch exists. Agents can poll `get_settlement_status` instead of the facilitator.

## What each status means

| Status | Meaning | Fulfill? |
| - | - | - |
| `CREATED` | Captured, waiting for the next flush. | No |
| `SUBMITTED` | Batch broadcast. `txHash` may be set. Still confirming. | No |
| `CONFIRMED` | The batch entry is `SETTLED`. | Yes |
| `FAILED` | The entry was rejected, or the batch failed in a way that does not requeue this entry. | No |
| `TIMED_OUT` | Not confirmed in the recovery window. | No. Wait for SohoPay recovery or support. |
| `DISPUTED` | Settlement providers disagreed on the receipt. | No. Needs review. |

`CREATED` and `SUBMITTED` are normal. An entry left pending in a failed batch can return to `CREATED` and be included in a later flush.

Under `l2_confirmations`, expect `CONFIRMED` on the order of a few seconds after a successful receipt, with end-to-end time usually under 30 seconds once the batch is submitted. The flush interval sits in front of that. Do not treat "\~1 second" as a guarantee.

Available credit on the borrower updates when the entry is `CONFIRMED`, not when the voucher is signed.

## Payout

The contract pays the `ACTIVE` merchant the net amount from protocol liquidity. Gas for that transaction is paid by the protocol. Your payout is net of the [fee](/compliance/fees.md).

## Next steps

> [card] [Fees](/compliance/fees.md)
>
> How the deducted fee is calculated.

> [card] [Settlement attestation](/protocol/settlement-attestation.md)
>
> Who signs the batch.
