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

# Create card user

> Register a cardholder and receive the user_id used by the other card endpoints.

Creates a cardholder on your partner account. Email and ID number must not already be registered. Use `data.user_id` when you [create a card](https://docs.xwift.africa/api-reference/cards/create.md).

**first\_name** `string` *required*

Cardholder given name.

**last\_name** `string` *required*

Cardholder family name.

**email** `string` *required*

Email address. Must be unique.

**phone** `string` *required*

Phone number.

**country** `string` *required*

Country.

**state** `string` *required*

State or region.

**city** `string` *required*

City.

**address** `string` *required*

Street address.

**zip\_code** `string` *required*

Postal code.

**id\_type** `string` *required*

`National_ID`, `Passport`, or `Driving_License`.

**id\_number** `string` *required*

Government ID number. Must be unique.

The response is a short [card user](https://docs.xwift.africa/guides/cards.md#card-user-object): `user_id`, `email`, and `name`. Address and ID fields are stored and are not echoed back.

### Errors

| Message | When |
| - | - |
| First validator error | A required field is missing, `email` is not an email, or `id_type` is not one of the allowed values |
| `The email has already been taken.` | Email is already registered |
| `The id number has already been taken.` | ID number is already registered |
| `An unexpected error occurred. Please try again.` | The cardholder could not be created |

```bash theme={null}
curl -X POST "{{base_url}}/card/create-user" \
  -H "x-api-key: YOUR_CONSUMER_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "first_name": "Ada",
    "last_name": "Lovelace",
    "email": "ada@example.com",
    "phone": "254712345678",
    "country": "KE",
    "state": "Nairobi",
    "city": "Nairobi",
    "address": "1 Market Street",
    "zip_code": "00100",
    "id_type": "National_ID",
    "id_number": "A12345678"
  }'
```

```json theme={null}
{
  "code": 200,
  "message": "Card user created.",
  "data": {
    "user_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
    "email": "ada@example.com",
    "name": "Ada Lovelace"
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.