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

# getPayoutQuote

> Requests a Noah payout quote for a channel and form responses.

## Function Signature

`NoahGetPayoutQuoteRequest` has two initializers. Choosing one selects whether the quote is denominated in fiat or crypto — passing both amounts, or neither, will not compile.

```swift theme={null}
public func getPayoutQuote(request: NoahGetPayoutQuoteRequest) async throws -> NoahGetPayoutQuoteResponse

// Quote a fiat amount to receive
public init(
  channelId: String,
  cryptoCurrency: String,
  fiatAmount: String,
  quoted: Bool? = nil,
  form: [String: AnyCodable]? = nil,
  fiatCurrency: String? = nil,
  paymentMethodId: String? = nil,
  formSessionId: String? = nil,
  businessFee: NoahBusinessFee? = nil
)

// Quote a crypto amount to sell
public init(
  channelId: String,
  cryptoCurrency: String,
  cryptoAmount: String,
  quoted: Bool? = nil,
  form: [String: AnyCodable]? = nil,
  fiatCurrency: String? = nil,
  paymentMethodId: String? = nil,
  formSessionId: String? = nil,
  businessFee: NoahBusinessFee? = nil
)
```

## Description

Requests fees and crypto amount estimates for a payout on a given channel. Include `form` when the channel requires recipient data — fetch its schema with [`getPayoutChannelForm`](./noahgetpayoutchannelform) or read the inline `formSchema` on the channel.

The returned `payoutId` and `formSessionId` feed into [`initiatePayout`](./noahinitiatepayout).

## Parameters

| Parameter                 | Type                    | Required                              | Description                                                                                                |
| ------------------------- | ----------------------- | ------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| `request.channelId`       | `String`                | Yes                                   | Payout channel id from `getPayoutChannels`.                                                                |
| `request.cryptoCurrency`  | `String`                | Yes                                   | Crypto asset for the quote.                                                                                |
| `request.fiatAmount`      | `String`                | One of `fiatAmount` or `cryptoAmount` | Fiat amount to receive, as a string.                                                                       |
| `request.cryptoAmount`    | `String`                | One of `fiatAmount` or `cryptoAmount` | Crypto amount to sell, as a string.                                                                        |
| `request.quoted`          | `Bool?`                 | No                                    | Request a signed, rate-locked quote. Required if you intend to submit the payout with a `.quoted` trigger. |
| `request.form`            | `[String: AnyCodable]?` | No                                    | Recipient fields from the channel form.                                                                    |
| `request.fiatCurrency`    | `String?`               | No                                    | Fiat currency override when needed.                                                                        |
| `request.paymentMethodId` | `String?`               | No                                    | Saved payment method to attach to the quote.                                                               |
| `request.formSessionId`   | `String?`               | No                                    | Existing form session to continue, for multi-step forms.                                                   |
| `request.businessFee`     | `NoahBusinessFee?`      | No                                    | Business fee override. Forwarded to Noah as `BusinessFee`.                                                 |

## Returns

**`NoahGetPayoutQuoteResponse`** — an envelope containing:

| Property   | Type                     | Description                 |
| ---------- | ------------------------ | --------------------------- |
| `data`     | `NoahGetPayoutQuoteData` | The response payload.       |
| `metadata` | `NoahResponseMetadata?`  | Freeform response metadata. |

`NoahGetPayoutQuoteData`:

| Property                 | Type                              | Description                                                                                            |
| ------------------------ | --------------------------------- | ------------------------------------------------------------------------------------------------------ |
| `payoutId`               | `String`                          | Identifier to pass to `initiatePayout`.                                                                |
| `totalFee`               | `String`                          | Total fee for the payout.                                                                              |
| `cryptoAmountEstimate`   | `String`                          | Estimated crypto amount required.                                                                      |
| `cryptoAuthorizedAmount` | `String`                          | Crypto amount the client is authorized to send for this quote.                                         |
| `formSessionId`          | `String`                          | Form session identifier for multi-step flows.                                                          |
| `cryptoCurrency`         | `String?`                         | Crypto currency the quote was priced in.                                                               |
| `fiatCurrency`           | `String?`                         | Fiat currency the quote was priced in.                                                                 |
| `fiatAmount`             | `String?`                         | Resolved fiat amount for the quote.                                                                    |
| `rate`                   | `String?`                         | Exchange rate applied to the quote.                                                                    |
| `breakdown`              | `[NoahTransactionBreakdownItem]?` | Fee line items. Each has `type` (`ChannelFee`, `BusinessFee`, or `Remaining`) and `amount`.            |
| `quote`                  | `NoahSellQuote?`                  | Signed quote — `signedQuote: String` and `expiry: String`. Present when `quoted` was `true`.           |
| `nextStep`               | `NoahFormNextStep?`               | Next step in a multi-step form — `stepId`, `stepType` (`.ack` or `.dataEntry`), and optional `schema`. |

## Example

```swift theme={null}
import PortalSwift

do {
  let quote = try await portal.ramps.noah.getPayoutQuote(
    request: NoahGetPayoutQuoteRequest(
      channelId: "ch-1",
      cryptoCurrency: "USDC_TEST",
      fiatAmount: "10"
    )
  )

  print("Payout: \(quote.data.payoutId)")
  print("Send: \(quote.data.cryptoAuthorizedAmount)")
  print("Fee: \(quote.data.totalFee)")

  for item in quote.data.breakdown ?? [] {
    print("  \(item.type): \(item.amount)")
  }
} catch {
  print("getPayoutQuote failed: \(error)")
}
```

Request a rate-locked quote when the payout will use a `.quoted` trigger:

```swift theme={null}
let quote = try await portal.ramps.noah.getPayoutQuote(
  request: NoahGetPayoutQuoteRequest(
    channelId: "ch-1",
    cryptoCurrency: "USDC_TEST",
    cryptoAmount: "10.5",
    quoted: true
  )
)

let signedQuote = quote.data.quote?.signedQuote
```

## Errors

| Error                                           | Description                                                                                  |
| ----------------------------------------------- | -------------------------------------------------------------------------------------------- |
| `PortalRequestsError.unauthorized`              | Authentication failed (401).                                                                 |
| `PortalRequestsError.clientError`               | Client error (4xx). Missing required form fields, or an amount outside the channel's limits. |
| `PortalRequestsError.internalServerError`       | Server error (5xx).                                                                          |
| `PortalRequestsError.couldNotParseHttpResponse` | The response could not be parsed.                                                            |
| `URLError.badURL`                               | The request URL could not be built.                                                          |

## Related

* [Noah virtual accounts and payouts](../guide/noah)
* [getPayoutChannelForm](./noahgetpayoutchannelform)
* [initiatePayout](./noahinitiatepayout)
* [Noah payouts workflow](/integrations/On-Off-Ramp/noah-payouts)
