Skip to main content

Client

Create Client

Endpoint: /api/reseller/client/create

Method: POST

Request Parameters

ParametersType

Description

username

string


api_key

string


client.first_name

string


client.last_name

string


client.company_name

string

Optional

client.email

email


client.address_1

string


client.address_2

string


client.city

string


client.state

string


client.zip_code

string

Valid Zip Code

client.country

string


client.phone_number

string


Response Parameters

Parameters

Type

Description

success

boolean (true, false)


message

string


errors

array

It will only be returned if success is false

data

array

It will only be returned when success is true


Example Request

{
  "username": "<<username>>",
  "api_key": "<<api_key>>",
  "client" : {
    "first_name": "Navicosoft",
    "last_name" : "Customer",
    "company_name" : "Navicosoft",
    "email" : "customer@navicosoft.com",
    "address_1" : "Lahore",
    "address_2" : "",
    "city" : "Lahore",
    "state" : "Punjab",
    "zip_code" : "64200",
    "country" : "Pakistan",
    "phone_number" :"+923000000000"
  }
}

Example Response

Success

Newly created client

{
  "success": true,
  "message": "Client created successfully",
  "data": {
    "type": "created",
    "email": "customer@navicosoft.com",
    "first_name": "Navicosoft",
    "last_name": "Customer",
    "client_id": 1
  }
}

If the client already exists

{
  "success": true,
  "message": "Client with this email already exists",
  "data": {
    "type": "already_exists",
    "email": "customer@navicosoft.com",
    "first_name": "Navicosoft",
    "last_name": "Customer",
    "client_id": 1
  }
}

Error

When Required Fields are missing You’ll receive this error

{
  "success": false,
  "message": "The given data is invalid.",
  "errors": [
    "The last name field is required."
  ]
}


Response code 422