GetExactOutputRoutes will return a list of origin tokens, when given a destination chain and token,
Routes & Tokens
GetExactOutputRoutes
POST
GetExactOutputRoutes will return a list of origin tokens, when given a destination chain and token,
Documentation Index
Fetch the complete documentation index at: https://anypay-trails-api-docs.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Overview
TheGetExactOutputRoutes endpoint retrieves available token routes for exact output swaps. Given a destination token, it returns all source tokens that can be swapped to achieve that exact output amount. This is essential for building UIs where users specify exactly how much they want to receive.
Use Cases
- Build “I want to receive exactly X tokens” interfaces
- Find which source tokens can route to a specific destination
- Payment flows where exact amounts are required
- Invoice payments requiring precise token amounts
- DeFi integrations with fixed deposit amounts
Request Parameters
Required Fields
- destinationChainId (number): The chain ID of the destination token
- destinationTokenAddress (string): The token address to receive
Optional Fields
- originChainId (number): Filter routes by source chain
- originTokenAddress (string): Filter to routes from a specific token
- ownerAddress (string): User’s wallet address (for balance-aware filtering)
Response
The response includes:- tokens (TokenInfo[]): Array of source tokens that can route to the destination
TokenInfo Object Structure
Each token object contains:- chainId (number): Chain where the token exists
- address (string): Token contract address
- name (string): Token name
- symbol (string): Token symbol
- decimals (number): Token decimals
- supportsBridging (boolean, optional): Whether the token supports cross-chain bridging
- logoUri (string, optional): URL to token logo
- featured (boolean): Whether this is a featured/popular token
- featureIndex (number): Sort order for featured tokens
Examples
Find Source Tokens for USDC on Base
Filter by Source Chain
Build Payment Source Selector
Check Specific Route Availability
When to Use Exact Output
UseGetExactOutputRoutes when:
- User needs to receive a specific amount (e.g., paying a $100 invoice)
- Protocol requires exact deposit amounts
- NFT purchases with fixed prices
- Subscription payments with fixed amounts
GetExactInputRoutes when:
- User wants to spend a specific amount
- “Swap all” functionality
- User specifies how much to send
Next Steps
GetExactInputRoutes
Find routes based on input amount
QuoteIntent
Get a quote with EXACT_OUTPUT trade type