# User Registration API

Use the User Registration API when your application needs to create a child account under your SIMcloud account. The parent token authorises registration. The response includes the child account’s token, which your integration can use for requests on that account.

[Web guide](https://simcloud.co.za/docs/guide/registration-api/)

POST /api/register.php

[API reference](https://simcloud.co.za/api/register.html)

## Register a child account

Use SIMCLOUD_PARENT_API_TOKEN. Replace the sample names, email, password and YOUR_LOCAL_CELL with the intended child account’s details. The cell number is 10 digits and begins with 0. Optional fields are id_number, business_name, business_reg, vatno and address.

1. HTTP 201 creates the child account and returns user_id, username, api_token and existing: false. Save the returned API token securely for calls on behalf of that child.
2. Submitting the same cell number with the same authorised parent can return HTTP 200 and existing: true. A number already outside your downline returns HTTP 409.

### POST /api/register.php

```bash
curl -4 -sS -i -X POST "${SIMCLOUD_API_BASE:-https://simcloud.co.za}/api/register.php" \
  -H "Authorization: Bearer $SIMCLOUD_PARENT_API_TOKEN" \
  -H 'Content-Type: application/json' \
  --data '{
  "first_name": "Example",
  "last_name": "Customer",
  "cell": "YOUR_LOCAL_CELL",
  "email": "customer@example.test",
  "password": "REPLACE_WITH_CUSTOMER_PASSWORD"
}'
```

HTTP 201 response excerpt

```json
{
  "status": "success",
  "existing": false
}
```

> This creates an account. If the API reports that upstream registration succeeded but local confirmation failed, contact SIMcloud support before resubmitting.
