Get Order
curl --request GET \
--url https://api.jup.ag/swap/v2/order \
--header 'x-api-key: <api-key>'import requests
url = "https://api.jup.ag/swap/v2/order"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.jup.ag/swap/v2/order', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.jup.ag/swap/v2/order",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.jup.ag/swap/v2/order"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.jup.ag/swap/v2/order")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jup.ag/swap/v2/order")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"mode": "<string>",
"inputMint": "<string>",
"outputMint": "<string>",
"inAmount": "<string>",
"outAmount": "<string>",
"inUsdValue": 123,
"outUsdValue": 123,
"priceImpact": 123,
"swapUsdValue": 123,
"otherAmountThreshold": "<string>",
"swapMode": "<string>",
"slippageBps": 123,
"priceImpactPct": "<string>",
"routePlan": [
{
"swapInfo": {
"ammKey": "<string>",
"label": "<string>",
"inputMint": "<string>",
"outputMint": "<string>",
"inAmount": "<string>",
"outAmount": "<string>"
},
"percent": 123,
"bps": 123,
"usdValue": 123
}
],
"referralAccount": "<string>",
"feeMint": "<string>",
"feeBps": 123,
"platformFee": {
"amount": "<string>",
"feeBps": 123,
"feeMint": "<string>"
},
"signatureFeeLamports": 123,
"signatureFeePayer": "<string>",
"prioritizationFeeLamports": 123,
"prioritizationFeePayer": "<string>",
"rentFeeLamports": 123,
"rentFeePayer": "<string>",
"swapType": "aggregator",
"router": "metis",
"transactionVersion": 0,
"transaction": "<string>",
"lastValidBlockHeight": "<string>",
"gasless": true,
"requestId": "<string>",
"totalTime": 123,
"taker": "<string>",
"quoteId": "<string>",
"maker": "<string>",
"expireAt": "<string>",
"errorCode": 123,
"errorMessage": "<string>",
"error": "<string>"
}{
"requestId": "<string>",
"error": "<string>"
}Meta-Aggregator
Get Order (Swap API)
Get a swap quote and assembled transaction
GET
/
order
Get Order
curl --request GET \
--url https://api.jup.ag/swap/v2/order \
--header 'x-api-key: <api-key>'import requests
url = "https://api.jup.ag/swap/v2/order"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.jup.ag/swap/v2/order', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.jup.ag/swap/v2/order",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.jup.ag/swap/v2/order"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.jup.ag/swap/v2/order")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jup.ag/swap/v2/order")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"mode": "<string>",
"inputMint": "<string>",
"outputMint": "<string>",
"inAmount": "<string>",
"outAmount": "<string>",
"inUsdValue": 123,
"outUsdValue": 123,
"priceImpact": 123,
"swapUsdValue": 123,
"otherAmountThreshold": "<string>",
"swapMode": "<string>",
"slippageBps": 123,
"priceImpactPct": "<string>",
"routePlan": [
{
"swapInfo": {
"ammKey": "<string>",
"label": "<string>",
"inputMint": "<string>",
"outputMint": "<string>",
"inAmount": "<string>",
"outAmount": "<string>"
},
"percent": 123,
"bps": 123,
"usdValue": 123
}
],
"referralAccount": "<string>",
"feeMint": "<string>",
"feeBps": 123,
"platformFee": {
"amount": "<string>",
"feeBps": 123,
"feeMint": "<string>"
},
"signatureFeeLamports": 123,
"signatureFeePayer": "<string>",
"prioritizationFeeLamports": 123,
"prioritizationFeePayer": "<string>",
"rentFeeLamports": 123,
"rentFeePayer": "<string>",
"swapType": "aggregator",
"router": "metis",
"transactionVersion": 0,
"transaction": "<string>",
"lastValidBlockHeight": "<string>",
"gasless": true,
"requestId": "<string>",
"totalTime": 123,
"taker": "<string>",
"quoteId": "<string>",
"maker": "<string>",
"expireAt": "<string>",
"errorCode": 123,
"errorMessage": "<string>",
"error": "<string>"
}{
"requestId": "<string>",
"error": "<string>"
}Authorizations
Get API key via https://developers.jup.ag/portal
Query Parameters
- The public key of the account that will receive the output tokens
- Must differ from
taker - Expects a wallet address, not a token account
- For non-SOL output: tokens are sent to the receiver's associated token account (ATA). If the ATA is not initialised, a create ATA instruction is added to the transaction
- For SOL output: native SOL is transferred directly to the receiver
- Does not support destination wSOL token accounts
- Disables Dflow and OKX routing. Metis and JupiterZ RFQ still compete
- Address of your referral account for the Jupiter referral project
- Must be used together with
referralFee - See the Referral Program for setup
- The public key of an account that will cover gas-related fees (signature fees, priority fees, and rent) on behalf of the taker
- Has no effect when set equal to
taker. Must be a different wallet to activate integrator-sponsored gas - Disables Dflow and OKX routing. Metis and JupiterZ RFQ still compete
- On JupiterZ routes the market maker pays signature and priority fees, and
payeronly pays rent for the output token accounts the transaction creates. When the output is native SOL there are none, sopayeris not a signer - Sign with
payeronly if it is a required signer of the returned transaction
- Comma-separated list of DEXes to exclude from the Metis router
- Important: This only affects the Metis router, not other routers
- For example:
excludeDexes=Raydium,Orca+V2,Meteora+DLMM - Labels are case sensitive (
SolFi, notsolfi). Full list of DEXes here using the/program-id-to-labelendpoint. - On
/orderonlyexcludeDexesis honoured, notdexes. Use/buildto restrict routing to specific DEXes.
- The highest Solana transaction version your client can accept,
"0"or"1". Defaults to"0". - This is a ceiling, not a force. You get v1 only when Metis wins the route and the order is not gasless; other routers and gasless orders (including automatic sponsorship for low-SOL takers) return v0. Wider v1 support is in progress.
- Read the response
transactionVersionto see the version you got. v1 transactions must be deserialized and signed with a v1-capable SDK (@solana/kitv8 or later).
Available options:
0, 1 Response
Quote with optional assembled transaction
True when signature and priority fees are paid by a wallet other than the taker. Set by three independent paths:
- Automatic Jupiter sponsorship:
signatureFeePayer = gasTzr94Pmp4Gf8vknQnqxeYxdgwFjbgdJa4msYRpnB - JupiterZ market maker:
signatureFeePayeris the MM address (varies per quote); Jupiter's gas wallet can pay the rent to create the taker's output token account when referral fees are not set - Integrator payer:
signatureFeePayeris yourpayerparameter on Metis routes. On JupiterZ routessignatureFeePayeris the MM address andrentFeePayeris yourpayerFor a deterministic opt-out, checksignatureFeePayer == takeron every response.
Present when taker is defined and transaction is the empty string. The router quoted a price but could not build a transaction. Match on router + errorCode to identify the error.
Aggregator routers (router is metis, dflow, okx):
- 1: Insufficient funds
- 2: Insufficient SOL for gas
- 3: Swap below minimum for gasless
JupiterZ router (router is jupiterz):
- 1: Insufficient balance to fund the swap
- 2: Missing associated token account
- 3: Quote could not be built into a transaction
Was this page helpful?
