Skip to main content

Login

Use the endpoint below to login.

POST /api/v1/auth/login

authorization : bearer token
REQUEST BODY SCHEMA : application/json
username
string

Email or phone number. Required if firebaseToken is not provided

password
string

User password. Required if firebaseToken is not provided

firebaseToken
string

User firebase access token. Required if username and password are not provided

{
  • "username": "string",
  • "password": "string",
  • "firebaseToken": "string"
}


Request Sample

To log in, a bearer token is required. The user must follow the steps below.

  • Input the username (this is either email or phone number).
  • Enter the password.
username
string

Email or phone number. Required if firebaseToken is not provided

password
string

User password. Required if firebaseToken is not provided

firebaseToken
string

User firebase access token. Required if username and password are not provided

{
  • "username": "string",
  • "password": "string",
  • "firebaseToken": "string"
}

Response Sample

id
required
string

Unique ID of the record

createdAt
required
string <date-time>

Date & time at which the record was created

updatedAt
required
string <date-time>

Date & time at which the record was updated

companyName
string

Company name. Required if client type is CORPORATE

email
string

Email of the client

country
required
string

Country of the client

city
string

The name of the city where the client (individual/company) is located

region
string

Region/State name

digitalAddress
string

Digital address (Ghana Post GPS address) of the client

password
string >= 5 characters

Account password

industry
string

Industry of the client

address
string

Address of the client

notes
string

Additional notes about the client

dateOfIncorporation
string

Date the company was incorporated

type
required
string
Enum: "CORPORATE" "INDIVIDUAL"

The type of client

groups
required
Array of strings
Default: []

List of groups the client belongs to

Array of objects (ContactPersonDto)

Contact persons details

firstName
string

Client first name. Required if client is INDIVIDUAL

lastName
string

Client last name. Required if client is INDIVIDUAL

otherNames
string

Middle or other names (if any)

title
string
gender
string
Enum: "MALE" "FEMALE" "OTHER"
age
number

The age of the client, calculated from the date of birth.
null if the client is CORPORATE

fullName
required
string

Client full name

isActive
boolean

Whether client account is active or has been deactivated

Array of objects (DeliveryAddressResponseDto)
Default: []

Client Delivery Addresses

object

Profile picture

required
Array of objects (UserNotificationResponseDto)
Default: []

Notifications of the client

accessToken
required
string

User access token. It must be included in each request as Bearer Authorization

taxpayerIdentificationNumber
string
phoneNumber
string [ 10 .. 15 ] characters
dateOfBirth
string
object (ClientIdentificationCardDto)
{
  • "id": "619c0911b46b424f5f3e470f",
  • "createdAt": "2020-05-05T00:00:00.000Z",
  • "updatedAt": "2020-05-05T00:00:00.000Z",
  • "companyName": "ABC Company",
  • "email": "user@example.com",
  • "country": "Ghana",
  • "city": "Accra",
  • "region": "Greater Accra",
  • "digitalAddress": "CC-1334-332",
  • "password": "password",
  • "industry": "Agriculture",
  • "address": "Dansoman Street 12, Accra, Ghana",
  • "notes": "lorem ipusom",
  • "dateOfIncorporation": "2006-12-15",
  • "type": "CORPORATE",
  • "groups": [
    ],
  • "contactPersons": [
    ],
  • "firstName": "John",
  • "lastName": "Doe",
  • "otherNames": "Wood",
  • "title": "Mr",
  • "gender": "Male",
  • "age": 25,
  • "fullName": "John Wood Doe",
  • "isActive": true,
  • "deliveryAddresses": [ ],
  • "profileImage": {},
  • "notifications": [ ],
  • "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
  • "taxpayerIdentificationNumber": "string",
  • "phoneNumber": "stringstri",
  • "dateOfBirth": "string",
  • "identificationCard": {
    }
}