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

# POST /auth/register — Create a merchant account

> Register a new Dubu Pay merchant account with your business name, email, and password. A verification email is sent immediately and must be completed before you can log in.

Use this endpoint to create a new merchant account on Dubu Pay. You provide your business name, email address, and a password. The API creates the account, generates a six-digit OTP, and sends a verification email to the address you supplied. Your account is not usable until you verify your email using `POST /auth/verify-email`.

This endpoint applies a strict rate limit to prevent abuse.

## Endpoint

```
POST https://api.dubupay.com/api/v1/auth/register
```

No authentication is required.

## Request body

<ParamField body="business_name" type="string" required>
  The registered name of your business. Must be at least 2 characters.
</ParamField>

<ParamField body="email" type="string" required>
  The email address for your merchant account. Must be a valid email. This address is used for verification, notifications, and login — it must be unique across all Dubu Pay accounts.
</ParamField>

<ParamField body="password" type="string" required>
  A password for your account. Must be at least 8 characters. Passwords are stored securely and are never returned in any API response.
</ParamField>

## Response

HTTP `201 Created` on success.

<ResponseField name="success" type="boolean">
  `true` when the account was created successfully.
</ResponseField>

<ResponseField name="data" type="object">
  <Expandable title="data">
    <ResponseField name="message" type="string">
      A confirmation message, e.g. `"Verification email sent. Please check your inbox."`.
    </ResponseField>

    <ResponseField name="email" type="string">
      The email address the verification OTP was sent to.
    </ResponseField>
  </Expandable>
</ResponseField>

## Example

```bash theme={null}
curl -X POST https://api.dubupay.com/api/v1/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "business_name": "Acme Trading Ltd",
    "email": "owner@acmetrading.com",
    "password": "SuperSecret123"
  }'
```

**Response**

```json theme={null}
{
  "success": true,
  "data": {
    "message": "Verification email sent. Please check your inbox.",
    "email": "owner@acmetrading.com"
  }
}
```

## Verify your email

After registering, check your inbox for an email containing a 6-digit OTP. Pass that code to `POST /auth/verify-email` along with your email address. Until you do, any attempt to log in will be rejected.

If the email doesn't arrive within a few minutes, use `POST /auth/resend-otp` to request a new code.

## Error responses

| Status | Code             | Description                                                                          |
| ------ | ---------------- | ------------------------------------------------------------------------------------ |
| `400`  | Validation error | `business_name`, `email`, or `password` failed validation. Check the `errors` array. |
| `409`  | `EMAIL_IN_USE`   | An account with that email address already exists.                                   |
| `429`  | Rate limit       | Too many registration attempts from this IP. Wait before retrying.                   |
