# Create a user

Endpoint: POST /buyers/{buyerID}/users
Version: 1.0.457.36910
Security: OAuth2

## Security:

  - `OAuth2` (unknown)
    oauth2 scopes: FullAccess, BuyerUserAdmin

## Path parameters:

  - `buyerID` (string, required)
    ID of the buyer.

## Request fields (application/json):

  - `ID` (string)

  - `Username` (string)
    Must be unique across all organizations.

  - `Password` (string)

  - `FirstName` (string)

  - `LastName` (string)

  - `Email` (string)

  - `Phone` (string)

  - `TermsAccepted` (string)

  - `Active` (boolean)
    If false, authentication is prohibited.

  - `xp` (object)

  - `Locale` (object)
    Most specific locale assigned to the user, if any.
    Example: {"ID":"","OwnerID":"","Currency":"","Language":""}

  - `Locale.ID` (string)

  - `Locale.OwnerID` (string)
    ID of the organization that owns the Locale. Only the marketplace owner can override the OwnerID on create.

  - `Locale.Currency` (string)
    We recommend using ISO-4217 currency codes for compatibility with tax and payment processors.

  - `Locale.Language` (string)
    We recommend using ISO-639 language code - ISO-3166 Country code (e.g. en-US).

## Response 201 fields (application/json):

  - `FailedLoginAttempts` (integer)
    Number of times the user failed authentication due to incorrect password since last successful attempt, or since being unlocked.

  - `ID` (string)

  - `CompanyID` (string)

  - `Username` (string)
    Must be unique across all organizations.

  - `Password` (string)

  - `FirstName` (string)

  - `LastName` (string)

  - `Email` (string)

  - `Phone` (string)

  - `TermsAccepted` (string)

  - `Active` (boolean)
    If false, authentication is prohibited.

  - `xp` (object)

  - `AvailableRoles` (array)
    List of roles currently available to the user via all security profile assignments.

  - `Locale` (object)
    Most specific locale assigned to the user, if any.
    Example: {"ID":"","OwnerID":"","Currency":"","Language":""}

  - `Locale.ID` (string)

  - `Locale.OwnerID` (string)
    ID of the organization that owns the Locale. Only the marketplace owner can override the OwnerID on create.

  - `Locale.Currency` (string)
    We recommend using ISO-4217 currency codes for compatibility with tax and payment processors.

  - `Locale.Language` (string)
    We recommend using ISO-639 language code - ISO-3166 Country code (e.g. en-US).

  - `DateCreated` (string)

  - `LastActive` (string)
    Accurate within a few minutes. Includes impersonation activity.

  - `PasswordLastSetDate` (string)
    Can be used in conjunction with SecurityProfile.PasswordConfig to enforce password reset schedules.

## Response 4XX:

  - `4XX` (unknown)
    Expected errors range from 400-409. Anything in the 5XX range indicates a server issue and should be reported to support.

## Response 4XX fields (application/json):

  - `StatusCode` (integer)
    Example: 404

  - `ErrorCode` (string)
    Example: NotFoundError

  - `Message` (string)
    Example: Object not found

  - `Data` (object)
    Example: {"ObjectType":"","ObjectID":""}

