Create Transfer
curl --request POST \
--url https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/transfers \
--header 'Content-Type: application/json' \
--data '
{
"amount": "<string>",
"destination": "<string>",
"idempotency_key": "<string>",
"currency_symbol": "<string>"
}
'import requests
url = "https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/transfers"
payload = {
"amount": "<string>",
"destination": "<string>",
"idempotency_key": "<string>",
"currency_symbol": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
amount: '<string>',
destination: '<string>',
idempotency_key: '<string>',
currency_symbol: '<string>'
})
};
fetch('https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/transfers', 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.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/transfers",
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([
'amount' => '<string>',
'destination' => '<string>',
'idempotency_key' => '<string>',
'currency_symbol' => '<string>'
]),
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.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/transfers"
payload := strings.NewReader("{\n \"amount\": \"<string>\",\n \"destination\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"currency_symbol\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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))
}HttpResponse<String> response = Unirest.post("https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/transfers")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"<string>\",\n \"destination\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"currency_symbol\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/transfers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": \"<string>\",\n \"destination\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"currency_symbol\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"activity_id": "<string>",
"approval_url": "<string>",
"symbol": "<string>",
"amount": "<string>",
"fee": "<string>",
"destination_address": "<string>",
"destination_type": "<string>",
"source_address": "<string>",
"source_type": "<string>",
"transaction_id": "<string>"
}Transactions
Create Transfer
Create a wallet transfer.
POST
/
v1
/
portfolios
/
{portfolio_id}
/
wallets
/
{wallet_id}
/
transfers
Create Transfer
curl --request POST \
--url https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/transfers \
--header 'Content-Type: application/json' \
--data '
{
"amount": "<string>",
"destination": "<string>",
"idempotency_key": "<string>",
"currency_symbol": "<string>"
}
'import requests
url = "https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/transfers"
payload = {
"amount": "<string>",
"destination": "<string>",
"idempotency_key": "<string>",
"currency_symbol": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
amount: '<string>',
destination: '<string>',
idempotency_key: '<string>',
currency_symbol: '<string>'
})
};
fetch('https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/transfers', 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.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/transfers",
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([
'amount' => '<string>',
'destination' => '<string>',
'idempotency_key' => '<string>',
'currency_symbol' => '<string>'
]),
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.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/transfers"
payload := strings.NewReader("{\n \"amount\": \"<string>\",\n \"destination\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"currency_symbol\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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))
}HttpResponse<String> response = Unirest.post("https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/transfers")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"<string>\",\n \"destination\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"currency_symbol\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/wallets/{wallet_id}/transfers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": \"<string>\",\n \"destination\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"currency_symbol\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"activity_id": "<string>",
"approval_url": "<string>",
"symbol": "<string>",
"amount": "<string>",
"fee": "<string>",
"destination_address": "<string>",
"destination_type": "<string>",
"source_address": "<string>",
"source_type": "<string>",
"transaction_id": "<string>"
}Use the Prime SDK or CLI to test this endpoint by following the quickstart guide and running with the following examples
For more information, please visit the Prime Java SDK.For more information, please visit the Prime .NET SDK.For more information, please visit the Prime Go SDK.For more information, please visit the Prime Python SDK.For more information, please visit the Prime CLI.For more information, please visit the Prime TS SDK.
- Java
- .NET
- Go
- Python
- CLI
- TS/JS
TransactionsService transactionsService = PrimeServiceFactory.createTransactionsService(client);
CreateTransferRequest request = new CreateTransferRequest.Builder()
.portfolioId("PORTFOLIO_ID_HERE")
.walletId("WALLET_ID_HERE")
.amount("0.001")
.destination("DESTINATION_WALLET_UUID")
.idempotencyKey(UUID.randomUUID().toString())
.currencySymbol("ETH")
.build();
CreateTransferResponse response = transactionsService.createTransfer(request);
var transactionsService = new TransactionsService(client);
var request = new CreateTransferRequest("PORTFOLIO_ID_HERE", "WALLET_ID_HERE")
{
Amount = "0.001",
Destination = "DESTINATION_WALLET_UUID",
IdempotencyKey = Guid.NewGuid().ToString(),
CurrencySymbol = "ETH",
};
var response = transactionsService.CreateTransfer(request);
transactionsService := transactions.NewTransactionsService(client)
request := &transactions.CreateWalletTransferRequest{
PortfolioId: "PORTFOLIO_ID_HERE",
WalletId: "WALLET_ID_HERE",
Amount: "0.001",
Destination: "DESTINATION_WALLET_UUID",
IdempotencyKey: uuid.New().String(),
CurrencySymbol: "ETH",
}
response, err := transactionsService.CreateWalletTransfer(context.Background(), request)
prime_client = PrimeClient(credentials)
request = CreateTransferRequest(
portfolio_id="PORTFOLIO_ID_HERE",
wallet_id="WALLET_ID_HERE",
amount = '0.001',
destination = 'DESTINATION_WALLET_UUID',
idempotency_key = str(uuid.uuid4()),
currency_symbol = 'ETH',
)
response = prime_client.create_transfer(request)
primectl create-transfer --help
const transactionsService = new TransactionsService(client);
transactionsService.createTransfer({
portfolioId: 'PORTFOLIO_ID_HERE',
walletId: 'WALLET_ID_HERE',
amount: "0.001",
destination: "DESTINATION_WALLET_UUID",
idempotencyKey: uuidv4(),
currencySymbol: "ETH",
}).then(async (response) => {
console.log('Transfer: ', response);
})
Path Parameters
The portfolio ID
The wallet ID that the transfer will originate from
Body
application/json
Response
200 - application/json
A successful response.
The activity ID for the transfer
A URL to the activity associated with this transfer for approval
The currency symbol of the transfer
The amount of the transfer
The network fee associated with the transfer
The destination address of the transfer
The destination type of the transfer
The source address used for the transfer
The source type used for the transfer
The id of the just created transaction
Was this page helpful?
⌘I