Customer Registration - MarcoLagalla/marette_backend GitHub Wiki

Name Customer Registration
Description Allow registering a new customer user
URL api/v1/account/customer
Allowed methods POST
Authorizations AllowAny

POST


Allows registering a new user.

Field Type Required Unique Comments
avatar image no no can be omitted
username string yes yes
email string yes yes used for login
password string yes yes equals to password2
password2 string yes yes equals to password
first_name string no no
last_name string no no
birth_date string_date no no
phone numeric yes yes valid phone number
{
    "avatar": <ImageFile>,
    "data": {
        "username": "Lucci",
	"email": "[email protected]",
	"password": "1234",
        "password2": "1234",
        "phone": "3456765789"
    }
}

If all parameters are valid, returns --> HTTP_201_CREATED or otherwise --> HTTP_400_BAD_REQUEST

When a user is created, returns also an Auth Token:

{
    "response": "successfully registered a new customer user",
    "username": "pippo34",
    "email": "[email protected]",
    "token": "3fdf5d982f82549023bce35c751920bb6a36174e",
    "id": 4
}
⚠️ **GitHub.com Fallback** ⚠️