NAV
javascript

Introduction

Welcome to the generated API reference.

Do you use Postman? Great.
Get Postman Collection
Get Postman Environment

Header

Header Value When should I send?
Accept application/json All requests
Content-Type application/x-www-form-urlencoded Must send when passing query string in request body
Content-Type application/json Must send when passing json in request body
Content-Type multipart/form-data Must send when passing files in request body
Authorization Bearer access_token Whenever the resource requires an authenticated user
Language language All requests

Controlling requests

All API requests are limited to prevent abuse and ensure stability.
The limit is usually 120 requests every 1 minute. But each route can have its own limit.
You can always check the response header to have a status of available requests:

X-RateLimit-Limit → 120
X-RateLimit-Remaining → 25

Errors

API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request sucks
401 Unauthorized -- Your API key is wrong
403 Forbidden -- You are not authorized or do not have permission to access
404 Not Found -- The specified page can not be found
405 Method Not Allowed -- Method not allowed for this request
406 Not Acceptable -- You have requested a format that is not valid
410 Gone -- The target resource is no longer available
413 Payload Too Large -- Request payload is larger than the server is willing or able to process
422 Unprocessable Entity -- Validation error, the given data was invalid
429 Too Many Requests -- You have sent too many requests in a certain amount of time ("rate limiting")
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarially offline for maintanance. Please try again later.

Authentication

Login

5 login attempts can be performed every 1 minute.

Example request:

const axios = require('axios');

axios({
    "method": "post",
    "url": "http://api.fazfertil.local/api/v1/customer/auth/login",
    "headers": {
        "Content-Type": "application/x-www-form-urlencoded",
        "Accept": "application/json",
        "Language": "{language}"
    },
    "data": {
        "email": "erivera@example.com",
        "password": "oBYLmCRB35",
        "token_name": "My Computer"
}
})
.then(function (response) {
    // handle success
    console.log(response);
})
.catch(function (error) {
    // handle error
    console.log(error);
})
.finally(function () {
    // optional, always executed
});

Example response:

{
    "token_type": "Bearer",
    "access_token": "eyJ0eXAiOiJ..."
}

HTTP Request

POST api/v1/customer/auth/login

No authentication required

Parameters

Parameter Type Validation Description
email string required|email
password string required|string|min:6
token_name string required|string|max:191 Client app name

Password recovery

Send password reset link do user

Example request:

const axios = require('axios');

axios({
    "method": "post",
    "url": "http://api.fazfertil.local/api/v1/customer/auth/password/recovery",
    "headers": {
        "Content-Type": "application/x-www-form-urlencoded",
        "Accept": "application/json",
        "Language": "{language}"
    },
    "data": {
        "email": "maraisa.gil@example.net"
}
})
.then(function (response) {
    // handle success
    console.log(response);
})
.catch(function (error) {
    // handle error
    console.log(error);
})
.finally(function () {
    // optional, always executed
});

Example response:

{
    "message": "Success message"
}

HTTP Request

POST api/v1/customer/auth/password/recovery

No authentication required

Parameters

Parameter Type Validation Description
email string required|email

Reset the given user's password.

Example request:

const axios = require('axios');

axios({
    "method": "post",
    "url": "http://api.fazfertil.local/api/v1/customer/auth/password/reset",
    "headers": {
        "Authorization": "Bearer {access_token}",
        "Content-Type": "application/x-www-form-urlencoded",
        "Accept": "application/json",
        "Language": "{language}"
    }})
.then(function (response) {
    // handle success
    console.log(response);
})
.catch(function (error) {
    // handle error
    console.log(error);
})
.finally(function () {
    // optional, always executed
});

HTTP Request

POST api/v1/customer/auth/password/reset

Logout

Example request:

const axios = require('axios');

axios({
    "method": "delete",
    "url": "http://api.fazfertil.local/api/v1/customer/auth/logout",
    "headers": {
        "Authorization": "Bearer {access_token}",
        "Content-Type": "application/x-www-form-urlencoded",
        "Accept": "application/json",
        "Language": "{language}"
    }})
.then(function (response) {
    // handle success
    console.log(response);
})
.catch(function (error) {
    // handle error
    console.log(error);
})
.finally(function () {
    // optional, always executed
});

HTTP Request

DELETE api/v1/customer/auth/logout

Get the authenticated user

Example request:

const axios = require('axios');

axios({
    "method": "get",
    "url": "http://api.fazfertil.local/api/v1/customer/auth/user",
    "headers": {
        "Authorization": "Bearer {access_token}",
        "Accept": "application/json",
        "Language": "{language}"
    }})
.then(function (response) {
    // handle success
    console.log(response);
})
.catch(function (error) {
    // handle error
    console.log(error);
})
.finally(function () {
    // optional, always executed
});

Example response:

null

HTTP Request

