Archive Distribution Account
Archives a distribution account. Owner only.
Archived accounts accept no new disbursements but keep serving reads, so past records stay resolvable. Two accounts cannot be archived and return 400: the tenant’s default, which requires promoting another account first, and the last remaining active account.
curl --request POST \
--url https://api.example.com/distribution-wallets/{id}/archive \
--header 'Authorization: <api-key>'import requests
url = "https://api.example.com/distribution-wallets/{id}/archive"
headers = {"Authorization": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
fetch('https://api.example.com/distribution-wallets/{id}/archive', 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/distribution-wallets/{id}/archive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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/distribution-wallets/{id}/archive"
req, _ := http.NewRequest("POST", 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.post("https://api.example.com/distribution-wallets/{id}/archive")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/distribution-wallets/{id}/archive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"distribution_account_address": "<string>",
"distribution_account_type": "DISTRIBUTION_ACCOUNT.STELLAR.ENV",
"distribution_account_status": "ACTIVE",
"status": "ACTIVE",
"is_default": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"archived_at": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"extras": {}
}{
"error": "Not authorized",
"extras": {
"status": 401,
"message": "Not authorized"
}
}{
"error": "Forbidden"
}{
"error": "Not found",
"extras": {
"status": 404,
"message": "Resource not found"
}
}Authorizations
Authorization header containing an SDP JWT (ES256) or an SDP_ API key.
Path Parameters
The unique identifier of the distribution account
Response
Distribution account archived successfully
A distribution account the tenant sends funds from.
Unique identifier for the account
Human-readable name for the account
Optional description
The account's Stellar address. Absent until the account has been provisioned on the network.
How the account's secret is stored. Additional accounts are always DISTRIBUTION_ACCOUNT.STELLAR.DB_VAULT.
DISTRIBUTION_ACCOUNT.STELLAR.ENV, DISTRIBUTION_ACCOUNT.STELLAR.DB_VAULT, DISTRIBUTION_ACCOUNT.CIRCLE.DB_VAULT Status of the underlying Stellar account
ACTIVE, PENDING_USER_ACTIVATION Lifecycle status. PENDING accounts have been reserved but not yet funded on the network and cannot send. ARCHIVED accounts accept no new disbursements and are never deleted.
ACTIVE, PENDING, ARCHIVED Whether this is the tenant's default account. Exactly one account is the default, and it cannot be archived.
When the account was archived, if it has been
curl --request POST \
--url https://api.example.com/distribution-wallets/{id}/archive \
--header 'Authorization: <api-key>'import requests
url = "https://api.example.com/distribution-wallets/{id}/archive"
headers = {"Authorization": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
fetch('https://api.example.com/distribution-wallets/{id}/archive', 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/distribution-wallets/{id}/archive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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/distribution-wallets/{id}/archive"
req, _ := http.NewRequest("POST", 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.post("https://api.example.com/distribution-wallets/{id}/archive")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/distribution-wallets/{id}/archive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"distribution_account_address": "<string>",
"distribution_account_type": "DISTRIBUTION_ACCOUNT.STELLAR.ENV",
"distribution_account_status": "ACTIVE",
"status": "ACTIVE",
"is_default": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"archived_at": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"extras": {}
}{
"error": "Not authorized",
"extras": {
"status": 401,
"message": "Not authorized"
}
}{
"error": "Forbidden"
}{
"error": "Not found",
"extras": {
"status": 404,
"message": "Resource not found"
}
}