Define funding source
Set funding source for ticket term (in case of ASYNC tickets, this will execute transfer immediately). Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor.
PUT
/
smart-transfers
/
{ticketId}
/
terms
/
{termId}
/
fund
TypeScript
const response: Promise<FireblocksResponse<SmartTransferTicketTermResponse>> = fireblocks.smartTransfer.fundTicketTerm(smartTransferApiFundTicketTermRequest);CompletableFuture<ApiResponse<SmartTransferTicketTermResponse>> response = fireblocks.smartTransfer().fundTicketTerm(smartTransferFundTerm, ticketId, termId, idempotencyKey);response = fireblocks.smart_transfer.fund_ticket_term(smart_transfer_fund_term, ticket_id, term_id, idempotency_key);curl --request PUT \
--url https://api.fireblocks.io/v1/smart-transfers/{ticketId}/terms/{termId}/fund \
--header 'Content-Type: application/json' \
--data '
{
"asset": "BTC",
"amount": "133.789161216184",
"networkConnectionId": "0805153d-e77d-4f9b-8818-e507eeb2d122",
"srcId": "2",
"srcType": "VAULT_ACCOUNT",
"fee": "0.001",
"feeLevel": "MEDIUM",
"note": "Transaction note"
}
'const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
asset: 'BTC',
amount: '133.789161216184',
networkConnectionId: '0805153d-e77d-4f9b-8818-e507eeb2d122',
srcId: '2',
srcType: 'VAULT_ACCOUNT',
fee: '0.001',
feeLevel: 'MEDIUM',
note: 'Transaction note'
})
};
fetch('https://api.fireblocks.io/v1/smart-transfers/{ticketId}/terms/{termId}/fund', 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.fireblocks.io/v1/smart-transfers/{ticketId}/terms/{termId}/fund",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'asset' => 'BTC',
'amount' => '133.789161216184',
'networkConnectionId' => '0805153d-e77d-4f9b-8818-e507eeb2d122',
'srcId' => '2',
'srcType' => 'VAULT_ACCOUNT',
'fee' => '0.001',
'feeLevel' => 'MEDIUM',
'note' => 'Transaction note'
]),
CURLOPT_HTTPHEADER => [
"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.fireblocks.io/v1/smart-transfers/{ticketId}/terms/{termId}/fund"
payload := strings.NewReader("{\n \"asset\": \"BTC\",\n \"amount\": \"133.789161216184\",\n \"networkConnectionId\": \"0805153d-e77d-4f9b-8818-e507eeb2d122\",\n \"srcId\": \"2\",\n \"srcType\": \"VAULT_ACCOUNT\",\n \"fee\": \"0.001\",\n \"feeLevel\": \"MEDIUM\",\n \"note\": \"Transaction note\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
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))
}require 'uri'
require 'net/http'
url = URI("https://api.fireblocks.io/v1/smart-transfers/{ticketId}/terms/{termId}/fund")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"asset\": \"BTC\",\n \"amount\": \"133.789161216184\",\n \"networkConnectionId\": \"0805153d-e77d-4f9b-8818-e507eeb2d122\",\n \"srcId\": \"2\",\n \"srcType\": \"VAULT_ACCOUNT\",\n \"fee\": \"0.001\",\n \"feeLevel\": \"MEDIUM\",\n \"note\": \"Transaction note\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Success",
"data": {
"id": "84601ee2-b10f-4aa8-be9c-dba259a3533a",
"ticketId": "900f04c3-83bc-428d-b681-aef682059637",
"asset": "BTC",
"amount": "133.789161216184",
"fromNetworkId": "947c6115-1f5f-4fb4-9fd6-a1f9dee14670",
"fromNetworkIdName": "Source network profile name",
"toNetworkId": "5d009697-c29b-48e0-aff8-1f4305d19dc2",
"toNetworkIdName": "Destination network profile name",
"txHash": "0x2446f1fd773fbb9f080e674b60c6a033c7ed7427b8b9413cf28a2a4a6da9b56c",
"fbTxId": "79075e8c-1fd9-4c97-9575-3bd9229e5c0d",
"txStatus": "COMPLETED",
"status": "CREATED",
"createdAt": "2023-03-01T11:23:00Z",
"updatedAt": "2023-03-01T11:23:00Z",
"dvpSrcDstVaultId": 1,
"amountUsd": "1333.789161216184"
}
}{
"message": "You do not have permission to execute this action",
"code": 3002
}{
"message": "Requested entity not found",
"code": "c943bdb8-ada0-4ba6-8645-74fcf188a10f"
}{
"message": "Your request contains invalid data",
"code": "2e7a7a5d-c85c-4ea5-9adf-668cba8b4eb4"
}Headers
A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours.
Body
application/json
Asset name
Example:
"BTC"
Amount
Example:
"133.789161216184"
Id of the network connection used.
Example:
"0805153d-e77d-4f9b-8818-e507eeb2d122"
Id of the vault that is used as the source of the asset.
Example:
"2"
Source of the asset.
Example:
"VAULT_ACCOUNT"
Transaction fee
Example:
"0.001"
Transaction fee level.
Example:
"MEDIUM"
Transaction note
Example:
"Transaction note"
Was this page helpful?
Previous
Manually add term transactionManually set ticket term transaction.
Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor.
Next
⌘I
TypeScript
const response: Promise<FireblocksResponse<SmartTransferTicketTermResponse>> = fireblocks.smartTransfer.fundTicketTerm(smartTransferApiFundTicketTermRequest);CompletableFuture<ApiResponse<SmartTransferTicketTermResponse>> response = fireblocks.smartTransfer().fundTicketTerm(smartTransferFundTerm, ticketId, termId, idempotencyKey);response = fireblocks.smart_transfer.fund_ticket_term(smart_transfer_fund_term, ticket_id, term_id, idempotency_key);curl --request PUT \
--url https://api.fireblocks.io/v1/smart-transfers/{ticketId}/terms/{termId}/fund \
--header 'Content-Type: application/json' \
--data '
{
"asset": "BTC",
"amount": "133.789161216184",
"networkConnectionId": "0805153d-e77d-4f9b-8818-e507eeb2d122",
"srcId": "2",
"srcType": "VAULT_ACCOUNT",
"fee": "0.001",
"feeLevel": "MEDIUM",
"note": "Transaction note"
}
'const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
asset: 'BTC',
amount: '133.789161216184',
networkConnectionId: '0805153d-e77d-4f9b-8818-e507eeb2d122',
srcId: '2',
srcType: 'VAULT_ACCOUNT',
fee: '0.001',
feeLevel: 'MEDIUM',
note: 'Transaction note'
})
};
fetch('https://api.fireblocks.io/v1/smart-transfers/{ticketId}/terms/{termId}/fund', 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.fireblocks.io/v1/smart-transfers/{ticketId}/terms/{termId}/fund",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'asset' => 'BTC',
'amount' => '133.789161216184',
'networkConnectionId' => '0805153d-e77d-4f9b-8818-e507eeb2d122',
'srcId' => '2',
'srcType' => 'VAULT_ACCOUNT',
'fee' => '0.001',
'feeLevel' => 'MEDIUM',
'note' => 'Transaction note'
]),
CURLOPT_HTTPHEADER => [
"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.fireblocks.io/v1/smart-transfers/{ticketId}/terms/{termId}/fund"
payload := strings.NewReader("{\n \"asset\": \"BTC\",\n \"amount\": \"133.789161216184\",\n \"networkConnectionId\": \"0805153d-e77d-4f9b-8818-e507eeb2d122\",\n \"srcId\": \"2\",\n \"srcType\": \"VAULT_ACCOUNT\",\n \"fee\": \"0.001\",\n \"feeLevel\": \"MEDIUM\",\n \"note\": \"Transaction note\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
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))
}require 'uri'
require 'net/http'
url = URI("https://api.fireblocks.io/v1/smart-transfers/{ticketId}/terms/{termId}/fund")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"asset\": \"BTC\",\n \"amount\": \"133.789161216184\",\n \"networkConnectionId\": \"0805153d-e77d-4f9b-8818-e507eeb2d122\",\n \"srcId\": \"2\",\n \"srcType\": \"VAULT_ACCOUNT\",\n \"fee\": \"0.001\",\n \"feeLevel\": \"MEDIUM\",\n \"note\": \"Transaction note\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Success",
"data": {
"id": "84601ee2-b10f-4aa8-be9c-dba259a3533a",
"ticketId": "900f04c3-83bc-428d-b681-aef682059637",
"asset": "BTC",
"amount": "133.789161216184",
"fromNetworkId": "947c6115-1f5f-4fb4-9fd6-a1f9dee14670",
"fromNetworkIdName": "Source network profile name",
"toNetworkId": "5d009697-c29b-48e0-aff8-1f4305d19dc2",
"toNetworkIdName": "Destination network profile name",
"txHash": "0x2446f1fd773fbb9f080e674b60c6a033c7ed7427b8b9413cf28a2a4a6da9b56c",
"fbTxId": "79075e8c-1fd9-4c97-9575-3bd9229e5c0d",
"txStatus": "COMPLETED",
"status": "CREATED",
"createdAt": "2023-03-01T11:23:00Z",
"updatedAt": "2023-03-01T11:23:00Z",
"dvpSrcDstVaultId": 1,
"amountUsd": "1333.789161216184"
}
}{
"message": "You do not have permission to execute this action",
"code": 3002
}{
"message": "Requested entity not found",
"code": "c943bdb8-ada0-4ba6-8645-74fcf188a10f"
}{
"message": "Your request contains invalid data",
"code": "2e7a7a5d-c85c-4ea5-9adf-668cba8b4eb4"
}