Skip to main content
POST
/
v1
/
customers
/
{customer_id}
/
close
Close a customer
curl --request POST \
  --url https://api-dev.bsa.ai/v1/customers/{customer_id}/close \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "closureDate": "<string>",
  "closureReasonId": 123
}
'

Documentation Index

Fetch the complete documentation index at: https://docs.api.bsa.ai/llms.txt

Use this file to discover all available pages before exploring further.

Closes 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.
Customers with open loans or active savings accounts cannot be closed. Close those first.

Path parameters

customer_id
string
required

Request body

closureDate
string
required
ISO-8601 YYYY-MM-DD. The effective date of closure.
closureReasonId
integer
required
Reference to an LMS code value (closure reason code). Valid values are configured per deployment.

Example

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
  }'

Response

200 OK returns the customer object with status="Closed".

Errors

CodeWhen
not_foundNo customer with that ID
abortedCustomer has open loans/accounts, or is already closed
invalid_argumentMissing closureDate or closureReasonId