## Documentation Index

Fetch the complete documentation index at: [/llms.txt](https://docs.afriex.com/llms.txt)

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

### cURL

#### initiate

```bash
curl --request POST \
  --url https://sandbox.api.afriex.com/api/v1/sme-registration \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "step": "INITIATE",
  "data": {
    "mobile": "254712345678",
    "email": "admin@company.co.ke",
    "businessType": 2
  }
}
'```

### Responses

#### Successful Response 200
```json
{
  "data": {
    "onboardingRequestId": "<string>",
    "expiresAt": "2023-11-07T05:31:56Z"
  }
}
```

#### Error Response 400
```json
{
  "code": "<string>",
  "error": "<string>",
  "details": {
    "errorMessage": "<string>",
    "friendlyMessage": "<string>",
    "data": {
      "customerId": "<string>"
    }
  }
}
```

#### Error Response 401
```json
{
  "code": "<string>",
  "error": "<string>",
  "details": {
    "errorMessage": "<string>",
    "friendlyMessage": "<string>",
    "data": {
      "customerId": "<string>"
    }
  }
}
```

## Registering Your Business

Register your business as its own SME so that virtual accounts are issued under your legal entity instead of the shared Afriex default. This is a **stateful, step-based** flow driven by a single endpoint: the `step` field selects which payload shape goes in `data`.

Requires an API key with **admin** permission. Only Limited Liability Companies are supported today, so `businessType` must be `2` in the `INITIATE` step.

### Flow

1. **INITIATE**  
   Send the business `mobile`, `email`, and `businessType`. Afriex creates an onboarding request, returns an `onboardingRequestId`, and sends a one-time passcode to the supplied mobile number.

2. **CONFIRM_OTP**  
   Post back the `onboardingRequestId` from step 1 and the 6-digit `otp` the customer received.

3. **SUBMIT**  
   Submit company details, `directors[]`, and optional `organizationShareholders[]` / `media[]`. Every file field is an **object key** returned by [Generate Upload URL](https://docs.afriex.com/api-reference/endpoint/media/generate-upload-url). Upload each file first, then reference the returned `key` here.

Track progress in `status`: `OTP_PENDING` after `INITIATE`, `DETAILS_PENDING` after `CONFIRM_OTP`, and `SUBMITTED` after `SUBMIT`. The `nextStep` field tells you what to call next; `expiresAt` is the deadline for that step (OTP window after `INITIATE`, submit window after `CONFIRM_OTP`).

Once submitted, poll [Get SME Registration Status](https://docs.afriex.com/api-reference/endpoint/sme-registration/status) for the review outcome. Virtual accounts under your entity are issued only after the review reaches **Approved** (`reviewStatus: 3`).

### Authorizations

#### Header: x-api-key  
- **Type**: `string`  
- **Location**: `header`  
- **Required**: Yes

Static business API key issued from the dashboard. A business can provision multiple API keys, each scoped to a configurable set of permissions (e.g. read transactions, create deposits, etc). Permissions are chosen per key at creation time in the dashboard and may be revoked by deleting the key. Requests made with a key that does not include the permission required by the target endpoint will be rejected with a `403 Forbidden` response; an unrecognized, malformed, or revoked key returns `401 Unauthorized`. Manage your keys and their permissions under Developer → API keys in the dashboard.

### Headers

#### Parameter: x-api-version  
- **Type**: `string`  
- **Description**: API version in ISO 8601 format (e.g. 2025-12-28). Defaults to latest stable.

### Body

- **Content-Type**: `application/json`

#### Required Fields
- `step`  
  - **Type**: enum<string>  
  - **Required**: Yes  
  - **Description**: Selects the payload shape carried in `data`. Available options: `INITIATE`, `CONFIRM_OTP`, `SUBMIT`.

- `data`  
  - **Type**: object  
  - **Required**: Yes  
  - **Description**: Step-specific payload.  
    - `INITIATE`: `mobile`, `email`, `businessType` (must be `2` — only Limited Liability Companies are supported at this time).
    - `CONFIRM_OTP`: `onboardingRequestId`, `otp`.
    - `SUBMIT`: company details, `directors[]`, and optional `organizationShareholders[]` / `media[]`, where every file field is an object key returned by `POST /api/v1/media/url`.

### Response

- **Response Code**: 200  
- **Content-Type**: `application/json`  
- **Description**: Step processed successfully.
