Accounts
Delete an account
Deletes an account. An account referenced by any payment can’t be deleted.
DELETE
/
accounts
/
{accountId}
Delete an account
const options = {
method: 'DELETE',
headers: {'Melio-Entity-Id': '<melio-entity-id>', 'api-key': '<api-key>'}
};
fetch('https://api.melio.com/v2/accounts/{accountId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.melio.com/v2/accounts/{accountId}"
headers = {
"Melio-Entity-Id": "<melio-entity-id>",
"api-key": "<api-key>"
}
response = requests.delete(url, headers=headers)
print(response.text)curl --request DELETE \
--url https://api.melio.com/v2/accounts/{accountId} \
--header 'Melio-Entity-Id: <melio-entity-id>' \
--header 'api-key: <api-key>'HttpResponse<String> response = Unirest.delete("https://api.melio.com/v2/accounts/{accountId}")
.header("Melio-Entity-Id", "<melio-entity-id>")
.header("api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.melio.com/v2/accounts/{accountId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Melio-Entity-Id"] = '<melio-entity-id>'
request["api-key"] = '<api-key>'
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.melio.com/v2/accounts/{accountId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Melio-Entity-Id", "<melio-entity-id>")
req.Header.Add("api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"error": {
"type": "authorization_error",
"code": "BUSINESS_NOT_ELIGIBLE",
"message": "Business is not eligible to modify its accounts. See the limitations endpoint for details."
}
}{
"error": {
"message": "<string>",
"details": {}
}
}{
"error": {
"type": "conflict_error",
"code": "ACCOUNT_IN_USE",
"message": "Account cannot be deleted because it is referenced by one or more payments"
}
}⌘I
Delete an account
const options = {
method: 'DELETE',
headers: {'Melio-Entity-Id': '<melio-entity-id>', 'api-key': '<api-key>'}
};
fetch('https://api.melio.com/v2/accounts/{accountId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.melio.com/v2/accounts/{accountId}"
headers = {
"Melio-Entity-Id": "<melio-entity-id>",
"api-key": "<api-key>"
}
response = requests.delete(url, headers=headers)
print(response.text)curl --request DELETE \
--url https://api.melio.com/v2/accounts/{accountId} \
--header 'Melio-Entity-Id: <melio-entity-id>' \
--header 'api-key: <api-key>'HttpResponse<String> response = Unirest.delete("https://api.melio.com/v2/accounts/{accountId}")
.header("Melio-Entity-Id", "<melio-entity-id>")
.header("api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.melio.com/v2/accounts/{accountId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Melio-Entity-Id"] = '<melio-entity-id>'
request["api-key"] = '<api-key>'
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.melio.com/v2/accounts/{accountId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Melio-Entity-Id", "<melio-entity-id>")
req.Header.Add("api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"error": {
"type": "authorization_error",
"code": "BUSINESS_NOT_ELIGIBLE",
"message": "Business is not eligible to modify its accounts. See the limitations endpoint for details."
}
}{
"error": {
"message": "<string>",
"details": {}
}
}{
"error": {
"type": "conflict_error",
"code": "ACCOUNT_IN_USE",
"message": "Account cannot be deleted because it is referenced by one or more payments"
}
}