> For the complete documentation index, see [llms.txt](https://dev.flexshopper.com/medusa/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev.flexshopper.com/medusa/customer/create-user.md).

# Create User

Create a new user

<mark style="color:orange;">`POST`</mark> /v3/users

## Request

The details below help you form your HTTP requests to this endpoint.

### Headers

You may need to provide specific headers.

<table><thead><tr><th>Name</th><th>Type</th><th data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td>x-consumer-custom-id</td><td>string</td><td>true</td><td>Consumer data with the format "channel:vendorId"</td></tr></tbody></table>

### Body

You must provide a JSON payload.

<table><thead><tr><th>Name</th><th>Type</th><th data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td>firstName</td><td>string</td><td>true</td><td>User's first name</td></tr><tr><td>lastName</td><td>string</td><td>true</td><td>User's last name</td></tr><tr><td>email</td><td>string</td><td>true</td><td>Users email address to authenticate with</td></tr><tr><td>password</td><td>string</td><td>false</td><td>User password to authenticate with</td></tr><tr><td>resetPassword</td><td>boolean</td><td>false</td><td>Determines if password reset e-mail will be send</td></tr><tr><td>locale</td><td>string</td><td>false</td><td>Language part of the user locale, not the full locale.</td></tr></tbody></table>

## Response

The details below help you understand the responses you could get from this endpoint.

### Samples

Below are samples of responses, with tabs corresponding to returned status code.

{% tabs %}
{% tab title="200" %}

```javascript
{
    "data": {
        "userId": "5a319511a86980001d602095",
        "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1YTk..."
    }
}
```

{% endtab %}

{% tab title="400" %}

```javascript
{
    "error": {
        "statusCode": 400,
        "code": "UserAlreadyExists",
        "message": "User already exists with email ex@example.com",
        "data": {}
    }
}
```

{% endtab %}

{% tab title="409" %}

```javascript
{
    "error": {
        "statusCode": 409,
        "code": "UserAlreadyExists",
        "message": "The user already exists",
        "data": {}
    }
}
```

{% endtab %}
{% endtabs %}

### Schema

The response's schema is outlined below.

<table><thead><tr><th>Name</th><th>Type</th><th data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td>data</td><td>object</td><td>false</td><td>N/A</td></tr><tr><td>data.userId</td><td>string</td><td>true</td><td>User id</td></tr><tr><td>data.token</td><td>string</td><td>true</td><td>User authorization token</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://dev.flexshopper.com/medusa/customer/create-user.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
