2️⃣Get Allowance

If source quoting asset is an ERC20 token, you should ensure that source token owner has approved sufficient token amount to spender before proceed swap operation. This endpoint provide convenient way to check ERC20 allowance amount.

Get Allowance

get
Query parameters
chainIdintegerRequired

Chain ID.

tokenAddressstringRequired

ERC20 token address.

ownerstringRequired

Owner of ERC20 token.

spenderstringRequired

Spender of ERC20 token.

Responses
200
Successful Response
application/json
Responseany of
or
get
GET /v1/allowance HTTP/1.1
Host: aggregator-api.xy.finance
Accept: */*
200

Successful Response

{
  "success": true,
  "chainId": 56,
  "tokenAddress": "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",
  "owner": "0x314c71ff355F9f525334526f339D84a57E664A1f",
  "spender": "0x7D26F09d4e2d032Efa0729fC31a4c2Db8a2394b1",
  "allowance": "25993637666075620961"
}

NOTE : The spender should be the contractAddress in the response of Get Quote. e.g. routes[{ROUTE_INDEX}]["contractAddress"]

Here you can find our full API reference

Last updated

Was this helpful?