Build Fusion order from quote

Builds a Fusion order from a previously received quote. Returns EIP-712 typed data that needs to be signed by the wallet to submit the order.

POSThttps://api.1inch.com/fusion/quoter/v2.0/{chain}/quote/build
Supported on:
EthereumBaseSolanaBNB ChainAvalancheZKsyncGnosisOptimismPolygonLineaSonicUnichainArbitrum

Parameters

chain
* number path
fee
number query
isPermit2
boolean query
preset
string (Enum)query
additionalAuctionStartDelay
number query
receiver
string query
permit
string query
feeReceiver
string query
walletAddress
* string query
amount
* string query
toTokenAddress
* string query
fromTokenAddress
* string query

Request Body

GetQuoteOutput object
quoteId
* object
fromTokenAmount
* string
toTokenAmount
* string
feeToken
* object
fee
*ResolverFee object
receiver
* string
bps
* number
whitelistDiscountPercent
* number
integratorFee
* number
integratorFeeReceiver
string
integratorFeeShare
* number
presets
* any
allOf[0]
QuotePresetsClass object
fast
* any
allOf[0]
PresetClass object
bankFee
* string
auctionDuration
* number
startAuctionIn
* number
initialRateBump
* number
auctionStartAmount
* string
startAmount
* string
auctionEndAmount
* string
exclusiveResolver
* object
tokenFee
* string
estP
* number
points
* array
items
AuctionPointClass object
delay
* number
coefficient
* number
allowPartialFills
* boolean
allowMultipleFills
* boolean
gasCost
*GasCostConfigClass object
gasBumpEstimate
* number
gasPriceEstimate
* string
medium
* any
allOf[0]
PresetClass object
bankFee
* string
auctionDuration
* number
startAuctionIn
* number
initialRateBump
* number
auctionStartAmount
* string
startAmount
* string
auctionEndAmount
* string
exclusiveResolver
* object
tokenFee
* string
estP
* number
points
* array
items
AuctionPointClass object
delay
* number
coefficient
* number
allowPartialFills
* boolean
allowMultipleFills
* boolean
gasCost
*GasCostConfigClass object
gasBumpEstimate
* number
gasPriceEstimate
* string
slow
* any
allOf[0]
PresetClass object
bankFee
* string
auctionDuration
* number
startAuctionIn
* number
initialRateBump
* number
auctionStartAmount
* string
startAmount
* string
auctionEndAmount
* string
exclusiveResolver
* object
tokenFee
* string
estP
* number
points
* array
items
AuctionPointClass object
delay
* number
coefficient
* number
allowPartialFills
* boolean
allowMultipleFills
* boolean
gasCost
*GasCostConfigClass object
gasBumpEstimate
* number
gasPriceEstimate
* string
custom
any
allOf[0]
PresetClass object
bankFee
* string
auctionDuration
* number
startAuctionIn
* number
initialRateBump
* number
auctionStartAmount
* string
startAmount
* string
auctionEndAmount
* string
exclusiveResolver
* object
tokenFee
* string
estP
* number
points
* array
items
AuctionPointClass object
delay
* number
coefficient
* number
allowPartialFills
* boolean
allowMultipleFills
* boolean
gasCost
*GasCostConfigClass object
gasBumpEstimate
* number
gasPriceEstimate
* string
settlementAddress
* string
nativeOrderFactoryAddress
string
nativeOrderImplAddress
string
whitelist
* array
items
string
fast
medium
slow
custom
suggested
* boolean
prices
*TokenPairValue object
usd
*PairCurrencyValue object
fromToken
* string
toToken
* string
volume
*TokenPairValue object
usd
*PairCurrencyValue object
fromToken
* string
toToken
* string
source
string
surplusFee
* number
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
const axios = require('axios');

