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>",
"currency": "brl",
"state": "awaiting_funds",
"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": {
"payment_rail": "ach",
"currency": "ousd",
"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>",
"charge_bearer": "our",
"swift_details": {
"instructed_currency": "sgd",
"purpose": "<string>",
"category_purpose_code": "<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": "Exceeds Transaction Limits"
},
"receipt": {
"initial_amount": "<string>",
"developer_fee": "<string>",
"subtotal_amount": "<string>",
"converted_amount": "<string>",
"exchange_rate": "<unknown>",
"outgoing_amount": "<string>",
"destination_currency": "ousd",
"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"
},
"swift_tracking": {
"uetr": "<string>",
"tracking_status": "in_progress",
"value_date": "2023-12-25",
"last_updated_at": "2023-11-07T05:31:56Z",
"instruction": {
"amount": {
"amount": "<string>",
"currency": "<string>"
},
"charge_bearer": "our",
"message_definition_identifier": "<string>",
"debtor": {
"name": "<string>",
"country": "<string>"
},
"debtor_agent": {
"name": "<string>",
"bic": "<string>"
},
"creditor": {
"country": "<string>"
},
"creditor_agent": {
"name": "<string>",
"bic": "<string>"
}
},
"originating_bank": {
"name": "<string>",
"bic": "<string>",
"transaction_reference": "<string>",
"clearing_system": "<string>",
"clearing_system_identification": "<string>",
"charges": {
"amount": "<string>",
"currency": "<string>"
},
"deductions": {
"beneficiary": {
"amount": "<string>",
"currency": "<string>"
},
"credit": {
"amount": "<string>",
"currency": "<string>"
},
"full_pay_upfront": {
"amount": "<string>",
"currency": "<string>"
}
},
"fx": {
"source_currency": "<string>",
"target_currency": "<string>",
"exchange_rate": "<string>",
"debit_amount": "<string>",
"credit_amount": "<string>"
}
},
"current_tracking": {
"leg_type": "serial",
"status_code": "<string>",
"reason_code": "<string>",
"status_description": "<string>",
"reason_description": "<string>",
"reporting_bank": {
"name": "<string>",
"bic": "<string>"
},
"forwarded_agent": {
"name": "<string>",
"bic": "<string>"
},
"transaction_reference": "<string>",
"settlement_amount": {
"amount": "<string>",
"currency": "<string>"
},
"deduct_amount": {
"amount": "<string>",
"currency": "<string>"
},
"fx": {
"source_currency": "<string>",
"target_currency": "<string>",
"exchange_rate": "<string>"
},
"status_updated_at": "2023-11-07T05:31:56Z"
},
"tracking_history": [
{
"leg_type": "serial",
"status_code": "<string>",
"reason_code": "<string>",
"status_description": "<string>",
"reason_description": "<string>",
"reporting_bank": {
"name": "<string>",
"bic": "<string>"
},
"forwarded_agent": {
"name": "<string>",
"bic": "<string>"
},
"transaction_reference": "<string>",
"settlement_amount": {
"amount": "<string>",
"currency": "<string>"
},
"deduct_amount": {
"amount": "<string>",
"currency": "<string>"
},
"fx": {
"source_currency": "<string>",
"target_currency": "<string>",
"exchange_rate": "<string>"
},
"status_updated_at": "2023-11-07T05:31:56Z"
}
],
"amount_delivered": {
"amount": "<string>",
"currency": "<string>"
},
"charges": [
{
"amount": "<string>",
"currency": "<string>"
}
],
"fx": {
"source_currency": "<string>",
"target_currency": "<string>",
"exchange_rate": "<string>",
"bank": {
"name": "<string>",
"bic": "<string>"
}
}
}
}Liquidation Addresses
Execute a pending USDT trade on a drain
Force-executes a stuck USDT-to-USD trade at the current market rate. The drain must have a pending trade (i.e. appear in GET /liquidation_addresses/drains/pending).
After execution, the drain will continue processing normally with the executed market rate.
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>",
"currency": "brl",
"state": "awaiting_funds",
"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": {
"payment_rail": "ach",
"currency": "ousd",
"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>",
"charge_bearer": "our",
"swift_details": {
"instructed_currency": "sgd",
"purpose": "<string>",
"category_purpose_code": "<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": "Exceeds Transaction Limits"
},
"receipt": {
"initial_amount": "<string>",
"developer_fee": "<string>",
"subtotal_amount": "<string>",
"converted_amount": "<string>",
"exchange_rate": "<unknown>",
"outgoing_amount": "<string>",
"destination_currency": "ousd",
"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"
},
"swift_tracking": {
"uetr": "<string>",
"tracking_status": "in_progress",
"value_date": "2023-12-25",
"last_updated_at": "2023-11-07T05:31:56Z",
"instruction": {
"amount": {
"amount": "<string>",
"currency": "<string>"
},
"charge_bearer": "our",
"message_definition_identifier": "<string>",
"debtor": {
"name": "<string>",
"country": "<string>"
},
"debtor_agent": {
"name": "<string>",
"bic": "<string>"
},
"creditor": {
"country": "<string>"
},
"creditor_agent": {
"name": "<string>",
"bic": "<string>"
}
},
"originating_bank": {
"name": "<string>",
"bic": "<string>",
"transaction_reference": "<string>",
"clearing_system": "<string>",
"clearing_system_identification": "<string>",
"charges": {
"amount": "<string>",
"currency": "<string>"
},
"deductions": {
"beneficiary": {
"amount": "<string>",
"currency": "<string>"
},
"credit": {
"amount": "<string>",
"currency": "<string>"
},
"full_pay_upfront": {
"amount": "<string>",
"currency": "<string>"
}
},
"fx": {
"source_currency": "<string>",
"target_currency": "<string>",
"exchange_rate": "<string>",
"debit_amount": "<string>",
"credit_amount": "<string>"
}
},
"current_tracking": {
"leg_type": "serial",
"status_code": "<string>",
"reason_code": "<string>",
"status_description": "<string>",
"reason_description": "<string>",
"reporting_bank": {
"name": "<string>",
"bic": "<string>"
},
"forwarded_agent": {
"name": "<string>",
"bic": "<string>"
},
"transaction_reference": "<string>",
"settlement_amount": {
"amount": "<string>",
"currency": "<string>"
},
"deduct_amount": {
"amount": "<string>",
"currency": "<string>"
},
"fx": {
"source_currency": "<string>",
"target_currency": "<string>",
"exchange_rate": "<string>"
},
"status_updated_at": "2023-11-07T05:31:56Z"
},
"tracking_history": [
{
"leg_type": "serial",
"status_code": "<string>",
"reason_code": "<string>",
"status_description": "<string>",
"reason_description": "<string>",
"reporting_bank": {
"name": "<string>",
"bic": "<string>"
},
"forwarded_agent": {
"name": "<string>",
"bic": "<string>"
},
"transaction_reference": "<string>",
"settlement_amount": {
"amount": "<string>",
"currency": "<string>"
},
"deduct_amount": {
"amount": "<string>",
"currency": "<string>"
},
"fx": {
"source_currency": "<string>",
"target_currency": "<string>",
"exchange_rate": "<string>"
},
"status_updated_at": "2023-11-07T05:31:56Z"
}
],
"amount_delivered": {
"amount": "<string>",
"currency": "<string>"
},
"charges": [
{
"amount": "<string>",
"currency": "<string>"
}
],
"fx": {
"source_currency": "<string>",
"target_currency": "<string>",
"exchange_rate": "<string>",
"bank": {
"name": "<string>",
"bic": "<string>"
}
}
}
}Path Parameters
Response
Drain with trade execute at market rate enabled successfully
Was this page helpful?