Skip to main content
POST
/
customers
/
{customerID}
/
liquidation_addresses
/
{liquidationAddressID}
/
drains
/
{drainID}
/
execute
Execute a pending USDT trade on a drain
curl --request POST \
  --url https://api.bridge.xyz/v0/customers/{customerID}/liquidation_addresses/{liquidationAddressID}/drains/{drainID}/execute \
  --header 'Api-Key: <api-key>' \
  --header 'Idempotency-Key: <idempotency-key>'
import requests

url = "https://api.bridge.xyz/v0/customers/{customerID}/liquidation_addresses/{liquidationAddressID}/drains/{drainID}/execute"

headers = {
"Idempotency-Key": "<idempotency-key>",
"Api-Key": "<api-key>"
}

response = requests.post(url, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', 'Api-Key': '<api-key>'}
};

fetch('https://api.bridge.xyz/v0/customers/{customerID}/liquidation_addresses/{liquidationAddressID}/drains/{drainID}/execute', 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.bridge.xyz/v0/customers/{customerID}/liquidation_addresses/{liquidationAddressID}/drains/{drainID}/execute",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Api-Key: <api-key>",
"Idempotency-Key: <idempotency-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.bridge.xyz/v0/customers/{customerID}/liquidation_addresses/{liquidationAddressID}/drains/{drainID}/execute"

req, _ := http.NewRequest("POST", url, nil)

req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("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.post("https://api.bridge.xyz/v0/customers/{customerID}/liquidation_addresses/{liquidationAddressID}/drains/{drainID}/execute")
.header("Idempotency-Key", "<idempotency-key>")
.header("Api-Key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.bridge.xyz/v0/customers/{customerID}/liquidation_addresses/{liquidationAddressID}/drains/{drainID}/execute")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Api-Key"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "amount": "<string>",
  "customer_id": "<string>",
  "liquidation_address_id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "deposit_tx_hash": "<string>",
  "from_address": "<string>",
  "source_payment_rail": "<string>",
  "destination": {
    "to_address": "<string>",
    "blockchain_memo": "<string>",
    "external_account_id": "<string>",
    "wire_message": "<string>",
    "sepa_reference": "<string>",
    "swift_reference": "<string>",
    "spei_reference": "<string>",
    "reference": "<string>",
    "ach_reference": "<string>",
    "imad": "<string>",
    "trace_number": "<string>",
    "tracking_number": "<string>",
    "transaction_id": "<string>",
    "sending_institution_name": "<string>",
    "uetr": "<string>"
  },
  "destination_tx_hash": "<string>",
  "refund_tx_hash": "<string>",
  "return_details": {
    "reason": "<string>",
    "risk_rejection_reason": "<string>"
  },
  "receipt": {
    "initial_amount": "<string>",
    "developer_fee": "<string>",
    "subtotal_amount": "<string>",
    "converted_amount": "<string>",
    "exchange_rate": "<unknown>",
    "outgoing_amount": "<string>",
    "gas_fee": "<string>",
    "url": "<string>"
  },
  "exchange_details": {
    "fixed_rate": "<string>",
    "estimated_market_rate": "<string>",
    "traded_market_rate": "<string>",
    "trade_at_market": true,
    "updated_at": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Api-Key
string
header
required

Headers

Idempotency-Key
string
required

Path Parameters

customerID
string
required

A UUID that uniquely identifies a resource

Required string length: 1 - 42
Pattern: [a-z0-9]*
liquidationAddressID
string
required

A UUID that uniquely identifies a resource

Required string length: 1 - 42
Pattern: [a-z0-9]*
drainID
string
required

A UUID that uniquely identifies a resource

Required string length: 1 - 42
Pattern: [a-z0-9]*

Response

Drain with trade execute at market rate enabled successfully

id
string
required
read-only

A UUID that uniquely identifies a resource

Required string length: 1 - 42
Pattern: [a-z0-9]*
amount
string
required

Amount of the drain, represented as a dollar denominated string. Examples include "100.25", "0.1", "1.234567", "1.01" etc.

customer_id
string
required
read-only

A UUID that uniquely identifies a resource

Required string length: 1 - 42
Pattern: [a-z0-9]*
liquidation_address_id
string
required
read-only

A UUID that uniquely identifies a resource

Required string length: 1 - 42
Pattern: [a-z0-9]*
currency
enum<string>
required
Available options:
brl,
cop,
eur,
eurc,
gbp,
mxn,
pyusd,
usd,
usdb,
usdc,
usdt
state
enum<string>
required
read-only

Status of the drain

Available options:
awaiting_funds,
in_review,
funds_received,
payment_submitted,
payment_processed,
canceled,
error,
undeliverable,
returned,
refund_in_flight,
refund_failed,
refunded
created_at
string<date-time>
read-only

Time of creation of the drain

updated_at
string<date-time>
read-only

Time of last update of the drain

deposit_tx_hash
string
read-only

Hash of the Liquidation Address deposit that triggered this drain

from_address
string
read-only

The blockchain address that sent funds to the Liquidation Address

source_payment_rail
string
read-only

The source payment rail where the funds originated from

destination
object
read-only

Destination information of a drain.

destination_tx_hash
string
read-only

Hash of withdrawal of funds to the destination

refund_tx_hash
string
read-only

Hash of refund, if the drain has been returned

return_details
object
read-only

Return information, if the drain has been returned.

receipt
object
read-only

Receipt information of a drain.

exchange_details
object
read-only

Exchange details for the associated trade, if applicable.