Business Registration - MarcoLagalla/marette_backend GitHub Wiki
Name | Customer Registration |
---|---|
Description | Allow registering a new business user |
URL | api/v1/account/business |
Allowed methods | POST |
Authorizations | AllowAny |
Allows registering a new business 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 | yes | no | |
last_name |
string | yes | no | |
birth_date |
date | yes | no | YYYY-MM-DD |
cf |
string | yes | yes | italian ssn |
city |
string | yes | no | |
address |
string | yes | no | |
n_civ |
string | yes | no | |
cap |
numeric | yes | no | |
phone |
numeric | yes | yes | valid phone number |
{
"avatar": <ImageFile>,
"data": {
"username": "Gestore",
"email": "[email protected]",
"password": "1234",
"password2": "1234",
"phone": "3456765345",
"first_name": "Mastro",
"last_name": "Lindo",
"birth_date": "1995-04-20",
"cf": "MSTLND94D20F205M",
"city": "Torino",
"address": "Via san GIovanni Bosco",
"n_civ": "9",
"cap": 16879
}
}
If all parameters are valid, returns --> HTTP_201_CREATED
or otherwise --> HTTP_400_BAD_REQUEST
Also returns the Authentication Token:
{
"response": "successfully registered a new business user",
"username": "pippo34",
"email": "[email protected]",
"token": "3fdf5d982f82549023bce35c751920bb6a36174e",
"id": 4
}