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

# getFlowDeliveredAmount

> Read the amount a settled Flow payment delivered to your destination with the JavaScript SDK, with the token's symbol and decimals.

Returns what a settled flow actually delivered to your destination, with the token's symbol and decimals. Use it on the success screen. `getFlowDeliveredAmount` makes no request; it reads the flow you pass.

The delivered amount can differ from the quoted one. In `deposit` mode, a short deposit is accepted and settles for what arrived, so show and credit the delivered amount. In `payment` mode, a short payment is not accepted, so a completed flow was paid in full. [Payment lifecycle and states](https://www.dynamic.xyz/docs/flow/lifecycle-walkthrough.md#amounts-you-will-see) explains each amount.

## Usage

```javascript theme={"system"}
import { formatTokenAmount, getFlowDeliveredAmount } from '@dynamic-labs-sdk/client';

const delivered = getFlowDeliveredAmount({ flow });

if (delivered) {
  const amount = formatTokenAmount({
    rawAmount: delivered.amount,
    decimals: delivered.tokenInfo.decimals,
  });
  console.log(`${amount} ${delivered.tokenInfo.symbol} delivered`);
}
```

## Parameters

| Parameter | Type | Description |
| - | - | - |
| `flow` | `Flow` | The flow, as last read with `getFlow`. |

## Returns

`FlowDeliveredAmount | undefined`:

| Field | Type | Description |
| - | - | - |
| `amount` | `string` | The delivered amount, in the token's smallest unit. |
| `amountUsd` | `string` | The delivered amount in USD, when it was reported. |
| `tokenInfo` | `FlowTokenInfo` | The delivered token's `symbol`, `decimals`, and optional `name` and `logoURI`. |

It returns `undefined` when:

* the flow has not settled yet. `flow.settlement` is written only when settlement is `completed`.
* settlement did not report an amount. The provider does not always report one.
* the delivered token's details are unknown. They come from the settlement, or from the quote when the quote targeted the same chain and token.

When it returns `undefined` for a completed flow, show the quoted amount (`flow.quote.toAmount` with `flow.quote.toTokenInfo`), and the requested amount (`flow.amount`) when there is no quote, as for an exchange payment. [Build a custom payment UI](https://www.dynamic.xyz/docs/javascript/reference/flow-ui-guide.md#outcomes) shows the fallback.

## Related

* [`getFlow`](https://www.dynamic.xyz/docs/javascript/reference/client/get-flow#settlement-data): the `settlement` object.
* [Settlements](https://www.dynamic.xyz/docs/flow/settlements.md#what-was-delivered): what was delivered, and how your server reads it.


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