Get Portfolio Credit Information
curl --request GET \
--url https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/creditimport requests
url = "https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/credit"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/credit', 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}/credit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.prime.coinbase.com/v1/portfolios/{portfolio_id}/credit"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/credit")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/credit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"post_trade_credit": {
"portfolio_id": "e8bbed13-fa33-41de-86d5-4335d8f08166",
"currency": "USD",
"limit": "100000",
"utilized": "4000",
"available": "96000",
"frozen": true,
"frozen_reason": "Portfolio frozen manually by admin",
"amounts_due": [
{
"currency": "BTC",
"amount": "4000",
"due_date": "2021-05-31T09:59:59.000Z"
}
],
"enabled": true,
"adjusted_credit_utilized": "5000",
"adjusted_portfolio_equity": "2000"
}
}Financing
Get Portfolio Credit Information
Retrieve a portfolio’s post-trade credit information.
GET
/
v1
/
portfolios
/
{portfolio_id}
/
credit
Get Portfolio Credit Information
curl --request GET \
--url https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/creditimport requests
url = "https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/credit"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/credit', 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}/credit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.prime.coinbase.com/v1/portfolios/{portfolio_id}/credit"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/credit")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/credit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"post_trade_credit": {
"portfolio_id": "e8bbed13-fa33-41de-86d5-4335d8f08166",
"currency": "USD",
"limit": "100000",
"utilized": "4000",
"available": "96000",
"frozen": true,
"frozen_reason": "Portfolio frozen manually by admin",
"amounts_due": [
{
"currency": "BTC",
"amount": "4000",
"due_date": "2021-05-31T09:59:59.000Z"
}
],
"enabled": true,
"adjusted_credit_utilized": "5000",
"adjusted_portfolio_equity": "2000"
}
}Supported Products
- Trade Finance
- Java
- .NET
- Go
- Python
- CLI
- TS/JS
PortfoliosService portfoliosService = PrimeServiceFactory.createPortfoliosService(client);
GetPortfolioCreditInformationRequest request = new GetPortfolioCreditInformationRequest.Builder()
.portfolioId("PORTFOLIO_ID_HERE")
.build();
GetPortfolioCreditInformationResponse response = portfoliosService.getPortfolioCreditInformation(request);
var portfoliosService = new PortfoliosService(client);
var request = new GetPortfolioCreditInformationRequest("PORTFOLIO_ID_HERE");
var response = portfoliosService.GetPortfolioCreditInformation(request);
portfoliosService := portfolios.NewPortfoliosService(client)
request := &portfolios.GetPortfolioCreditInformationRequest{
PortfolioId: "PORTFOLIO_ID_HERE",
}
response, err := portfoliosService.GetPortfolioCreditInformation(context.Background(), request)
prime_client = PrimeClient(credentials)
request = GetPortfolioCreditInformationRequest(
portfolio_id="PORTFOLIO_ID_HERE",
)
response = prime_client.get_portfolio_credit_information(request)
primectl get-credit --help
const portfoliosService = new PortfoliosService(client);
portfoliosService.getPortfolioCredit({
portfolioId: 'PORTFOLIO_ID_HERE'
}).then(async (response) => {
console.log('Portfolio Credit: ', response);
})
Was this page helpful?
⌘I