Get All Assets
Fetches the list of available assets to populate the dropdown box in the New Disbursement flow. Note: the organization must hold a balance in a particular asset to use it in a disbursement.
curl --request GET \
--url https://api.example.com/assets \
--header 'Authorization: <api-key>'import requests
url = "https://api.example.com/assets"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.example.com/assets', 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.example.com/assets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-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.example.com/assets"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
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.example.com/assets")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/assets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": "ffaec4b3-46b0-4db4-a4c4-6c3508057705",
"code": "USDC",
"issuer": "GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5",
"created_at": "2023-02-03T10:45:51Z",
"updated_at": "2023-02-03T10:45:51Z",
"deleted_at": "2023-06-03T10:55:51Z"
}
]{
"error": "Not authorized",
"extras": {
"status": 401,
"message": "Not authorized"
}
}{
"error": "Forbidden"
}{
"error": "distribution wallet not found"
}Authorizations
Authorization header containing an SDP JWT (ES256) or an SDP_ API key.
Headers
Optional. When the enabled filter is used, selects the distribution account that the enabled and balance fields describe. Omit it to describe the tenant's default account.
Query Parameters
When set, each asset also reports whether the selected distribution account can send it and what it currently holds. true returns only assets the account is set up for, false only those it is not.
Response
A list of assets. When the enabled filter is used, each entry also carries enabled and balance.
- Option 1
- Option 2
The Stellar asset object
"ffaec4b3-46b0-4db4-a4c4-6c3508057705"
Asset code
"USDC"
Asset issuer address
"GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5"
"2023-02-03T10:45:51Z"
"2023-02-03T10:45:51Z"
"2023-06-03T10:55:51Z"
curl --request GET \
--url https://api.example.com/assets \
--header 'Authorization: <api-key>'import requests
url = "https://api.example.com/assets"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.example.com/assets', 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.example.com/assets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-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.example.com/assets"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
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.example.com/assets")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/assets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": "ffaec4b3-46b0-4db4-a4c4-6c3508057705",
"code": "USDC",
"issuer": "GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5",
"created_at": "2023-02-03T10:45:51Z",
"updated_at": "2023-02-03T10:45:51Z",
"deleted_at": "2023-06-03T10:55:51Z"
}
]{
"error": "Not authorized",
"extras": {
"status": 401,
"message": "Not authorized"
}
}{
"error": "Forbidden"
}{
"error": "distribution wallet not found"
}