https://botijon.herokuapp.com/api
GET: /users/
Status
Response
success
status: 'success', message: 'Return all users', 'data': output
error
status: 'error', message: 'There arent users', 'data': {}
GET: /users/:id
Status
Response
success
status: 'success', message: 'Return one user', 'data': output
error
status: 'error', message: 'User dont found', 'data': {}
GET: /users/validation/:user
params
type
:user
object json
example: /users/validation/{"email":string,"password":string}
Status
Response
success
status: 'success', message: 'User registered', 'data': output
error
status: 'error', message: 'User dont registered', 'data': {}
POST: /users/create
Body:
{
"email":string,
"password": string
}
Status
Response
success
status: 'success', message: 'Registered successfully', 'data': outpu
error
status: 'error', message: 'Could not register user', 'data': {}
PUT: /users/update/:id
Body:
{
"password": string
}
Status
Response
success
status: 'success', message: 'User update successfully', 'data': output
error
status: 'error', message: 'Cannot possible update the user', 'data': {}
GET: /customers
Status
Response
success
status: 'success', message: 'Return all customers', 'data': output
error
status: 'error', message: 'There arent customers', 'data': {}
GET: /customers/:id
Status
Response
success
status: 'success', message: 'Return one customer', 'data': output
error
status: 'error', message: 'Customer dont found', 'data': {}
GET: /customers/validation/:customer
params
type
:customer
object json
example: /users/validation/{"email":string,"password":string}
Status
Response
success
status: 'success', message: 'Customer registered', 'data': output
error
status: 'error', message: 'Customer dont registered', 'data': {}
POST: /customers/create
Body:
{
"name": string,
"email": string,
"password": string
}
Status
Response
success
status: 'success', message: 'Customer registered successfully', 'data': output
error
status: 'error', message: 'Could not register customer', 'data': {}
PUT: /customers/changepassword/:id
Body:
{
"password": string
}
Status
Response
success
status: 'success', message: 'Customer update successfully', 'data': output
error
status: 'error', message: 'Cannnot possible update the customer', 'data': {}
PUT: /customers/changename/:id
Status
Response
success
status: 'success', message: 'Customer update successfully', 'data': output
error
status: 'error', message: 'Cannnot possible update the customer', 'data': {}
GET: /sellers
Status
Response
success
status: 'success', message: 'Return all sellers', 'data': output
error
status: 'error', message: 'There arent sellers', 'data': {}
GET: /sellers/:id
Status
Response
success
status: 'success', message: 'Return one seller', 'data': output
error
status: 'error', message: 'Seller dont found', 'data': {}
GET: /sellers/validation/:seller
params
type
:seller
object json
example: /validation/{"email":string,"password":string}
Status
Response
success
status: 'success', message: 'Seller registered', 'data': output
error
status: 'error', message: 'Seller dont registered', 'data': {}
GET: /sellers/verify/:seller
params
type
:seller
object json
Example:
/validation/{"cpfcnpj":string}
Status
Response
success
status: 'success', message: 'Seller registered', 'data': output
error
status: 'error', message: 'Seller dont registered', 'data': {}
POST: /sellers/create
Body:
{
"name": string,
"email": string,
"password": string,
"cpfcnpj": string,
"address_id": number //on start can be null, after in edit profile page should be add
}
Status
Response
success
status: 'success', message: 'Customer registered successfully', 'data': output
error
status: 'error', message: 'Could not register customer', 'data': {}
PUT: /sellers/changeaddress/:id
Body:
{
"address_id": number
}
Status
Response
success
status: 'success', message: 'Seller update successfully', 'data': output
error
status: 'error', message: 'Cannnot possible update the seller', 'data': {}
PUT: /sellers/changename/:id
Status
Response
success
status: 'success', message: 'Seller update successfully', 'data': output
error
status: 'error', message: 'Cannnot possible update the seller', 'data': {}
PUT: /sellers/changepassword/:id
Body:
{
"password": string
}
Status
Response
success
status: 'success', message: 'Seller update successfully', 'data': output
error
status: 'error', message: 'Cannnot possible update the seller', 'data': {}
GET: /products
Status
Response
success
status: 'success', message: 'Returned all products', 'data': output
error
status: 'error', message: 'There arent products found', 'data': {}
Get All Products per type
GET: /products/pertype/:productType
Example:
/products/pertype/agua
/products/pertype/gas
Status
Response
success
status: 'success', message: 'Returned all Products this type', 'data': output
error
status: 'error', message: 'There arent products this type registered', 'data': {}
Get All Products per type and status
GET: /products/availabletypes/:availabletypes
params
type
:availabletypes
object json
Example:
/products/availabletypes/{"product_type": string,"status": string}
/products/availabletypes/{"product_type": "agua","status": "available"}
/products/availabletypes/{"product_type": "gas","status": "unavailable"}
Status
Response
success
status: 'success', message: 'Returned all products with this status of this type', 'data': output
error
status: 'error', message: 'There arent products this status of this type', 'data': {}
Get All Products per description
GET: /products/description/:description
params
type
:description
string
Example:
/products/description/Água Mineral Marca X 20L
Status
Response
success
status: 'success', message: 'Returned all products', 'data': output
error
status: 'error', message: 'Product dont found', 'data': {}
Get All products with value bigger than value params
GET: /products/biggervalue/:value
params
type
:value
number
Status
Response
success
status: 'success', message: 'Returned all Products this value', 'data': output
error
status: 'error', message: 'There arent products this value registered', 'data': {}
Get All products with value smaller than value params
GET: /products/smallervalue/:value
params
type
:value
number
Status
Response
success
status: 'success', message: 'Returned all Products this value', 'data': output
error
status: 'error', message: 'There arent products this value registered', 'data': {}
GET: /products/:id
Status
Response
success
status: 'success', message: 'Returned one product', 'data': output
error
status: 'error', message: 'Product dont found', 'data': {}
POST: /products/create
Body:
{
"name": string,
"value": decimal,
"seller_id": number,
"product_type": string, //can be 'agua' or 'gas'
"status": string //can be 'available or unavailable'
}
Status
Response
success
status: 'success', message: 'Product created successfully', 'data': output
error
status: 'error', message: 'Could not create product', 'data': {}
Change Product's description
PUT: /products/changedescription/:id
Body:
{
"description": string
}
Status
Response
success
status: 'success', message: 'Product description update successfully', 'data': output
error
status: 'error', message: 'Could not possible update the product description', 'data': {}
PUT: /products/changevalue/:id
Body:
{
"value": decimal
}
Status
Response
success
status: 'success', message: 'Product value update successfully', 'data': output
error
status: 'error', message: 'Could not possible update the product value', 'data': {}
PUT: /products/changestatus/:id
Body:
{
"status": string //can be 'available' or 'unavailable'
}
Status
Response
success
status: 'success', message: 'Product status update successfully', 'data': output
error
status: 'error', message: 'Could not possible update the product status', 'data': {}
GET: /addresses
Status
Response
success
status: 'success', message: 'Returned all addresses', 'data': output
error
status: 'error', message: 'There arent addresses', 'data': {}
Get one address by address, number and cep
GET: /addresses/getid/:address
params
type
:address
object json
Example:
/addresses/getid/{"address":string,"number":number,"cep":string}
/addresses/getid/{"address":"rua passarinho","number":"21","cep":"54331002"}
Status
Response
success
status: 'success', message: 'Return Address id', 'data': output
error
status: 'error', message: 'This address is not found', 'data': {}
POST: /addresses/create
Body:
{
"address": string,
"number": string or number,
"neighborhood": string,
"city": string,
"state": string,
"cep": string,
"reference_point": string //can be null
}
Status
Response
success
status: 'success', message: 'Address registered successfully', 'data': output
error
status: 'error', message: 'Could not register the address', 'data': {}
PUT: /addresses/update/:id
Body:
{
"address": string,
"number": string or number,
"neighborhood": string,
"city": string,
"state": string,
"cep": string,
"reference_point": string //can be null
}
Status
Response
success
status: 'success', message: 'Address update successfully', 'data': output
error
status: 'error', message: 'Could not possible update the address', 'data': {}
GET: /requests
Status
Response
success
status: 'success', message: 'Returned all requests', 'data': output
error
status: 'error', message: 'There arent requests found', 'data': {}
GET: /requests/:id
Status
Response
success
status: 'success', message: 'Returned one request', 'data': output
error
status: 'error', message: 'There arent requests found', 'data': {}
POST: /requests/create
Body:
{
"customer_id": number,
"product_id": number,
"quantity": number
}
Status
Response
success
status: 'success', message: 'Request registered successfully', 'data': output
error
status: 'error', message: 'Could not register the request', 'data': {}
PUT: /requests/update/:id
Body:
{
"quantity": number
}
Status
Response
success
status: 'success', message: 'Request update successfully', 'data': output
error
status: 'error', message: 'Could not possible update the request', 'data': {}
GET: /payments
Status
Response
success
status: 'success', message: 'Returned all payments', 'data': output
error
status: 'error', message: 'There arent payments', 'data': {}
GET: /payments/:id
Status
Response
success
status: 'success', message: 'Returned one payment', 'data': output
error
status: 'error', message: 'There arent payments', 'data': {}
Get all payments per status and type
GET: /payments/typestatus/:payment
params
type
:payment
object json
Example:
/payments/typestatus/{"payment_type":string,"status":string}
payment_type:
can be "dinheiro" or "cartao"
status:
can be "success", "waiting" or "failed"
Status
Response
success
status: 'success', message: 'Returned all payments type and status', 'data': output
error
status: 'error', message: 'There arent payments', 'data': {}
POST: /payments/create/
Body:
{
"value": double,
payment_type: string, //can be "dinheiro" or "cartao"
address_id: number,
status: string // can be "success", "waiting" or "failed"
}
Status
Response
success
status: 'success', message: 'Payment registered successfully', 'data': output
error
status: 'error', message: 'Could not possible register the payment', 'data': {}
PUT: /payments/changevalue/:id
Body:
{
"value": double
}
Status
Response
success
status: 'success', message: 'Payment value update successfully', 'data': output
error
status: 'error', message: 'Could not possible update the payment value', 'data': {}
PUT: /payments/changestatus/:id
Body:
{
"status": string
}
Status
Response
success
status: 'success', message: 'Status payment update successfully', 'data': output
error
status: 'error', message: 'Could not possible update the payment status', 'data': {}