> ## Documentation Index
> Fetch the complete documentation index at: https://docs.acealliance.capital/llms.txt
> Use this file to discover all available pages before exploring further.

# Validate a customer

Call before every payment.

<RequestExample>
  ```bash Request theme={null}
  curl --request POST https://api.acealliance.capital/imbank/v1/validate \
    --header "Authorization: Bearer ACCESS_TOKEN" \
    --header "Content-Type: application/json" \
    --data '{ "customerRef": "1234567" }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "resultCode": 0,
    "message": "Customer found",
    "customerName": "Daniel Kiptoo",
    "customerRef": "1234567"
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "resultCode": 1,
    "message": "Customer not found",
    "customerName": "",
    "customerRef": ""
  }
  ```
</ResponseExample>

## Headers

<ParamField header="Authorization" type="string" required>
  `Bearer ACCESS_TOKEN`
</ParamField>

<ParamField header="Content-Type" type="string" required>
  `application/json`
</ParamField>

## Request body

<ParamField body="customerRef" type="string" required>
  The Member Number. Seven digits. Surrounding spaces are ignored.
</ParamField>

## Response

<ResponseField name="resultCode" type="integer" required>
  `0` found, `1` not found.
</ResponseField>

<ResponseField name="message" type="string" required>
  `Customer found` or `Customer not found`.
</ResponseField>

<ResponseField name="customerName" type="string" required>
  The member's full name. Empty when not found.
</ResponseField>

<ResponseField name="customerRef" type="string" required>
  The Member Number without surrounding spaces. Empty when not found.
</ResponseField>

## Errors

| Status | Meaning                                                      | Action               |
| ------ | ------------------------------------------------------------ | -------------------- |
| `404`  | The reference names no member who can receive a payment now. | Hold the payment.    |
| `401`  | Token missing, expired, or not valid. No body.               | Request a new token. |

A member who cannot receive a payment now can become valid later. Validate again on the next payment.
