# Flexible Amount Inputs

The Native API allows you to specify **either the fiat amount or the crypto amount** when calculating a conversion. This choice determines how the quote is calculated and must be carried through to the ramp request.

You provide either `fiatAmount` or `cryptoAmount` when requesting a price, and you include that same value again when creating the ramp.

This guide explains how these inputs work across both endpoints.

## Overview

When requesting a price, you can choose to fix one side of the trade:

#### Fiat-fixed

- The user enters or confirms a fiat value
- Use `fiatAmount`
- The API returns the corresponding crypto amount


#### Crypto-fixed

- The user wants to buy or sell an exact amount of crypto
- Use `cryptoAmount`
- The API returns the required fiat value


Whichever parameter you use in the price request must also be used in the transfer request.
Only one parameter may be included per request.

## Choosing the Correct Input

Use **`fiatAmount`** when:

- The user is spending a fixed amount of fiat (e.g. "Buy with 100 AUD")
- The user wants to receive a fixed fiat payout (e.g. "Withdraw 100 EUR")
- Your UI is fiat-led


Use **`cryptoAmount`** when:

- The user wants an exact crypto amount (e.g. "I want 200 USDT")
- Your UI is crypto-led


## Using Flexible Amount Inputs with GET `/eapi/v0/price`

Price requests support both input types.

#### Fiat-fixed quote

Use this when the user specifies how much fiat they want to spend.


```http
GET /eapi/v0/price?identityReference=c-13344
&fiat=AUD
&crypto=USDT
&blockchain=TRON
&method=payid-bank-transfer
&transactionType=ONRAMP
&fiatAmount=100
```

#### Crypto-fixed quote

Use this when the user wants to buy or sell a specific amount of crypto.


```http
GET /eapi/v0/price?identityReference=c-13344
&fiat=AUD
&crypto=USDT
&blockchain=TRON
&method=payid-bank-transfer
&transactionType=ONRAMP
&cryptoAmount=200
```

## Using Flexible Amount Inputs with POST `/eapi/v0/ramps`

Ramps follow the same rules as price requests:

- Include either `fiatAmount` or `cryptoAmount`
- Use the same value you displayed in the quote


#### Fiat-fixed On-ramps


```json
{
  "subPartnerId": "2125",
  "identityReference": "c-13344",
  "source": {
    "fiat": { "id": "AUD", "method": "payid-bank-transfer" }
  },
  "target": {
    "crypto": {
      "id": "USDT",
      "blockchain": "TRON",
      "walletAddress": "TXY8P6mV3z5d3oF5kZNhRZVz6d12KkL5K9"
    }
  },
  "fiatAmount": "100"
}
```

#### Crypto-fixed On-ramps


```json
{
  "subPartnerId": "2125",
  "identityReference": "c-13344",
  "source": {
    "fiat": {
      "id": "AUD",
      "method": "payid-bank-transfer"
    }
  },
  "target": {
    "crypto": {
      "id": "USDT",
      "blockchain": "TRON",
      "walletAddress": "TXY8P6mV3z5d3oF5kZNhRZVz6d12KkL5K9"
    }
  },
  "cryptoAmount": "200"
}
```

#### Fiat-fixed Off-ramps


```json
{
  "subPartnerId": "2125",
  "identityReference": "c-13344",
  "source": {
    "crypto": {
      "id": "USDT",
      "blockchain": "TRON",
      "walletAddress": "0xc292474673cf1a96a96e8c56ec4f45ecf2e0b448"
    }
  },
  "target": {
    "fiat": {
      "id": "AUD",
      "method": "payid-bank-transfer",
      "instructions": {
        "accountName": "John Citizen",
        "accountNumber": "12345678",
        "bsb": "26195"
      }
    }
  },
  "fiatAmount": "100"
}
```

#### Crypto-fixed Off-ramps


```json
{
  "subPartnerId": "2125",
  "identityReference": "c-13344",
  "source": {
    "crypto": {
      "id": "USDT",
      "blockchain": "TRON",
      "walletAddress": "0xc292474673cf1a96a96e8c56ec4f45ecf2e0b448"
    }
  },
  "target": {
    "fiat": {
      "id": "AUD",
      "method": "payid-bank-transfer",
      "instructions": {
        "accountName": "John Citizen",
        "accountNumber": "12345678",
        "bsb": "26195"
      }
    }
  },
  "cryptoAmount": "200"
}
```

## End-to-End Examples

#### On-Ramp: User spends a fixed fiat amount

1. Request a quote with `fiatAmount=100`
2. Create a ramp using the same `fiatAmount=100`
3. User pays 100 AUD
4. User receives the calculated crypto amount


#### Off-Ramp: User receives a fixed fiat amount

1. Request a quote with `fiatAmount=100`
2. Create a ramp using `fiatAmount=100`
3. User sends the required crypto amount
4. User receives 100 AUD into their payout method


#### Crypto-fixed behaviour

The same logic applies when fixing the crypto amount.
If a user specifies a crypto value, the API calculates the equivalent fiat amount in both directions.

## Summary Table

| Scenario | Fixed Side | Parameter | Notes |
|  --- | --- | --- | --- |
| On-Ramp | Fiat | `fiatAmount` | Spend a fixed fiat amount |
| Off-Ramp | Fiat | `fiatAmount` | Receive a fixed fiat amount |
| On-Ramp | Crypto | `cryptoAmount` | User receives a fixed crypto amount |
| Off-Ramp | Crypto | `cryptoAmount` | User sells a fixed crypto amount |


## Best Practices

- Pass only one amount parameter per request
- Use the same parameter and value for both the price and ramp
- Avoid caching price responses for long; prices are not binding
- Ensure your UI clearly shows which side of the trade is fixed


## Locking the rate for price integrity

The `fiatAmount`/`cryptoAmount` approach re-calculates the rate at ramp creation time. If price integrity between display and execution matters for your UX, use the quote ID flow instead — see [Pricing & Quote ID](/products/native-api/docs/how-it-works/quotes-and-pricing).