GET api/v1/customer/auth/user

Get all tokens

Example request:

const axios = require('axios');

axios({
    "method": "get",
    "url": "http://api.fazfertil.local/api/v1/customer/auth/tokens",
    "headers": {
        "Authorization": "Bearer {access_token}",
        "Accept": "application/json",
        "Language": "{language}"
    }})
.then(function (response) {
    // handle success
    console.log(response);
})
.catch(function (error) {
    // handle error
    console.log(error);
})
.finally(function () {
    // optional, always executed
});

Example response:

null

HTTP Request

GET api/v1/customer/auth/tokens

Delete token

Example request:

const axios = require('axios');

axios({
    "method": "delete",
    "url": "http://api.fazfertil.local/api/v1/customer/auth/tokens/{tokenId}",
    "headers": {
        "Authorization": "Bearer {access_token}",
        "Content-Type": "application/x-www-form-urlencoded",
        "Accept": "application/json",
        "Language": "{language}"
    }})
.then(function (response) {
    // handle success
    console.log(response);
})
.catch(function (error) {
    // handle error
    console.log(error);
})
.finally(function () {
    // optional, always executed
});

HTTP Request

DELETE api/v1/customer/auth/tokens/{tokenId}

Change password

Example request:

const axios = require('axios');

axios({
    "method": "post",
    "url": "http://api.fazfertil.local/api/v1/customer/auth/change-password",
    "headers": {
        "Authorization": "Bearer {access_token}",
        "Content-Type": "application/x-www-form-urlencoded",
        "Accept": "application/json",
        "Language": "{language}"
    },
    "data": {
        "password": "my_current_password",
        "password_new": "my_new_password",
        "password_new_confirmation": "my_new_password"
}
})
.then(function (response) {
    // handle success
    console.log(response);
})
.catch(function (error) {
    // handle error
    console.log(error);
})
.finally(function () {
    // optional, always executed
});

HTTP Request

POST api/v1/customer/auth/change-password

Parameters

Parameter Type Validation Description
password string required|string|min:6 Current password
password_new string required|string|min:6 New password
password_new_confirmation string required|string|min:6 Confirmation, must equal password_new

Change avatar

Example request:

const axios = require('axios');

axios({
    "method": "post",
    "url": "http://api.fazfertil.local/api/v1/customer/auth/change-avatar",
    "headers": {
        "Authorization": "Bearer {access_token}",
        "Content-Type": "multipart/form-data",
        "Accept": "application/json",
        "Language": "{language}"
    },
    "data": {
        "avatar": "{file}"
}
})
.then(function (response) {
    // handle success
    console.log(response);
})
.catch(function (error) {
    // handle error
    console.log(error);
})
.finally(function () {
    // optional, always executed
});

Example response:

{
    "file_url": "{url}"
}

HTTP Request

POST api/v1/customer/auth/change-avatar

Parameters

Parameter Type Validation Description
avatar file required|mimes:jpeg,png|max:4mb

Faq

Get all faq

Example request:

const axios = require('axios');

axios({
    "method": "get",
    "url": "http://api.fazfertil.local/api/v1/customer/faq",
    "headers": {
        "Accept": "application/json",
        "Language": "{language}"
    }})
.then(function (response) {
    // handle success
    console.log(response);
})
.catch(function (error) {
    // handle error
    console.log(error);
})
.finally(function () {
    // optional, always executed
});

Example response:

null

HTTP Request

GET api/v1/customer/faq

No authentication required

Query Parameters

Parameter Type Validation Description
limit integer integer Default: 20 Max: 100
page integer integer
orderBy string string Default: id:asc.
Available fields: id name order created_at updated_at
search string string Search in the fields: uuid name

Get faq

Example request:

const axios = require('axios');

axios({
    "method": "get",
    "url": "http://api.fazfertil.local/api/v1/customer/faq/{faq}",
    "headers": {
        "Accept": "application/json",
        "Language": "{language}"
    }})
.then(function (response) {
    // handle success
    console.log(response);
})
.catch(function (error) {
    // handle error
    console.log(error);
})
.finally(function () {
    // optional, always executed
});

Example response:

null

HTTP Request

GET api/v1/customer/faq/{faq}

No authentication required

How It Works

Get all how it works

Example request:

const axios = require('axios');

axios({
    "method": "get",
    "url": "http://api.fazfertil.local/api/v1/customer/how-it-works",
    "headers": {
        "Accept": "application/json",
        "Language": "{language}"
    }})
.then(function (response) {
    // handle success
    console.log(response);
})
.catch(function (error) {
    // handle error
    console.log(error);
})
.finally(function () {
    // optional, always executed
});

Example response:

null

HTTP Request

GET api/v1/customer/how-it-works

No authentication required

Permission required

how-it-works.list

Query Parameters

