Check token allowance
curl --request POST \
--url https://api-partner.houdiniswap.com/v2/dex/allowance \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"quoteId": "69a02882f48d56c923119d95",
"addressFrom": "0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40",
"usePermit": false
}
'import requests
url = "https://api-partner.houdiniswap.com/v2/dex/allowance"
payload = {
"quoteId": "69a02882f48d56c923119d95",
"addressFrom": "0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40",
"usePermit": False
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
quoteId: '69a02882f48d56c923119d95',
addressFrom: '0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40',
usePermit: false
})
};
fetch('https://api-partner.houdiniswap.com/v2/dex/allowance', 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-partner.houdiniswap.com/v2/dex/allowance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'quoteId' => '69a02882f48d56c923119d95',
'addressFrom' => '0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40',
'usePermit' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-partner.houdiniswap.com/v2/dex/allowance"
payload := strings.NewReader("{\n \"quoteId\": \"69a02882f48d56c923119d95\",\n \"addressFrom\": \"0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40\",\n \"usePermit\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-partner.houdiniswap.com/v2/dex/allowance")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"quoteId\": \"69a02882f48d56c923119d95\",\n \"addressFrom\": \"0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40\",\n \"usePermit\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-partner.houdiniswap.com/v2/dex/allowance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"quoteId\": \"69a02882f48d56c923119d95\",\n \"addressFrom\": \"0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40\",\n \"usePermit\": false\n}"
response = http.request(request)
puts response.read_bodytrue{
"message": "<string>",
"code": "<string>",
"fields": {},
"requestId": "<string>"
}{
"message": "<string>",
"code": "<string>",
"requestId": "<string>"
}DEX
Check token allowance
Check if token allowance is sufficient for a DEX swap
Returns true if the current allowance is enough to proceed with the swap, or false if an approval transaction is needed first.
POST
/
dex
/
allowance
Check token allowance
curl --request POST \
--url https://api-partner.houdiniswap.com/v2/dex/allowance \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"quoteId": "69a02882f48d56c923119d95",
"addressFrom": "0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40",
"usePermit": false
}
'import requests
url = "https://api-partner.houdiniswap.com/v2/dex/allowance"
payload = {
"quoteId": "69a02882f48d56c923119d95",
"addressFrom": "0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40",
"usePermit": False
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
quoteId: '69a02882f48d56c923119d95',
addressFrom: '0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40',
usePermit: false
})
};
fetch('https://api-partner.houdiniswap.com/v2/dex/allowance', 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-partner.houdiniswap.com/v2/dex/allowance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'quoteId' => '69a02882f48d56c923119d95',
'addressFrom' => '0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40',
'usePermit' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-partner.houdiniswap.com/v2/dex/allowance"
payload := strings.NewReader("{\n \"quoteId\": \"69a02882f48d56c923119d95\",\n \"addressFrom\": \"0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40\",\n \"usePermit\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-partner.houdiniswap.com/v2/dex/allowance")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"quoteId\": \"69a02882f48d56c923119d95\",\n \"addressFrom\": \"0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40\",\n \"usePermit\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-partner.houdiniswap.com/v2/dex/allowance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"quoteId\": \"69a02882f48d56c923119d95\",\n \"addressFrom\": \"0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40\",\n \"usePermit\": false\n}"
response = http.request(request)
puts response.read_bodytrue{
"message": "<string>",
"code": "<string>",
"fields": {},
"requestId": "<string>"
}{
"message": "<string>",
"code": "<string>",
"requestId": "<string>"
}Authorizations
Body
application/json
Quote ID from a prior quote response.
Example:
"69a02882f48d56c923119d95"
Address from which the amount will be deducted (EVM or Tron)
Pattern:
^(0x[0-9a-fA-F]{40}|T[1-9A-HJ-NP-Za-km-z]{33})$Example:
"0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40"
Whether to use permit instead of approve. Defaults to true for swaps that support it.
Example:
false
Response
Success
The response is of type boolean.
⌘I