Skip to main content
POST
/
v1
/
pledges
/
{id}
/
liquidations
Request pledge liquidation
curl --request POST \
  --url https://api.sandbox.busha.so/v1/pledges/{id}/liquidations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "reference": "default_case_348",
  "reason": "default_under_beneficiary_terms",
  "beneficiary_due": {
    "amount": "100",
    "currency": "BTC"
  },
  "items": [
    {
      "pledge_item_id": "PLI_01HX...",
      "amount": "100"
    }
  ],
  "evidence": {},
  "meta": {}
}
'
import requests

url = "https://api.sandbox.busha.so/v1/pledges/{id}/liquidations"

payload = {
    "reference": "default_case_348",
    "reason": "default_under_beneficiary_terms",
    "beneficiary_due": {
        "amount": "100",
        "currency": "BTC"
    },
    "items": [
        {
            "pledge_item_id": "PLI_01HX...",
            "amount": "100"
        }
    ],
    "evidence": {},
    "meta": {}
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    reference: 'default_case_348',
    reason: 'default_under_beneficiary_terms',
    beneficiary_due: {amount: '100', currency: 'BTC'},
    items: [{pledge_item_id: 'PLI_01HX...', amount: '100'}],
    evidence: {},
    meta: {}
  })
};

fetch('https://api.sandbox.busha.so/v1/pledges/{id}/liquidations', 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/{id}/liquidations",
  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([
    'reference' => 'default_case_348',
    'reason' => 'default_under_beneficiary_terms',
    'beneficiary_due' => [
        'amount' => '100',
        'currency' => 'BTC'
    ],
    'items' => [
        [
                'pledge_item_id' => 'PLI_01HX...',
                'amount' => '100'
        ]
    ],
    'evidence' => [
        
    ],
    'meta' => [
        
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "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.sandbox.busha.so/v1/pledges/{id}/liquidations"

	payload := strings.NewReader("{\n  \"reference\": \"default_case_348\",\n  \"reason\": \"default_under_beneficiary_terms\",\n  \"beneficiary_due\": {\n    \"amount\": \"100\",\n    \"currency\": \"BTC\"\n  },\n  \"items\": [\n    {\n      \"pledge_item_id\": \"PLI_01HX...\",\n      \"amount\": \"100\"\n    }\n  ],\n  \"evidence\": {},\n  \"meta\": {}\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	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.sandbox.busha.so/v1/pledges/{id}/liquidations")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"reference\": \"default_case_348\",\n  \"reason\": \"default_under_beneficiary_terms\",\n  \"beneficiary_due\": {\n    \"amount\": \"100\",\n    \"currency\": \"BTC\"\n  },\n  \"items\": [\n    {\n      \"pledge_item_id\": \"PLI_01HX...\",\n      \"amount\": \"100\"\n    }\n  ],\n  \"evidence\": {},\n  \"meta\": {}\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.sandbox.busha.so/v1/pledges/{id}/liquidations")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"reference\": \"default_case_348\",\n  \"reason\": \"default_under_beneficiary_terms\",\n  \"beneficiary_due\": {\n    \"amount\": \"100\",\n    \"currency\": \"BTC\"\n  },\n  \"items\": [\n    {\n      \"pledge_item_id\": \"PLI_01HX...\",\n      \"amount\": \"100\"\n    }\n  ],\n  \"evidence\": {},\n  \"meta\": {}\n}"

response = http.request(request)
puts response.read_body
{ "status": "success", "message": "message for success", "data": { "id": "PLR_01JB...", "pledge_id": "PLG_01HX...", "status": "pending_execution", "notice_period_seconds": 86400, "execute_after": "2023-10-15T12:15:30Z", "beneficiary_due": { "amount": "100", "currency": "BTC" }, "created_at": "2023-10-15T12:15:30Z" } }

Authorizations

Authorization
string
header
required

Bearer Authentication

Headers

X-BU-PROFILE-ID
string

User profile header

Example:

"BUS_YOK8tp5Zga01qOKEsqp07"

Path Parameters

id
string
required

Pledge ID

Example:

"PLG_01HX..."

Body

application/json

Pledge liquidation request

reference
string
required
Required string length: 1 - 255
Example:

"default_case_348"

reason
string
required
Required string length: 1 - 255
Example:

"default_under_beneficiary_terms"

beneficiary_due
object
required

Amount with currency

items
object[]
required
Minimum array length: 1
evidence
object
required

Beneficiary evidence supporting the liquidation request.

meta
object

Optional non-query-critical pledge context.

Response

Successful pledge liquidation response

General response Values

status
enum<string>
required
Available options:
success,
error
Example:

"success"

message
string
required
Example:

"message for success"

data
object
required