Create User#
Creates a new user account with associated locations.
POST https://api.groupvan.com/internal/users/create
Request#
Parameters#
usernamestring requiredUnique username for the new account
first_namestring requiredUser’s first name
last_namestring requiredUser’s last name
emailstring requiredUser’s email address. Must be a valid email format and not already in use.
addressstring requiredStreet address. Must be a valid address (validated via Google).
citystring requiredCity
statestring requiredState
zipstring requiredZip code
employee_idstring requiredEmployee ID
catalog_region_idstring requiredCatalog region ID. Must be a valid region. See Catalog Regions for available regions.
account_idstring requiredAccount ID
phone_numberstringPhone number. Must match the pattern
+?1?\d{10}if provided. Defaults to empty string.company_namestringCompany name. Defaults to empty string.
terminal_pinstringTerminal PIN. Defaults to null.
locationsarray requiredArray of locations to assign to the user. Must contain at least one location with
sort_order: 1andcan_order: true. Allsort_ordervalues must be unique and greater than 0.idstring requiredLocation ID. Must be a valid location for the member.
can_orderboolean requiredWhether the user can place orders from this location. The primary location (
sort_order: 1) must have this set totrue.sort_orderinteger requiredDisplay order for the location. Must be a unique positive integer. The location with
sort_order: 1is the primary location.
Example#
{
"username": "jsmith",
"first_name": "John",
"last_name": "Smith",
"email": "jsmith@example.com",
"address": "123 Main St",
"city": "Springfield",
"state": "IL",
"zip": "62701",
"employee_id": "EMP001",
"phone_number": "5551234567",
"catalog_region_id": "region1",
"account_id": "acct1",
"company_name": "Smith Auto",
"locations": [
{
"id": "loc1",
"can_order": true,
"sort_order": 1
},
{
"id": "loc2",
"can_order": false,
"sort_order": 2
}
]
}
Response#
Success#
{
"username": "jsmith",
"user_id": 12345
}
A welcome email with login credentials is sent to the user’s email address upon successful creation.
Errors#
Error |
Status |
Description |
|---|---|---|
Invalid catalog region id |
400 |
The provided |
Username already exists |
400 |
The provided |
Email already exists |
400 |
The provided |
Invalid address |
400 |
The address could not be validated |
Invalid user locations |
400 |
One or more location IDs are not valid for the member |