Перейти к основному содержимому

Create User API

POST /createUser

Description

This API endpoint allows for the creation of a new user by providing user account details and profile information. The admin or authorized user can specify attributes such as email, password, and reseller ID for the account, along with personal information for the user's profile.

Request Body

The request utilizes GraphQL to perform the createUser mutation.

Mutation:

mutation createUser ($user: UserCreate, $userProfile: UserProfileEdit) {
createUser (user: $user, userProfile: $userProfile)
}

Variables:

{
"user": {
"email": "<User_Email>",
"password": "<User_Password>",
"resellerId": 0
},
"userProfile": {
"firstName": "<First_Name>",
"lastName": "<Last_Name>",
"phone": "<Phone_Number>",
"address": "<Address>",
"city": "<City>",
"country": "<Country>",
"postalCode": "<Postal_Code>",
"birthDate": "<YYYY-MM-DD>"
}
}
  • user (UserCreate Object): An object containing the user's account details.

    • email (String): The email address of the user.
    • password (String): The password for the user's account.
    • resellerId (Int): The ID of the reseller associated with the user.
  • userProfile (UserProfileEdit Object): An object containing the user's profile details.

    • firstName (String): The first name of the user.
    • lastName (String): The last name of the user.
    • phone (String): The user's phone number.
    • address (String): The street address of the user.
    • city (String): The city where the user resides.
    • country (String): The country where the user resides.
    • postalCode (String): The postal code for the user's address.
    • birthDate (String): The user's birth date in YYYY-MM-DD format.

Response:

  • Success (200 OK):

    • If the user creation is successful, the response will confirm that the user has been created, though specific user data may be returned depending on the implementation.
  • Error (4XX/5XX):

    • Appropriate error messages and status codes will be returned in cases of invalid data, missing required fields, or server errors.

Note:

Ensure that all required fields for both the user and userProfile objects are provided and correctly formatted according to the platform's specifications. This API should be used by admins or authorized users with the necessary permissions to create new user accounts and profiles.