List pledges
curl --request GET \
--url https://api.sandbox.busha.so/v1/pledges \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sandbox.busha.so/v1/pledges"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sandbox.busha.so/v1/pledges', 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.sandbox.busha.so/v1/pledges",
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: Bearer <token>"
],
]);
$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.sandbox.busha.so/v1/pledges"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.sandbox.busha.so/v1/pledges")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.busha.so/v1/pledges")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "message for success",
"pagination": {
"current_entries_size": 20,
"next_cursor": "MjAyNC0xMC0xNVQxMTowNTo1My45NTkxNDErMDE6MDA=",
"previous_cursor": "MjAyNC0xMC0xNVQxMDowNTo1My45NTIxQjE3MDE6MDA="
},
"data": [
{
"id": "PLG_01HX...",
"status": "authorized",
"reference": "credit_agreement_93b7",
"mandate_hash": "sha256:...",
"items": [
{
"id": "PLI_01HX...",
"asset": "BTC",
"locked_amount": "100",
"released_amount": "100",
"liquidated_amount": "100",
"status": "locked",
"available_to_release": "100"
}
],
"customer_profile_id": "PRF_customer...",
"beneficiary_profile_id": "BUS_beneficiary...",
"activated_at": "2023-10-15T12:15:30Z",
"expires_at": "2023-10-15T12:15:30Z",
"released_at": "2023-10-15T12:15:30Z",
"liquidated_at": "2023-10-15T12:15:30Z",
"events": [
{
"id": "PLE_01HX...",
"type": "pledge.activated",
"actor_type": "beneficiary",
"created_at": "2023-10-15T12:15:30Z",
"reference": "activation_disb_9f1"
}
]
}
]
}Pledges
List pledges
List pledges visible to the selected profile, or to the authenticated OAuth pledge grant when beneficiary context is present.
GET
/
v1
/
pledges
List pledges
curl --request GET \
--url https://api.sandbox.busha.so/v1/pledges \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sandbox.busha.so/v1/pledges"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sandbox.busha.so/v1/pledges', 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.sandbox.busha.so/v1/pledges",
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: Bearer <token>"
],
]);
$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.sandbox.busha.so/v1/pledges"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.sandbox.busha.so/v1/pledges")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.busha.so/v1/pledges")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "message for success",
"pagination": {
"current_entries_size": 20,
"next_cursor": "MjAyNC0xMC0xNVQxMTowNTo1My45NTkxNDErMDE6MDA=",
"previous_cursor": "MjAyNC0xMC0xNVQxMDowNTo1My45NTIxQjE3MDE6MDA="
},
"data": [
{
"id": "PLG_01HX...",
"status": "authorized",
"reference": "credit_agreement_93b7",
"mandate_hash": "sha256:...",
"items": [
{
"id": "PLI_01HX...",
"asset": "BTC",
"locked_amount": "100",
"released_amount": "100",
"liquidated_amount": "100",
"status": "locked",
"available_to_release": "100"
}
],
"customer_profile_id": "PRF_customer...",
"beneficiary_profile_id": "BUS_beneficiary...",
"activated_at": "2023-10-15T12:15:30Z",
"expires_at": "2023-10-15T12:15:30Z",
"released_at": "2023-10-15T12:15:30Z",
"liquidated_at": "2023-10-15T12:15:30Z",
"events": [
{
"id": "PLE_01HX...",
"type": "pledge.activated",
"actor_type": "beneficiary",
"created_at": "2023-10-15T12:15:30Z",
"reference": "activation_disb_9f1"
}
]
}
]
}Authorizations
Bearer Authentication
Headers
User profile header
Example:
"BUS_YOK8tp5Zga01qOKEsqp07"
Query Parameters
Filter by pledge status
Available options:
authorized, active, liquidation_pending, released, liquidated, expired, cancelled Filter by pledged asset
A valid currency
Required string length:
1 - 10Filter by beneficiary-supplied pledge reference
The cursor
The order to sort the results
Available options:
asc, desc Example:
"asc"
The number of items to return
Example:
10