Check company name availability
Checks if a company name is already taken in the system. Requires authentication. Rate limited to 3 requests per minute per user.
Authorization
bearerAuth JWT token obtained from /v1/authenticate endpoint
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/customers/check-name" \ -H "Content-Type: application/json" \ -d '{ "name": "Acme Corporation" }'{
"available": true,
"name": "Acme Corporation"
}{
"status": 403,
"message": "Forbidden",
"code": "transfers_m.account_not_found",
"class": "validation",
"retryable": false,
"details": [
{
"field": "amount",
"rule": "gt",
"param": "0",
"message": "amount must be greater than 0"
}
]
}{
"status": 403,
"message": "Forbidden",
"code": "transfers_m.account_not_found",
"class": "validation",
"retryable": false,
"details": [
{
"field": "amount",
"rule": "gt",
"param": "0",
"message": "amount must be greater than 0"
}
]
}{
"status": 403,
"message": "Forbidden"
}{
"status": 404,
"message": "Not found"
}{
"status": 403,
"message": "Forbidden",
"code": "transfers_m.account_not_found",
"class": "validation",
"retryable": false,
"details": [
{
"field": "amount",
"rule": "gt",
"param": "0",
"message": "amount must be greater than 0"
}
]
}{
"status": 403,
"message": "Forbidden",
"code": "transfers_m.account_not_found",
"class": "validation",
"retryable": false,
"details": [
{
"field": "amount",
"rule": "gt",
"param": "0",
"message": "amount must be greater than 0"
}
]
}Handler: DeleteCustomerByID → DeleteCustomerByIDSrv. Hard-deletes customer row (gorm Delete).
Handler: CreateNewCustomer → CreateNewCustomerSrv. On success, createCustomerRecord also: (1) creates a root counterparty (createCustomerRootCounterparty) with customer_id/owner_id linkage; (2) persists counterparty_id on the customer row; (3) grants creator CRUD on the root counterparty (grantCustomerRootCounterpartyAccess); (4) after customer roles bootstrap, grants role-scoped counterparty permissions from app_config (grantCustomerRootCounterpartyRoleAccessAfterRoles — see cust_root_counterparty_access_test.go). Response includes counterparty_id when provisioning succeeds.