DELETE /v1/account-types/{name}
Delete an account type. If accounts use it, replace_with must name the type they move to.
Auth. Send the token in the X-Ledger-Token header.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
name | path | string | required | |
replace_with | query | string | optional |
Responses
| Status | Meaning | Body |
|---|---|---|
204 | Deleted | — |
400 | Request rejected | Error |
404 | Request rejected | Error |
409 | In use without replace_with. The body gives the number of accounts. | object |
429 | Too many requests from this client address. Wait the number of seconds in Retry-After, then try again. | Error |
Code samples
Set KEY to your own token first.
curl
curl \
-X DELETE \
-H X-Ledger-Token:$KEY \
"https://api.sasek.org/ledger/v1/account-types/{name}"
JavaScript
const res = await fetch("https://api.sasek.org/ledger/v1/account-types/{name}", {
method: "DELETE",
headers: { "X-Ledger-Token": KEY },
});
const data = await res.json();
Python
import json
import os
import urllib.request
request = urllib.request.Request(
"https://api.sasek.org/ledger/v1/account-types/{name}",
method="DELETE",
headers={
"X-Ledger-Token": os.environ["KEY"],
},
)
with urllib.request.urlopen(request) as response:
print(json.load(response))