Delete a settlement account
Removes a settlement account so it can no longer receive payouts, for example when a seller
changes bank. Rejected with 409 while the account is still in use for settlements, for
example while a payout to it is in progress. Deleting a settlement account that is already deleted
returns 404; GET still returns it with status DELETED.
DELETE
https://api.lite.sa
/
settlements
/
settlement-accounts
/
{id}
Delete a settlement account
curl --request DELETE \
--url https://api.lite.sa/settlements/settlement-accounts/{id} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.lite.sa/settlements/settlement-accounts/{id}"
headers = {"x-api-key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.lite.sa/settlements/settlement-accounts/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {method: 'DELETE', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.lite.sa/settlements/settlement-accounts/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.lite.sa/settlements/settlement-accounts/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lite.sa/settlements/settlement-accounts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"errors": [
{
"category": "VALIDATION",
"code": "INVALID_REQUEST",
"message": "id must be a UUID.",
"retriable": false
}
],
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"error": "unauthorized",
"reason": "API_KEY_INVALID",
"message": "Authentication failed - invalid or missing credentials",
"correlationId": "550e8400-e29b-41d4-a716-446655440000"
}{
"errors": [
{
"category": "SETUP",
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action.",
"retriable": false
}
],
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"errors": [
{
"category": "VALIDATION",
"code": "ENTITY_NOT_FOUND",
"message": "The entity was not found. Verify the entity ID in the dashboard.",
"retriable": false
}
],
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"errors": [
{
"category": "WORKFLOW",
"code": "INVALID_STATE",
"message": "This settlement account is still in use for settlements and cannot be deleted. Please contact support to change your settlement destination first.",
"retriable": false
}
],
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"errors": [
{
"category": "SYSTEM",
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred. Retry with backoff. lite.sa has been alerted.",
"retriable": true
}
],
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"errors": [
{
"category": "CONNECTION",
"code": "PROVIDER_UNAVAILABLE",
"message": "We couldn't delete this settlement beneficiary right now. Please try again in a few minutes.",
"retriable": true
}
],
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}Authorizations
Headers
Path Parameters
Response
Settlement account deleted.
⌘I
Delete a settlement account
curl --request DELETE \
--url https://api.lite.sa/settlements/settlement-accounts/{id} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.lite.sa/settlements/settlement-accounts/{id}"
headers = {"x-api-key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.lite.sa/settlements/settlement-accounts/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {method: 'DELETE', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.lite.sa/settlements/settlement-accounts/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.lite.sa/settlements/settlement-accounts/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lite.sa/settlements/settlement-accounts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"errors": [
{
"category": "VALIDATION",
"code": "INVALID_REQUEST",
"message": "id must be a UUID.",
"retriable": false
}
],
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"error": "unauthorized",
"reason": "API_KEY_INVALID",
"message": "Authentication failed - invalid or missing credentials",
"correlationId": "550e8400-e29b-41d4-a716-446655440000"
}{
"errors": [
{
"category": "SETUP",
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action.",
"retriable": false
}
],
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"errors": [
{
"category": "VALIDATION",
"code": "ENTITY_NOT_FOUND",
"message": "The entity was not found. Verify the entity ID in the dashboard.",
"retriable": false
}
],
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"errors": [
{
"category": "WORKFLOW",
"code": "INVALID_STATE",
"message": "This settlement account is still in use for settlements and cannot be deleted. Please contact support to change your settlement destination first.",
"retriable": false
}
],
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"errors": [
{
"category": "SYSTEM",
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred. Retry with backoff. lite.sa has been alerted.",
"retriable": true
}
],
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"errors": [
{
"category": "CONNECTION",
"code": "PROVIDER_UNAVAILABLE",
"message": "We couldn't delete this settlement beneficiary right now. Please try again in a few minutes.",
"retriable": true
}
],
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}