Close a customer
curl --request POST \
--url https://api-staging.bsa.ai/v1/customers/{customer_id}/close \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"closureDate": "<string>",
"closureReasonId": 123
}
'import requests
url = "https://api-staging.bsa.ai/v1/customers/{customer_id}/close"
payload = {
"closureDate": "<string>",
"closureReasonId": 123
}
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({closureDate: '<string>', closureReasonId: 123})
};
fetch('https://api-staging.bsa.ai/v1/customers/{customer_id}/close', 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-staging.bsa.ai/v1/customers/{customer_id}/close",
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([
'closureDate' => '<string>',
'closureReasonId' => 123
]),
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-staging.bsa.ai/v1/customers/{customer_id}/close"
payload := strings.NewReader("{\n \"closureDate\": \"<string>\",\n \"closureReasonId\": 123\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-staging.bsa.ai/v1/customers/{customer_id}/close")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"closureDate\": \"<string>\",\n \"closureReasonId\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-staging.bsa.ai/v1/customers/{customer_id}/close")
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 \"closureDate\": \"<string>\",\n \"closureReasonId\": 123\n}"
response = http.request(request)
puts response.read_bodyCustomers
Close a customer
Permanently close an active customer.
POST
/
v1
/
customers
/
{customer_id}
/
close
Close a customer
curl --request POST \
--url https://api-staging.bsa.ai/v1/customers/{customer_id}/close \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"closureDate": "<string>",
"closureReasonId": 123
}
'import requests
url = "https://api-staging.bsa.ai/v1/customers/{customer_id}/close"
payload = {
"closureDate": "<string>",
"closureReasonId": 123
}
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({closureDate: '<string>', closureReasonId: 123})
};
fetch('https://api-staging.bsa.ai/v1/customers/{customer_id}/close', 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-staging.bsa.ai/v1/customers/{customer_id}/close",
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([
'closureDate' => '<string>',
'closureReasonId' => 123
]),
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-staging.bsa.ai/v1/customers/{customer_id}/close"
payload := strings.NewReader("{\n \"closureDate\": \"<string>\",\n \"closureReasonId\": 123\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-staging.bsa.ai/v1/customers/{customer_id}/close")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"closureDate\": \"<string>\",\n \"closureReasonId\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-staging.bsa.ai/v1/customers/{customer_id}/close")
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 \"closureDate\": \"<string>\",\n \"closureReasonId\": 123\n}"
response = http.request(request)
puts response.read_bodyCloses a customer. The customer can no longer hold new loans or
accounts but historical records remain queryable. Closure cannot be
undone — there is no “reopen” endpoint.
Two equivalent forms — see Addressing a customer.
Customers with open loans or active savings accounts cannot be
closed. Close those first.
Path parameters
string
required
LMS id, or the externalId on the
/external/{customer_external_id}/close form.Request body
string
required
ISO-8601
YYYY-MM-DD. The effective date of closure.integer
required
Closure reason code. Valid values are configured per deployment.
Examples
# By LMS id
curl -sf -X POST "$BASE/v1/customers/42/close" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"closureDate": "2026-12-31", "closureReasonId": 17}'
# By externalId
curl -sf -X POST "$BASE/v1/customers/external/ext-ada-001/close" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"closureDate": "2026-12-31", "closureReasonId": 17}'
Response
200 OK returns the customer object with
status="Closed".
Errors
| Code | When |
|---|---|
not_found | No customer with that ID |
aborted | Customer has open loans/accounts, or is already closed |
invalid_argument | Missing closureDate or closureReasonId |
⌘I

