> For the complete documentation index, see [llms.txt](https://docs.goassay.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.goassay.ai/developers/under-the-hood/settlement.md).

# Settlement and the hold window

Understand customer escrow, payment holds, provider collection, refunds and owed calls.

Escrow is customer money held by the payment contract for calls. A call can return data before its checks finish, and it can pass those checks before the provider is paid. Keep the service verdict, payment hold and collection status separate when reading a receipt.

## How money moves

The local paid-call path uses **USDG** on **Robinhood Chain**. Your wallet approves a payment key with caps and an expiry. That key can sign individual payments; it cannot withdraw the customer's balance.

| Stage                 | Where the money stands                                                                                           | What comes next                                              |
| --------------------- | ---------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| Funded escrow         | Customer balance in the contract.                                                                                | Available for authorized calls, subject to limits.           |
| Call reservation      | Assay reserves the call amount before contacting the provider.                                                   | Result checks decide whether to release it or allow payment. |
| Served and settled    | The call is allowed to charge. The signed payment may still await redemption.                                    | Assay submits it on chain.                                   |
| On-chain payment hold | Redemption removes the amount from customer balance and stores a held payment. The provider has not received it. | Collect after the hold, or refund while permitted.           |
| Collected             | Contract transfers the provider share to the payout wallet and the fee to the treasury.                          | That held payment can no longer be refunded.                 |
| Refunded              | A held payment returns in full to customer escrow, or a pre-redemption reservation is released.                  | The provider receives no payment for it.                     |

The take rate is frozen when a payment is redeemed. Collection uses that rate even if the configured rate changes later. A held-payment refund restores the customer balance, but does not restore spending-window capacity already consumed on chain.

## The hold window

The default hold is **one hour from on-chain redemption**, not from the time your agent received the answer. Each payment stores its own `collectableAt`; a later configuration change does not move that deadline.

Assay does not collect a payment held for an open or upheld qualifying report. If the report is upheld while a refund is possible, the redeemer returns the full held amount to customer escrow. A blocked provider's still-held payments are also refunded rather than collected.

| Timing                     | Rule                                                                                                                                    |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| Default hold               | 3,600 seconds.                                                                                                                          |
| Configurable hold          | 60–86,400 seconds for new redemptions.                                                                                                  |
| Guaranteed filing deadline | Before `collectableAt` minus 60 seconds, subject to the receipt's eligibility state. A served call awaiting redemption can qualify too. |
| Ordinary collection        | The designated redeemer can collect from `collectableAt`.                                                                               |
| Contract backstop          | From `collectableAt` plus 7 days, anyone can collect to the recorded provider; pause and block checks still apply.                      |
| Contract refund cutoff     | At `collectableAt` plus 7 days, `refundHeld` closes permanently.                                                                        |

Use the receipt's reporting deadline rather than calculating your own from the default. A report filed later may affect provider quality without guaranteeing a refund. The application holds collection for a report; the contract's public collection backstop does not read the application's dispute state.

## When collection fails

A signature can become uncollectable even after a call was served. The outcome depends on the cause:

| State                                          | Customer funds                                                                                              | Provider payment and future calls                                                                |
| ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| Still retrying or transaction outcome unknown  | Reservation stays open.                                                                                     | Assay checks the chain before deciding whether another send is needed.                           |
| Provider forfeited payment                     | Reservation released; customer is not charged.                                                              | Nobody is credited.                                                                              |
| Owed call (`DEBT_OUTSTANDING`)                 | Amount stays reserved after the original signing window lapses for a reason not attributed to the provider. | Provider is unpaid; new paid calls stop until replacement payment succeeds. Free calls continue. |
| Written off after 30 days from lapse           | Reservation released.                                                                                       | Provider remains unpaid. The call is still owed and still blocks paid calls.                     |
| Debt voided by a later refund or void decision | Reservation released.                                                                                       | No amount is owed for that voided debt.                                                          |

To settle an owed call, use the Assay app's funding flow to sign a replacement payment for the same served call. It keeps the provider, amount and request identity. It does not run the provider again. A written-off debt needs a new reservation because the original one was released. Assay does not advance its own money to pay these providers.

## Provider payouts and finality

For this contract payment path, collection transfers the provider's share directly to the payout wallet. A backend `SETTLED` call is a service decision; it is not proof that this transfer happened. Provider credit is booked after the chain reports collection.

A submitted transaction is also different from a successful receipt. Deposits become spendable only after the backend's finality check, using the configured confirmation depth or finalized block head. Redemption and collection have their own transaction checks. There is no single fixed wall-clock time that makes every stage final.

<details>

<summary>Optional: withdrawal and permission delays</summary>

Customer withdrawals use a request followed by a one-hour wait and a claim. A pending withdrawal excludes paid routing on that chain. Lowering caps or revoking a payment key also preserves earlier on-chain authority for a one-hour tightening delay, bounded by the key's expiry. The backend refuses new payments from a revoked key even during that contract delay. See [Spending limits](/developers/use-tools-get-started/spending-limits.md) for the distinction between local signing limits and contract caps.

</details>

## Go further

* [How paying works](/developers/use-tools-get-started/how-paying-works.md)
* [Retries and idempotency](/developers/use-tools-advanced/retries-and-idempotency.md)

## Next

* [Smart contracts](/developers/reference/smart-contracts.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.goassay.ai/developers/under-the-hood/settlement.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