async function httpCall() {
  const url = 'https://api.1inch.com/fusion/quoter/v2.0/{chain}/quote/build';

  const config = {
    headers: {
      Authorization: `Bearer ${API_KEY}`,
    },
    params: {
      fee: 0,
      isPermit2: false,
      additionalAuctionStartDelay: 30,
      receiver: '0x0000000000000000000000000000000000000000',
      permit: '0x',
      feeReceiver: '0x0000000000000000000000000000000000000000',
      walletAddress: '0x0000000000000000000000000000000000000000',
      amount: '1000000000000000000',
      toTokenAddress: '0x6b175474e89094c44da98b954eedeac495271d0f',
      fromTokenAddress: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
    },
    paramsSerializer: {
      indexes: null,
    },
  };
  const body = {
    quoteId: null,
    fromTokenAmount: 'string',
    toTokenAmount: 'string',
    feeToken: null,
    fee: {
      receiver: 'string',
      bps: 0,
      whitelistDiscountPercent: 0,
    },
    integratorFee: 0,
    integratorFeeReceiver: 'string',
    integratorFeeShare: 0,
    presets: {
      fast: {
        bankFee: 'string',
        auctionDuration: 0,
        startAuctionIn: 0,
        initialRateBump: 0,
        auctionStartAmount: 'string',
        startAmount: 'string',
        auctionEndAmount: 'string',
        exclusiveResolver: null,
        tokenFee: 'string',
        estP: 0,
        points: [
          {
            delay: 0,
            coefficient: 0,
          },
        ],
        allowPartialFills: false,
        allowMultipleFills: false,
        gasCost: {
          gasBumpEstimate: 0,
          gasPriceEstimate: 'string',
        },
      },
      medium: {
        bankFee: 'string',
        auctionDuration: 0,
        startAuctionIn: 0,
        initialRateBump: 0,
        auctionStartAmount: 'string',
        startAmount: 'string',
        auctionEndAmount: 'string',
        exclusiveResolver: null,
        tokenFee: 'string',
        estP: 0,
        points: [
          {
            delay: 0,
            coefficient: 0,
          },
        ],
        allowPartialFills: false,
        allowMultipleFills: false,
        gasCost: {
          gasBumpEstimate: 0,
          gasPriceEstimate: 'string',
        },
      },
      slow: {
        bankFee: 'string',
        auctionDuration: 0,
        startAuctionIn: 0,
        initialRateBump: 0,
        auctionStartAmount: 'string',
        startAmount: 'string',
        auctionEndAmount: 'string',
        exclusiveResolver: null,
        tokenFee: 'string',
        estP: 0,
        points: [
          {
            delay: 0,
            coefficient: 0,
          },
        ],
        allowPartialFills: false,
        allowMultipleFills: false,
        gasCost: {
          gasBumpEstimate: 0,
          gasPriceEstimate: 'string',
        },
      },
      custom: {
        bankFee: 'string',
        auctionDuration: 0,
        startAuctionIn: 0,
        initialRateBump: 0,
        auctionStartAmount: 'string',
        startAmount: 'string',
        auctionEndAmount: 'string',
        exclusiveResolver: null,
        tokenFee: 'string',
        estP: 0,
        points: [
          {
            delay: 0,
            coefficient: 0,
          },
        ],
        allowPartialFills: false,
        allowMultipleFills: false,
        gasCost: {
          gasBumpEstimate: 0,
          gasPriceEstimate: 'string',
        },
      },
    },
    settlementAddress: 'string',
    nativeOrderFactoryAddress: 'string',
    nativeOrderImplAddress: 'string',
    whitelist: ['string'],
    recommended_preset: 'fast',
    suggested: false,
    prices: {
      usd: {
        fromToken: 'string',
        toToken: 'string',
      },
    },
    volume: {
      usd: {
        fromToken: 'string',
        toToken: 'string',
      },
    },
    source: 'string',
    surplusFee: 0,
  };

  try {
    const response = await axios.post(url, body, config);
    console.log(response.data);
  } catch (error) {
    console.error(error);
  }
}

Returns

200
400
default

200 response doesn’t have payload.

Did you find what you need?