Login

POST /auth/login

This endpoint is used for user authentication. It takes a user number and password, and upon successful authentication, returns a new access token. All previous tokens are invalidated.

Request

  • URL: https://xvdev.xash.co.zw/api/v1/auth/login

  • Method: POST

  • Headers:

    • Accept: application/json

  • Body Parameters:

    • user_number (string): The user's unique number.

    • password (string): The user's password.

Example Request

var axios = require("axios").default;

var options = {
  method: 'POST',
  url: 'https://xvdev.xash.co.zw/api/v1/auth/login',
  headers: {
    Accept: 'application/json',
  },
  data: []
};

axios.request(options).then(function (response) {
  console.log(response.data);
}).catch(function (error) {
  console.error(error);
});

Response

  • Success:

    • success (boolean): Indicates if the login was successful.

    • accessToken (string): The Bearer token for authentication.

    • tokenType (string): The type of the token provided.

    • has_address (boolean): Indicates if the user has an address.

    • has_business (boolean): Indicates if the user has a business.

    • message (string): Description of the response.

Example Response

Error Response

  • Code: 401 Unauthorized

  • Content:

Last updated