Skip to main content
In this section, you’ll learn how to execute a token swap using the transaction data returned from GET /v2/swap/quote.
Prerequisites: Complete the Get a Quote guide first. New integrations should request the quote with wallet addresses (and pixKey for fiat offramps) so executable fields are already in the quote response.

Overview

Recommended path: call GET /v2/swap/quote with originAddress and destinationAddress (crypto) or originAddress + pixKey (fiat offramp). The response includes id, chainId, and transactionData (and paymentInstructions for fiat onramps). Sign and submit those transactions — no second API call.
Trustless Operation: You sign and submit all transactions yourself. Pods never has custody of your funds.

Response fields from the quote

When addresses are supplied on the quote, the API returns transaction data ready to be signed and executed (alongside the nested quote object):

Response Fields

ID created for execution tracking. Use this ID with GET /actions/{id} when you need execution status after transactions are submitted.
Top-level numeric chain ID for the origin execution network. Each item in transactionData also has a per-leg chainId as a decimal string (for example "137"), matching the OpenAPI TransactionData schema — coerce with Number() when comparing to this top-level field or wallet APIs.
EVM routes return an array of transaction legs when output=bytecode (default). Batch all legs on the same chainId into one atomic transaction — see Executing Bytecode. Solana-origin routes return type: intra-chain-solana with transactionData.rawTransaction (base64). Request output=instructions on Solana-origin only to receive { instructions, lutsByAddress? } instead of a serialized transaction — EVM and fiat origins reject that output with OUTPUT_NOT_SUPPORTED. When output=fireblocks, returns a Fireblocks contract call payload instead of a transaction array. Typical EVM legs:
  • Approval: Grants permission to the swap contract
  • Swap: Executes the actual token swap
  • Tracking: Records the swap in Pods’s system
Present on fiat onramps (for example Pix). Show paymentInstructions.pix.copyPaste to the user. There is no EVM transactionData to sign on that path.
ERC-4337 user operation object. Only present when output=userOperation is requested on the quote.
The contract address to send the transaction to
Encoded transaction data for the contract call
Amount of native token to send (in wei). Usually “0” unless swapping native tokens.
quote.quoteId and top-level id identify different resources. quoteId tracks the saved swap quote and is the {id} for GET /v2/swap/status/{id}. The top-level id is used for Action execution tracking.

Transaction Execution

Sign and submit the transaction data on your end — Pods never has custody of your funds.
Execute atomically. Do not send each item in transactionData as a separate transaction. Batch all same-chain legs into one tx (EIP-7702, smart-account userOp, or Fireblocks batch). See Executing Bytecode.
Use EIP-7702 executeBatch to encode all transactionData legs into a single type-4 transaction.

Smart account — output=userOperation

Request output=userOperation on GET /v2/swap/quote together with the wallet addresses. Submit the returned userOperation through your bundler — one userOp, not a loop of separate sends.

Fireblocks — output=fireblocks

Pass accountId on the quote and submit transactionData to the Fireblocks Transactions API. See Fireblocks Integration.

Swap Types

The quote path automatically handles different swap types:
Same-chain swaps (e.g., USDT to USDC on Ethereum):
  • Usually 2-3 transactions: approve + swap (+ tracking)
  • Executes immediately on the same blockchain
  • Lower fees, faster execution

Complete Workflow

1

Get Quote with addresses

Call GET /v2/swap/quote with amount, tokens, chains, and originAddress + destinationAddress (or pixKey for fiat offramp). Save quote.quoteId and the top-level id.
2

Execute

For crypto routes, sign and send transactionData. For fiat onramps, show paymentInstructions to the user.
3

Track Status

Use GET /v2/swap/status/{quoteId} to monitor quote progress. Use GET /actions/{id} with the top-level id when you need Action execution status.

Advanced: POST /v2/swap/bytecode

New integrations should not need this endpoint. It remains available for older clients that obtained a price-only quote first. Prefer the one-call quote flow above.

Error Handling

The API returns appropriate error messages for:
  • Missing required parameters
  • Invalid or expired quote
  • Quote not found or already used
  • Provider-specific errors during transaction preparation
Example Error Response:
Always check that the quote hasn’t expired before executing. Quotes are typically valid for 5 minutes.

Next Steps

Get Another Quote

Start a new swap

Check Status

Track cross-chain swap progress

Code Examples

View complete implementation examples