Parameter Type Validation Description
limit integer integer Default: 20 Max: 100
page integer integer
orderBy string string Default: id:asc.
Available fields: id name order created_at updated_at
search string string Search in the fields: uuid name

Get how it works

Example request:

const axios = require('axios');

axios({
    "method": "get",
    "url": "http://api.fazfertil.local/api/v1/customer/how-it-works/{how_it_works}",
    "headers": {
        "Accept": "application/json",
        "Language": "{language}"
    }})
.then(function (response) {
    // handle success
    console.log(response);
})
.catch(function (error) {
    // handle error
    console.log(error);
})
.finally(function () {
    // optional, always executed
});

Example response:

null

HTTP Request

GET api/v1/customer/how-it-works/{how_it_works}

No authentication required

Permission required

how-it-works.show

Institutional

About app

Example request:

const axios = require('axios');

axios({
    "method": "get",
    "url": "http://api.fazfertil.local/api/v1/customer/institutional/about-app",
    "headers": {
        "Accept": "application/json",
        "Language": "{language}"
    }})
.then(function (response) {
    // handle success
    console.log(response);
})
.catch(function (error) {
    // handle error
    console.log(error);
})
.finally(function () {
    // optional, always executed
});

Example response:

null

HTTP Request

GET api/v1/customer/institutional/about-app

No authentication required

About company

Example request:

const axios = require('axios');

axios({
    "method": "get",
    "url": "http://api.fazfertil.local/api/v1/customer/institutional/company-app",
    "headers": {
        "Accept": "application/json",
        "Language": "{language}"
    }})
.then(function (response) {
    // handle success
    console.log(response);
})
.catch(function (error) {
    // handle error
    console.log(error);
})
.finally(function () {
    // optional, always executed
});

Example response:

null

HTTP Request

GET api/v1/customer/institutional/company-app

No authentication required

Privacy policy

Example request:

const axios = require('axios');

axios({
    "method": "get",
    "url": "http://api.fazfertil.local/api/v1/customer/institutional/privacy-policy",
    "headers": {
        "Accept": "application/json",
        "Language": "{language}"
    }})
.then(function (response) {
    // handle success
    console.log(response);
})
.catch(function (error) {
    // handle error
    console.log(error);
})
.finally(function () {
    // optional, always executed
});

Example response:

null

HTTP Request

GET api/v1/customer/institutional/privacy-policy

No authentication required

Terms of use

Example request:

const axios = require('axios');

axios({
    "method": "get",
    "url": "http://api.fazfertil.local/api/v1/customer/institutional/terms-of-use",
    "headers": {
        "Accept": "application/json",
        "Language": "{language}"
    }})
.then(function (response) {
    // handle success
    console.log(response);
})
.catch(function (error) {
    // handle error
    console.log(error);
})
.finally(function () {
    // optional, always executed
});

Example response:

null

HTTP Request

GET api/v1/customer/institutional/terms-of-use

No authentication required

Webservice

Cities

Search city, must enter at least one of the search fields search or state_abbr
List a maximum of 50 items.

Example request:

const axios = require('axios');

axios({
    "method": "get",
    "url": "http://api.fazfertil.local/api/v1/customer/webservice/cities",
    "headers": {
        "Accept": "application/json",
        "Language": "{language}"
    }})
.then(function (response) {
    // handle success
    console.log(response);
})
.catch(function (error) {
    // handle error
    console.log(error);
})
.finally(function () {
    // optional, always executed
});

Example response:

null

HTTP Request

GET api/v1/customer/webservice/cities

No authentication required

Query Parameters

Parameter Type Validation Description
search string string Search in the fields: full_name
state_abbr string string

States

Example request:

const axios = require('axios');

axios({
    "method": "get",
    "url": "http://api.fazfertil.local/api/v1/customer/webservice/states",
    "headers": {
        "Accept": "application/json",
        "Language": "{language}"
    }})
.then(function (response) {
    // handle success
    console.log(response);
})
.catch(function (error) {
    // handle error
    console.log(error);
})
.finally(function () {
    // optional, always executed
});

Example response:

null

HTTP Request

GET api/v1/customer/webservice/states

No authentication required

Query Parameters

Parameter Type Validation Description
search string string Search in the fields: name

Find zipcode

Example request:

const axios = require('axios');

axios({
    "method": "get",
    "url": "http://api.fazfertil.local/api/v1/customer/webservice/zipcode/{zipcode}",
    "headers": {
        "Accept": "application/json",
        "Language": "{language}"
    }})
.then(function (response) {
    // handle success
    console.log(response);
})
.catch(function (error) {
    // handle error
    console.log(error);
})
.finally(function () {
    // optional, always executed
});

Example response:

null

HTTP Request

GET api/v1/customer/webservice/zipcode/{zipcode}

No authentication required