MENU navbar-image

Introduction

This documentation aims to provide all the information you need to work with our API.

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

You can retrieve your token by login with your email and password.

Both API's

Notification API'S

Get My All Notifications API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/notification';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'is_read' => '0',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/notification"
);

const params = {
    "is_read": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/notification

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

is_read   boolean  optional  

Example: false

Send Chat Notification API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/notification/chat';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'company_id' => 1,
            'body' => 'Some Random Message',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/notification/chat"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "company_id": 1,
    "body": "Some Random Message"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/notification/chat

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

company_id   string   

Example: 1

body   string   

Example: Some Random Message

Role API'S

Company User Roles API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/seeker/roles';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/seeker/roles"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/seeker/roles

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Sample Priority API'S

Get Sample Priorities API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/sample-priority';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/sample-priority"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/sample-priority

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Sample Status API'S

Get Sample Statuses API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/sample-statuses';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/sample-statuses"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/sample-statuses

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Chat API'S

Get Chat History API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/chat/distinctio';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/chat/distinctio"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/chat/{company_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   string   

The ID of the company. Example: distinctio

Purchase Order Status API'S

Get Purchase Order Statuses API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/purchase-order-statuses';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/purchase-order-statuses"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/purchase-order-statuses

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Purchase Order API'S

Purchase Order Get API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/purchase-order';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'purchase_order_status_id' => '1',
            'search_type' => 'name',
            'search_value' => 'Purchase Order',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/purchase-order"
);

const params = {
    "purchase_order_status_id": "1",
    "search_type": "name",
    "search_value": "Purchase Order",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/purchase-order

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

status   string[]  optional  
purchase_order_status_id   string  optional  

Example: 1

search_type   string  optional  

Example: name

Must be one of:
  • id
  • name
  • company_id
search_value   string  optional  

This field is required when search_type is present. Example: Purchase Order

Get Single Purchase Order API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/purchase-order/18';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/purchase-order/18"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/purchase-order/{purchase_order_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

purchase_order_id   integer   

The ID of the purchase order. Example: 18

Sample API'S

Sample Get API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/sample';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'sample_status_id' => '1',
            'sample_priority_id' => '1',
            'search_type' => 'name',
            'search_value' => 'Sample',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/sample"
);

const params = {
    "sample_status_id": "1",
    "sample_priority_id": "1",
    "search_type": "name",
    "search_value": "Sample",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/sample

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

status   string[]  optional  
sample_status_id   string  optional  

Example: 1

sample_priority_id   string  optional  

Example: 1

search_type   string  optional  

Example: name

Must be one of:
  • id
  • name
  • company_id
  • sale_person_id
search_value   string  optional  

This field is required when search_type is present. Example: Sample

Get Single Sample API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/sample/20';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/sample/20"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/sample/{sample_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

sample_id   integer   

The ID of the sample. Example: 20

Sample Store API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/sample/create';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'Sample 1',
            'quantity' => 5.0,
            'description' => 'Sample 1 description',
            'sample_priority_id' => 2,
            'company_id' => 1,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/sample/create"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Sample 1",
    "quantity": 5,
    "description": "Sample 1 description",
    "sample_priority_id": 2,
    "company_id": 1
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/sample/create

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

Must be at least 3 characters. Example: Sample 1

quantity   number   

Must be at least 0.1. Example: 5

description   string   

Must be at least 10 characters. Example: Sample 1 description

sample_priority_id   string   

Example: 2

company_id   string   

Example: 1

Email Change Process API'S

Admin Send OTP On Change Email API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/change-email/send';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'email' => 'test@test.com',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/change-email/send"
);

const params = {
    "email": "test@test.com",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/change-email/send

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

email   string   

Must be a valid email address. Example: test@test.com

validate OTP On Change Email API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/change-email/validate-otp';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'email' => 'test@test.com',
            'otp' => 123456,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/change-email/validate-otp"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "test@test.com",
    "otp": 123456
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/change-email/validate-otp

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

Must be a valid email address. Example: test@test.com

otp   integer   

Example: 123456

Forget Password API'S

Send OTP API

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/forget-password/send';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'type' => 'admin',
            'email' => 'test@test.com',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/forget-password/send"
);

const params = {
    "type": "admin",
    "email": "test@test.com",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (422):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 55
access-control-allow-origin: *
 

{
    "status_code": 422,
    "errors": [
        "Email is invalid"
    ],
    "data": []
}
 

Request      

GET api/forget-password/send

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

type   string   

Example: admin

Must be one of:
  • admin
  • seeker
email   string   

Must be a valid email address. Example: test@test.com

Resend OTP API

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/forget-password/resend';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'type' => 'admin',
            'email' => 'test@test.com',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/forget-password/resend"
);

const params = {
    "type": "admin",
    "email": "test@test.com",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (422):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 54
access-control-allow-origin: *
 

{
    "status_code": 422,
    "errors": [
        "Email is invalid"
    ],
    "data": []
}
 

Request      

GET api/forget-password/resend

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

type   string   

Example: admin

Must be one of:
  • admin
  • seeker
email   string   

Must be a valid email address. Example: test@test.com

validate OTP API

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/forget-password/validate-otp';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'type' => 'admin',
            'email' => 'test@test.com',
            'otp' => 123456,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/forget-password/validate-otp"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "type": "admin",
    "email": "test@test.com",
    "otp": 123456
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/forget-password/validate-otp

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

type   string   

Example: admin

Must be one of:
  • admin
  • seeker
email   string   

Must be a valid email address. Example: test@test.com

otp   integer   

Example: 123456

Reset Passowrd API

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/reset-password';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'type' => 'admin',
            'email' => 'test@test.com',
            'otp' => 123456,
            'password' => 'Ab@12345',
            'password_confirmation' => 'Ab@12345',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/reset-password"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "type": "admin",
    "email": "test@test.com",
    "otp": 123456,
    "password": "Ab@12345",
    "password_confirmation": "Ab@12345"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/reset-password

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

type   string   

Example: admin

Must be one of:
  • admin
  • seeker
email   string   

Must be a valid email address. Example: test@test.com

otp   integer   

Example: 123456

password   string   

Example: Ab@12345

password_confirmation   string   

Example: Ab@12345

File Management API's

Save Image API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/file/image';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'multipart/form-data',
            'Accept' => 'application/json',
        ],
        'multipart' => [
            [
                'name' => 'image',
                'contents' => fopen('/tmp/phpcJjS7q', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/file/image"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('image', document.querySelector('input[name="image"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());

Request      

POST api/file/image

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

Body Parameters

image   file   

Must be an image. Must not be greater than 5000 kilobytes. Example: /tmp/phpcJjS7q

Providers API's

Auth API'S

Admin Login API

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/auth/login';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'username' => 'mk2896',
            'password' => 'Ab@12345',
            'device_token' => '123124hnasdiasn1n23i12312b3n12',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/auth/login"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "username": "mk2896",
    "password": "Ab@12345",
    "device_token": "123124hnasdiasn1n23i12312b3n12"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/admin/auth/login

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

username   string   

Must contain only letters and numbers. Must be at least 6 characters. Example: mk2896

password   string   

Example: Ab@12345

device_token   string   

Example: 123124hnasdiasn1n23i12312b3n12

Admin Change Password First Time API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/auth/change-password';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'password' => 'Ab@12345',
            'password_confirmation' => 'Ab@12345',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/auth/change-password"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "password": "Ab@12345",
    "password_confirmation": "Ab@12345"
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PATCH api/admin/auth/change-password

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

password   string   

Example: Ab@12345

password_confirmation   string   

Example: Ab@12345

Admin Update Profile API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/auth/profile/update';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'Ali',
            'email' => 'md@gmail.com',
            'phone' => '090078601',
            'profile_picture' => '',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/auth/profile/update"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Ali",
    "email": "md@gmail.com",
    "phone": "090078601",
    "profile_picture": ""
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PATCH api/admin/auth/profile/update

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

Must be at least 3 characters. Example: Ali

email   string   

Must be a valid email address. Example: md@gmail.com

phone   string  optional  

Example: 090078601

profile_picture   string  optional  

Admin Change Password API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/auth/profile/change-password';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'current_password' => 'Ab@12345',
            'password' => 'Ab@12345',
            'password_confirmation' => 'Ab@12345',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/auth/profile/change-password"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "current_password": "Ab@12345",
    "password": "Ab@12345",
    "password_confirmation": "Ab@12345"
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PATCH api/admin/auth/profile/change-password

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

current_password   string   

Example: Ab@12345

password   string   

Example: Ab@12345

password_confirmation   string   

Example: Ab@12345

Admin Get Profile API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/auth/profile';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/auth/profile"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/admin/auth/profile

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Admin Logout API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/auth/logout';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/auth/logout"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/admin/auth/logout

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Event API'S

Get Events API

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/event';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/event"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 59
access-control-allow-origin: *
 

{
    "status_code": 200,
    "message": [
        "Events response"
    ],
    "data": {
        "total": 0,
        "total_pages": 1,
        "page": 1,
        "data": []
    }
}
 

Request      

GET api/admin/event

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Event Store API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/event/create';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'title' => 'Event 1',
            'description' => 'Some random description to be put',
            'image' => 'images/169219527022180996488.png',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/event/create"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "title": "Event 1",
    "description": "Some random description to be put",
    "image": "images\/169219527022180996488.png"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/admin/event/create

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

title   string   

Must be at least 3 characters. Example: Event 1

description   string   

Must be at least 10 characters. Example: Some random description to be put

image   string   

Example: images/169219527022180996488.png

Get Single Event API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/event/20';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/event/20"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/admin/event/{event_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

event_id   integer   

The ID of the event. Example: 20

Update Event API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/event/2/update';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'title' => 'Event 1',
            'description' => 'Some random description to be put',
            'image' => 'images/169219527022180996488.png',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/event/2/update"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "title": "Event 1",
    "description": "Some random description to be put",
    "image": "images\/169219527022180996488.png"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/admin/event/{event_id}/update

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

event_id   integer   

The ID of the event. Example: 2

Body Parameters

title   string   

Must be at least 3 characters. Example: Event 1

description   string   

Must be at least 10 characters. Example: Some random description to be put

image   string   

Example: images/169219527022180996488.png

Delete Event API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/event/18/delete';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/event/18/delete"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/admin/event/{event_id}/delete

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

event_id   integer   

The ID of the event. Example: 18

Team API'S

Get Teams API

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/team';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/team"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 58
access-control-allow-origin: *
 

{
    "status_code": 200,
    "message": [
        "Teams response"
    ],
    "data": {
        "total": 0,
        "total_pages": 1,
        "page": 1,
        "data": []
    }
}
 

Request      

GET api/admin/team

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Team Store API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/team/create';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'Saad',
            'role' => 'Sale Person',
            'profile_picture' => 'images/169219527022180996488.png',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/team/create"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Saad",
    "role": "Sale Person",
    "profile_picture": "images\/169219527022180996488.png"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/admin/team/create

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

Must be at least 3 characters. Example: Saad

role   string   

Must be at least 3 characters. Example: Sale Person

profile_picture   string   

Example: images/169219527022180996488.png

Get Single Team API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/team/16';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/team/16"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/admin/team/{team_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

team_id   integer   

The ID of the team. Example: 16

Update Team API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/team/10/update';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'Saad',
            'role' => 'Sale Person',
            'profile_picture' => 'images/169219527022180996488.png',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/team/10/update"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Saad",
    "role": "Sale Person",
    "profile_picture": "images\/169219527022180996488.png"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/admin/team/{team_id}/update

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

team_id   integer   

The ID of the team. Example: 10

Body Parameters

name   string   

Must be at least 3 characters. Example: Saad

role   string   

Must be at least 3 characters. Example: Sale Person

profile_picture   string   

Example: images/169219527022180996488.png

Delete Team API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/team/5/delete';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/team/5/delete"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/admin/team/{team_id}/delete

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

team_id   integer   

The ID of the team. Example: 5

Display Products API'S

Get Display Products API

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/display-product';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/display-product"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 57
access-control-allow-origin: *
 

{
    "status_code": 200,
    "message": [
        "Products response"
    ],
    "data": {
        "total": 0,
        "total_pages": 1,
        "page": 1,
        "data": []
    }
}
 

Request      

GET api/admin/display-product

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Get Single Display Product API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/display-product/12';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/display-product/12"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (422):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 56
access-control-allow-origin: *
 

{
    "status_code": 422,
    "errors": [
        "Product not found"
    ],
    "data": []
}
 

Request      

GET api/admin/display-product/{product_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_id   integer   

The ID of the product. Example: 12

Display Product Store API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/display-product/create';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'Product 1',
            'description' => 'Some random description to be put',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/display-product/create"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Product 1",
    "description": "Some random description to be put"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/admin/display-product/create

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

Must be at least 3 characters. Example: Product 1

description   string   

Must be at least 10 characters. Example: Some random description to be put

Update Display Product API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/display-product/11/update';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'Product 1',
            'description' => 'Some random description to be put',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/display-product/11/update"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Product 1",
    "description": "Some random description to be put"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/admin/display-product/{product_id}/update

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_id   integer   

The ID of the product. Example: 11

Body Parameters

name   string   

Must be at least 3 characters. Example: Product 1

description   string   

Must be at least 10 characters. Example: Some random description to be put

Delete Display Product API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/display-product/15/delete';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/display-product/15/delete"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/admin/display-product/{product_id}/delete

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_id   integer   

The ID of the product. Example: 15

Dashboard API'S

Admin API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/dashboard';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/dashboard"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/admin/dashboard

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Product Order Status API'S

Get Product Order Statuses API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/product-order-statuses';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/product-order-statuses"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/admin/product-order-statuses

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Provider Management API'S

Admin Store API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/user/create';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'Ali',
            'username' => 'mk2896',
            'email' => 'md@gmail.com',
            'phone' => '090078601',
            'profile_picture' => '',
            'role_id' => 2,
            'salary' => 2000.0,
            'commission' => '2000',
            'percentage' => '29%',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/user/create"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Ali",
    "username": "mk2896",
    "email": "md@gmail.com",
    "phone": "090078601",
    "profile_picture": "",
    "role_id": 2,
    "salary": 2000,
    "commission": "2000",
    "percentage": "29%"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/admin/user/create

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

Must be at least 3 characters. Example: Ali

username   string   

Must contain only letters and numbers. Must be at least 6 characters. Example: mk2896

email   string   

Must be a valid email address. Example: md@gmail.com

phone   string  optional  

Example: 090078601

profile_picture   string  optional  
role_id   string   

Example: 2

salary   number   

Must be at least 1. Must not be greater than 9999999. Example: 2000

commission   string  optional  

This field is required when role_id is 2. Example: 2000

percentage   string   

Example: 29%

Admin Resend Email API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/user/1/resend-email';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/user/1/resend-email"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/admin/user/{admin_id}/resend-email

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

admin_id   integer   

The ID of the admin. Example: 1

Get Admins API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/user';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'role_id' => '1',
            'search_type' => 'username',
            'search_value' => 'mk2896',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/user"
);

const params = {
    "role_id": "1",
    "search_type": "username",
    "search_value": "mk2896",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/admin/user

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

role_id   string  optional  

Example: 1

search_type   string  optional  

Example: username

Must be one of:
  • username
  • name
  • email
  • phone
search_value   string  optional  

This field is required when search_type is present. Example: mk2896

Get Single Admin API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/user/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/user/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/admin/user/{admin_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

admin_id   integer   

The ID of the admin. Example: 1

Update Admin API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/user/1/update';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'Ali',
            'status' => 'active',
            'phone' => '090078601',
            'profile_picture' => '',
            'role_id' => 2,
            'salary' => 2000.0,
            'percentage' => 29.0,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/user/1/update"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Ali",
    "status": "active",
    "phone": "090078601",
    "profile_picture": "",
    "role_id": 2,
    "salary": 2000,
    "percentage": 29
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/admin/user/{admin_id}/update

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

admin_id   integer   

The ID of the admin. Example: 1

Body Parameters

name   string   

Must be at least 3 characters. Example: Ali

status   string   

Example: active

Must be one of:
  • active
  • in-active
phone   string  optional  

Example: 090078601

profile_picture   string  optional  
role_id   string   

Example: 2

salary   number   

Must be at least 1. Must not be greater than 9999999. Example: 2000

percentage   number   

Must be at least 1. Must not be greater than 100. Example: 29

Update Seeker status API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/seeker/8/status';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'status' => 'active',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/seeker/8/status"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "status": "active"
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PATCH api/admin/seeker/{seeker_id}/status

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

seeker_id   integer   

The ID of the seeker. Example: 8

Body Parameters

status   string   

Example: active

Must be one of:
  • active
  • in-active

Create New Seeker Admin API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/seeker/store';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'Ali',
            'username' => 'mk2896',
            'email' => 'md@gmail.com',
            'phone' => '090078601',
            'profile_picture' => '',
            'company_id' => 2,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/seeker/store"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Ali",
    "username": "mk2896",
    "email": "md@gmail.com",
    "phone": "090078601",
    "profile_picture": "",
    "company_id": 2
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/admin/seeker/store

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

Must be at least 3 characters. Example: Ali

username   string   

Must contain only letters and numbers. Must be at least 6 characters. Example: mk2896

email   string   

Must be a valid email address. Example: md@gmail.com

phone   string  optional  

Example: 090078601

profile_picture   string  optional  
company_id   string   

Example: 2

Material API'S

Material Get API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/material';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'search_type' => 'name',
            'search_value' => 'Sample',
            'order_by' => 'name',
            'below_min_quantity' => '0',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/material"
);

const params = {
    "search_type": "name",
    "search_value": "Sample",
    "order_by": "name",
    "below_min_quantity": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/admin/material

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

search_type   string  optional  

Example: name

Must be one of:
  • id
  • name
  • min_quantity
  • supplier_id
  • stock
search_value   string  optional  

This field is required when search_type is present. Example: Sample

order_by   string  optional  

Example: name

Must be one of:
  • id
  • name
  • min_quantity
  • supplier_id
  • stock
below_min_quantity   boolean  optional  

Example: false

Material Store API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/material/create';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'Material 1',
            'min_quantity' => 14,
            'supplier_id' => 2,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/material/create"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Material 1",
    "min_quantity": 14,
    "supplier_id": 2
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/admin/material/create

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

Must be at least 3 characters. Example: Material 1

min_quantity   integer   

Must be at least 1. Example: 14

supplier_id   string  optional  

Example: 2

Material Update API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/material/1';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'Material 1',
            'min_quantity' => 14,
            'supplier_id' => 2,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/material/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Material 1",
    "min_quantity": 14,
    "supplier_id": 2
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/admin/material/{material_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

material_id   integer   

The ID of the material. Example: 1

Body Parameters

name   string   

Must be at least 3 characters. Example: Material 1

min_quantity   integer   

Must be at least 1. Example: 14

supplier_id   string  optional  

Example: 2

Material Request API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/material/request/low_inventory|admin_store_request';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'materials' => [
                'id' => 1,
                'quantity' => 2,
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/material/request/low_inventory|admin_store_request"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "materials": {
        "id": 1,
        "quantity": 2
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/admin/material/request/{request_type}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

request_type   string   

Example: low_inventory|admin_store_request

Body Parameters

materials   string[]   

Must have at least 1 items.

id   string   

Example: possimus

quantity   number   

Must be at least 0.1. Example: 59

Update Material Request API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/material/request/ab/update';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'quantity' => 2.0,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/material/request/ab/update"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "quantity": 2
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PATCH api/admin/material/request/{material_request_id}/update

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

material_request_id   string   

The ID of the material request. Example: ab

Body Parameters

quantity   number   

Must be at least 0.1. Example: 2

Update Material Request To Submitted API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/material/request/status/submit';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/material/request/status/submit"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "PATCH",
    headers,
}).then(response => response.json());

Request      

PATCH api/admin/material/request/status/submit

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Delete Material Request API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/material/request/et/delete';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/material/request/et/delete"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/admin/material/request/{material_request_id}/delete

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

material_request_id   string   

The ID of the material request. Example: et

Get Material Request API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/material/request/low_inventory|admin_store_request';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'material' => 'Material',
            'status' => '0',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/material/request/low_inventory|admin_store_request"
);

const params = {
    "material": "Material",
    "status": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (404):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 404,
    "errors": [
        "Invalid URL"
    ],
    "data": []
}
 

Request      

GET api/admin/material/request/{request_type}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

request_type   string   

Example: low_inventory|admin_store_request

Query Parameters

material   string  optional  

Example: Material

status   boolean   

Example: false

Get Product Order API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/material/product_order';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'search_type' => 'name',
            'search_value' => 'Sample',
            'product_order_status_id[0]' => 'omnis',
            'supplier_id' => '2',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/material/product_order"
);

const params = {
    "search_type": "name",
    "search_value": "Sample",
    "product_order_status_id[0]": "omnis",
    "supplier_id": "2",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/admin/material/product_order

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

search_type   string  optional  

Example: name

Must be one of:
  • id
  • purchase_date
  • receive_date
  • payment_release_date
  • return_date
  • creation_date
search_value   string  optional  

This field is required when search_type is present. Example: Sample

product_order_status_id   string[]   
supplier_id   string  optional  

Example: 2

Get Product Order Details API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/material/product_order/details';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'material' => 'Material',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/material/product_order/details"
);

const params = {
    "material": "Material",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/admin/material/product_order/details

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

material   string  optional  

Example: Material

product_id   string  optional  

Delete Product Order Detail API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/material/product_order/non/delete';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/material/product_order/non/delete"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/admin/material/product_order/{product_order_detail_id}/delete

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_order_detail_id   string   

The ID of the product order detail. Example: non

Update Product Order Detail Quantity Or Price API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/material/product_order/doloribus/update';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'quantity' => 2.0,
            'price' => 20.0,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/material/product_order/doloribus/update"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "quantity": 2,
    "price": 20
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PATCH api/admin/material/product_order/{product_order_detail_id}/update

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_order_detail_id   string   

The ID of the product order detail. Example: doloribus

Body Parameters

quantity   number   

Must be at least 0.1. Example: 2

price   number   

Must be at least 1. Example: 20

Update Product Order Status To Pending API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/material/product_order/status/pending';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/material/product_order/status/pending"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "PATCH",
    headers,
}).then(response => response.json());

Request      

PATCH api/admin/material/product_order/status/pending

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Material Create Product Order API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/material/product_order';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'supplier_id' => 1,
            'material_id' => 1,
            'price' => 100.0,
            'quantity' => 12.0,
            'material_request_id' => 1,
            'product_id' => 3,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/material/product_order"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "supplier_id": 1,
    "material_id": 1,
    "price": 100,
    "quantity": 12,
    "material_request_id": 1,
    "product_id": 3
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/admin/material/product_order

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

supplier_id   string   

Example: 1

material_id   string   

Example: 1

price   number   

Must be at least 1. Example: 100

quantity   number   

Must be at least 0.1. Example: 12

material_request_id   integer  optional  

Example: 1

product_id   integer  optional  

Example: 3

Update Product Status To Pending After Disapproved API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/product/4/pending';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/product/4/pending"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "PATCH",
    headers,
}).then(response => response.json());

Request      

PATCH api/admin/product/{product_id}/pending

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_id   integer   

The ID of the product. Example: 4

Update Product Status To Admin Approved/Disapprove API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/product/2/admin/approve-disapprove';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'product_order_status_id' => 2,
            'product_order_status_reason' => 'Some Reason',
            'product_order_detail_ids' => [
                'nulla',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/product/2/admin/approve-disapprove"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "product_order_status_id": 2,
    "product_order_status_reason": "Some Reason",
    "product_order_detail_ids": [
        "nulla"
    ]
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PATCH api/admin/product/{product_id}/admin/approve-disapprove

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_id   integer   

The ID of the product. Example: 2

Body Parameters

product_order_status_id   string   

Example: 2

Must be one of:
  • 2
  • 3
product_order_status_reason   string  optional  

This field is required when product_order_status_id is 3. Example: Some Reason

product_order_detail_ids   string[]   

Update Product Status To Accountatnt Approved/OnHold API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/product/19/accountant/approve-onhold';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'product_order_status_id' => 4,
            'product_order_status_reason' => 'Some Reason',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/product/19/accountant/approve-onhold"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "product_order_status_id": 4,
    "product_order_status_reason": "Some Reason"
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PATCH api/admin/product/{product_id}/accountant/approve-onhold

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_id   integer   

The ID of the product. Example: 19

Body Parameters

product_order_status_id   string   

Example: 4

Must be one of:
  • 4
  • 5
product_order_status_reason   string  optional  

This field is required when product_order_status_id is 5. Example: Some Reason

Update Product Status To Purchased API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/product/7/purchase';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/product/7/purchase"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "PATCH",
    headers,
}).then(response => response.json());

Request      

PATCH api/admin/product/{product_id}/purchase

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_id   integer   

The ID of the product. Example: 7

Update Product Status To Recieved API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/product/18/recieve';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/product/18/recieve"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "PATCH",
    headers,
}).then(response => response.json());

Request      

PATCH api/admin/product/{product_id}/recieve

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_id   integer   

The ID of the product. Example: 18

Body Parameters

product_orders   string[]  optional  
id   string   

Example: ducimus

deliver_quantity   integer   

Must be at least 0. Example: 31

comment   string  optional  

Example: doloribus

Update Product Status To QC Approved/Disapprove API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/product/13/qc/approve-disapprove';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'product_order_status_id' => 8,
            'product_order_status_reason' => 'Some Reason',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/product/13/qc/approve-disapprove"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "product_order_status_id": 8,
    "product_order_status_reason": "Some Reason"
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PATCH api/admin/product/{product_id}/qc/approve-disapprove

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_id   integer   

The ID of the product. Example: 13

Body Parameters

product_order_status_id   string   

Example: 8

Must be one of:
  • 8
  • 9
product_order_status_reason   string  optional  

This field is required when product_order_status_id is 9. Example: Some Reason

Update Product Status To Release Payment API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/product/2/release-payment';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/product/2/release-payment"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "PATCH",
    headers,
}).then(response => response.json());

Request      

PATCH api/admin/product/{product_id}/release-payment

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_id   integer   

The ID of the product. Example: 2

Get Product Supplier For Releasing Payment API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/product/10/release-payment';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/product/10/release-payment"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/admin/product/{product_id}/release-payment

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_id   integer   

The ID of the product. Example: 10

Update Product Status To Return Product API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/product/7/return';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/product/7/return"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "PATCH",
    headers,
}).then(response => response.json());

Request      

PATCH api/admin/product/{product_id}/return

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_id   integer   

The ID of the product. Example: 7

Company API'S

Get Companies API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/company';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'search_type' => 'name',
            'search_value' => 'test',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/company"
);

const params = {
    "search_type": "name",
    "search_value": "test",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/admin/company

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

search_type   string  optional  

Example: name

Must be one of:
  • name
  • address
  • sale_person_id
search_value   string  optional  

This field is required when search_type is present. Example: test

Get Companies For Sale Person API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/company/for-sale-person';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'visit_status_id' => '1',
            'sale_person_id' => '26',
            'search_type' => 'name',
            'search_value' => 'test',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/company/for-sale-person"
);

const params = {
    "visit_status_id": "1",
    "sale_person_id": "26",
    "search_type": "name",
    "search_value": "test",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/admin/company/for-sale-person

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

visit_status_id   string  optional  

Example: 1

sale_person_id   string  optional  

Example: 26

search_type   string  optional  

Example: name

Must be one of:
  • name
  • address
search_value   string  optional  

This field is required when search_type is present. Example: test

Company Store API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/company/create';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'Ali',
            'username' => 'mk2896',
            'email' => 'doyle.sofia@example.org',
            'profile_picture' => '',
            'company' => [
                'logo' => '',
                'name' => 'Company name',
                'email' => 'md@test.com',
                'phone' => '090078601',
                'address' => 'Company address',
                'sale_person_id' => 1,
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/company/create"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Ali",
    "username": "mk2896",
    "email": "doyle.sofia@example.org",
    "profile_picture": "",
    "company": {
        "logo": "",
        "name": "Company name",
        "email": "md@test.com",
        "phone": "090078601",
        "address": "Company address",
        "sale_person_id": 1
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/admin/company/create

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

Must be at least 3 characters. Example: Ali

username   string   

Must contain only letters and numbers. Must be at least 6 characters. Example: mk2896

email   string   

Must be a valid email address. Example: doyle.sofia@example.org

phone   string  optional  
profile_picture   string  optional  
company   object  optional  
logo   string  optional  
name   string   

Must be at least 3 characters. Example: Company name

email   string  optional  

Must be a valid email address. Example: md@test.com

phone   string  optional  

Example: 090078601

address   string   

Must be at least 3 characters. Example: Company address

sale_person_id   string   

Example: 1

Company Resend Email API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/company/6/resend-email';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/company/6/resend-email"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/admin/company/{company_id}/resend-email

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 6

Get Single Company API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/company/4';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'extra_details' => '0',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/company/4"
);

const params = {
    "extra_details": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/admin/company/{company_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 4

Query Parameters

extra_details   boolean  optional  

Example: false

Remaining PO Dues of Company API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/company/1/remaining-dues';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/company/1/remaining-dues"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/admin/company/{company_id}/remaining-dues

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 1

Get Company Users API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/company/10/users';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'role_id' => '1',
            'search_type' => 'username',
            'search_value' => 'mk2896',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/company/10/users"
);

const params = {
    "role_id": "1",
    "search_type": "username",
    "search_value": "mk2896",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/admin/company/{company_id}/users

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 10

Query Parameters

role_id   string  optional  

Example: 1

search_type   string  optional  

Example: username

Must be one of:
  • username
  • name
  • email
  • phone
search_value   string  optional  

This field is required when search_type is present. Example: mk2896

Get Company User API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/company/1/users/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/company/1/users/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/admin/company/{company_id}/users/{seeker_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

Example: 1

seeker_id   integer   

Example: 1

Update Company User API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/company/1/users/1/update';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'Ali',
            'status' => 'active',
            'phone' => '090078601',
            'profile_picture' => '',
            'role_id' => 2,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/company/1/users/1/update"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Ali",
    "status": "active",
    "phone": "090078601",
    "profile_picture": "",
    "role_id": 2
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/admin/company/{company_id}/users/{seeker_id}/update

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

Example: 1

seeker_id   integer   

Example: 1

Body Parameters

name   string   

Must be at least 3 characters. Example: Ali

status   string   

Example: active

Must be one of:
  • active
  • in-active
phone   string  optional  

Example: 090078601

profile_picture   string  optional  
role_id   string   

Example: 2

Update Company API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/company/6/update';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'logo' => '',
            'name' => 'Company name',
            'email' => 'md@test.com',
            'phone' => '09008601',
            'address' => 'Company address',
            'sale_person_id' => 1,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/company/6/update"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "logo": "",
    "name": "Company name",
    "email": "md@test.com",
    "phone": "09008601",
    "address": "Company address",
    "sale_person_id": 1
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/admin/company/{company_id}/update

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 6

Body Parameters

logo   string  optional  
name   string   

Must be at least 3 characters. Example: Company name

email   string  optional  

Must be a valid email address. Example: md@test.com

phone   string  optional  

Example: 09008601

address   string   

Must be at least 3 characters. Example: Company address

sale_person_id   string   

Example: 1

Update Company Status API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/company/1/update/status';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'status' => '0',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/company/1/update/status"
);

const params = {
    "status": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "PUT",
    headers,
}).then(response => response.json());

Request      

PUT api/admin/company/{company_id}/update/status

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 1

Query Parameters

status   boolean   

Example: false

Update Company Visit Status API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/company/9/update/visit-status';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'visit_status_id' => 2,
            'visit_remark' => 'Closed',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/company/9/update/visit-status"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "visit_status_id": 2,
    "visit_remark": "Closed"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/admin/company/{company_id}/update/visit-status

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 9

Body Parameters

visit_status_id   string   

Example: 2

visit_remark   string  optional  

Example: Closed

Get Single Company API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/seeker/company/details';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'extra_details' => '0',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/seeker/company/details"
);

const params = {
    "extra_details": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/seeker/company/details

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

extra_details   boolean  optional  

Example: false

Sample API'S

Get Sample Materials API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/sample/nemo/get-materials';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/sample/nemo/get-materials"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/admin/sample/{sample}/get-materials

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

sample   string   

The sample. Example: nemo

Sample Approve/Disapprove By Admin API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/sample/6/approve-disapprove';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'sample_status_id' => 2,
            'sample_status_remarks' => 'Some Remarks',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/sample/6/approve-disapprove"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "sample_status_id": 2,
    "sample_status_remarks": "Some Remarks"
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PATCH api/admin/sample/{sample_id}/approve-disapprove

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

sample_id   integer   

The ID of the sample. Example: 6

Body Parameters

sample_status_id   string   

Example: 2

Must be one of:
  • 2
  • 3
sample_status_remarks   string  optional  

This field is required when sample_status_id is 2. Example: Some Remarks

Sample Dispatched By Store Person API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/sample/19/dispatch';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'tracking_number' => '1312312312',
            'images' => [
                'debitis',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/sample/19/dispatch"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "tracking_number": "1312312312",
    "images": [
        "debitis"
    ]
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PATCH api/admin/sample/{sample_id}/dispatch

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

sample_id   integer   

The ID of the sample. Example: 19

Body Parameters

tracking_number   string   

Example: 1312312312

images   string[]   

Mark Sample As In Dispatch API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/sample/9/in-dispatch';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'product_name' => 'Sample Product Name',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/sample/9/in-dispatch"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "product_name": "Sample Product Name"
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PATCH api/admin/sample/{sample_id}/in-dispatch

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

sample_id   integer   

The ID of the sample. Example: 9

Body Parameters

product_name   string   

Must be at least 3 characters. Example: Sample Product Name

Attach Material To Sample API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/sample/20/attach/1';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'quantity' => 3.0,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/sample/20/attach/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "quantity": 3
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PATCH api/admin/sample/{sample_id}/attach/{material_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

sample_id   integer   

The ID of the sample. Example: 20

material_id   integer   

The ID of the material. Example: 1

Body Parameters

quantity   number   

Must be at least 0. Example: 3

Detach Material To Sample API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/sample/12/detach/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/sample/12/detach/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/admin/sample/{sample_id}/detach/{material_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

sample_id   integer   

The ID of the sample. Example: 12

material_id   integer   

The ID of the material. Example: 1

Update Material To Sample API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/sample/15/update/1';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'quantity' => 3.0,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/sample/15/update/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "quantity": 3
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PATCH api/admin/sample/{sample_id}/update/{material_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

sample_id   integer   

The ID of the sample. Example: 15

material_id   integer   

The ID of the material. Example: 1

Body Parameters

quantity   number   

Must be at least 0. Example: 3

Send Quotation API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/sample/8/send-quotation';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'quotation' => 1000.0,
            'quotation_description' => 'Some Random Description',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/sample/8/send-quotation"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "quotation": 1000,
    "quotation_description": "Some Random Description"
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PATCH api/admin/sample/{sample_id}/send-quotation

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

sample_id   integer   

The ID of the sample. Example: 8

Body Parameters

quotation   number   

Must be at least 0. Example: 1000

quotation_description   string   

Example: Some Random Description

Edit Quotation API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/sample/17/edit-quotation';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'quotation' => 1000.0,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/sample/17/edit-quotation"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "quotation": 1000
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PATCH api/admin/sample/{sample_id}/edit-quotation

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

sample_id   integer   

The ID of the sample. Example: 17

Body Parameters

quotation   number   

Must be at least 0. Example: 1000

Supplier API'S

Supplier Store API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/supplier/create';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'Supplier 1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/supplier/create"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Supplier 1"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/admin/supplier/create

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

Must be at least 3 characters. Example: Supplier 1

Supplier Update API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/supplier/18/update';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'Supplier 1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/supplier/18/update"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Supplier 1"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/admin/supplier/{supplier_id}/update

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

supplier_id   integer   

The ID of the supplier. Example: 18

Body Parameters

name   string   

Must be at least 3 characters. Example: Supplier 1

Supplier Get All API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/supplier';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'search_type' => 'name',
            'search_value' => 'Supplier',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/supplier"
);

const params = {
    "search_type": "name",
    "search_value": "Supplier",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/admin/supplier

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

search_type   string  optional  

Example: name

Must be one of:
  • name
  • id
search_value   string  optional  

This field is required when search_type is present. Example: Supplier

Supplier All Materials History API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/supplier/4/material-history';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/supplier/4/material-history"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/admin/supplier/{supplier_id}/material-history

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

supplier_id   integer   

The ID of the supplier. Example: 4

Supplier Get API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/supplier/18';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/supplier/18"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/admin/supplier/{supplier_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

supplier_id   integer   

The ID of the supplier. Example: 18

Supplier Delete API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/supplier/19';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/supplier/19"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/admin/supplier/{supplier_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

supplier_id   integer   

The ID of the supplier. Example: 19

Role API'S

Admin Roles API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/roles';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/roles"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/admin/roles

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Company Visit Status API'S

Company Visit Statuses Get API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/visit-statuses';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'after_visit' => '0',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/visit-statuses"
);

const params = {
    "after_visit": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/admin/visit-statuses

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

after_visit   boolean  optional  

Example: false

Purchase Order API'S

Approve/Disapprove Purchase Order API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/purchase-order/8/approve-disapprove';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'purchase_order_status_id' => 3,
            'purchase_order_status_remarks' => 'Some Remarks',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/purchase-order/8/approve-disapprove"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "purchase_order_status_id": 3,
    "purchase_order_status_remarks": "Some Remarks"
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PATCH api/admin/purchase-order/{purchase_order_id}/approve-disapprove

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

purchase_order_id   integer   

The ID of the purchase order. Example: 8

Body Parameters

purchase_order_status_id   string   

Example: 3

Must be one of:
  • 2
  • 3
purchase_order_status_remarks   string  optional  

This field is required when purchase_order_status_id is 2. Example: Some Remarks

Set Estimate For Purchase Order API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/purchase-order/2/set-estimate';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'estimated_production_date' => '2024-12-10',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/purchase-order/2/set-estimate"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "estimated_production_date": "2024-12-10"
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PATCH api/admin/purchase-order/{purchase_order_id}/set-estimate

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

purchase_order_id   integer   

The ID of the purchase order. Example: 2

Body Parameters

estimated_production_date   string   

Must be a valid date in the format Y-m-d. Must be a date after or equal to today. Example: 2024-12-10

Done Production For Purchase Order API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/purchase-order/15/done-production';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/purchase-order/15/done-production"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "PATCH",
    headers,
}).then(response => response.json());

Request      

PATCH api/admin/purchase-order/{purchase_order_id}/done-production

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

purchase_order_id   integer   

The ID of the purchase order. Example: 15

In Production For Purchase Order API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/purchase-order/5/in-production';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/purchase-order/5/in-production"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "PATCH",
    headers,
}).then(response => response.json());

Request      

PATCH api/admin/purchase-order/{purchase_order_id}/in-production

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

purchase_order_id   integer   

The ID of the purchase order. Example: 5

QC Approve/Disapprove Purchase Order API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/purchase-order/6/approve-disapprove/qc';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'purchase_order_status_id' => 6,
            'purchase_order_status_remarks' => 'Some Remarks',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/purchase-order/6/approve-disapprove/qc"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "purchase_order_status_id": 6,
    "purchase_order_status_remarks": "Some Remarks"
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PATCH api/admin/purchase-order/{purchase_order_id}/approve-disapprove/qc

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

purchase_order_id   integer   

The ID of the purchase order. Example: 6

Body Parameters

purchase_order_status_id   string   

Example: 6

Must be one of:
  • 6
  • 7
purchase_order_status_remarks   string  optional  

This field is required when purchase_order_status_id is 6. Example: Some Remarks

Dispatch Purchase Order API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/purchase-order/3/dispatch';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'tracking_number' => '1312312312',
            'images' => [
                'fugiat',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/purchase-order/3/dispatch"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "tracking_number": "1312312312",
    "images": [
        "fugiat"
    ]
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PATCH api/admin/purchase-order/{purchase_order_id}/dispatch

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

purchase_order_id   integer   

The ID of the purchase order. Example: 3

Body Parameters

tracking_number   string   

Example: 1312312312

images   string[]   

Payment Confirmation Purchase Order API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/purchase-order/5/pay/confirm';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'purchase_order_status_id' => 10,
            'commission_to_sale_person' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/purchase-order/5/pay/confirm"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "purchase_order_status_id": 10,
    "commission_to_sale_person": false
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PATCH api/admin/purchase-order/{purchase_order_id}/pay/confirm

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

purchase_order_id   integer   

The ID of the purchase order. Example: 5

Body Parameters

purchase_order_status_id   string   

Example: 10

Must be one of:
  • 10
  • 12
commission_to_sale_person   boolean  optional  

This field is required when purchase_order_status_id is 12. Example: false

Get Purchase Order Materials API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/purchase-order/9/materials';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/purchase-order/9/materials"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/admin/purchase-order/{purchase_order_id}/materials

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

purchase_order_id   integer   

The ID of the purchase order. Example: 9

Salary API'S

Get All Salaried Users For Accountant API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/salaries';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'year' => '2023',
            'month' => '11',
            'status' => 'unpaid',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/salaries"
);

const params = {
    "year": "2023",
    "month": "11",
    "status": "unpaid",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/admin/salaries

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

year   integer   

Must be 4 digits. Must be at least 2023. Example: 2023

month   integer   

Must be between 1 and 2 digits. Must be at least 1. Must not be greater than 12. Example: 11

status   string   

Example: unpaid

Must be one of:
  • unpaid
  • pending
  • paid

Create Salary API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/salaries/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'year' => '2023',
            'month' => '11',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/salaries/1"
);

const params = {
    "year": "2023",
    "month": "11",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/admin/salaries/{admin_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

admin_id   integer   

The ID of the admin. Example: 1

Query Parameters

year   integer   

Must be 4 digits. Must be at least 2023. Example: 2023

month   integer   

Must be between 1 and 2 digits. Must be at least 1. Must not be greater than 12. Example: 11

Get Salary Details Of User API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/salaries/show/dolore';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'year' => '2023',
            'month' => '11',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/salaries/show/dolore"
);

const params = {
    "year": "2023",
    "month": "11",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/admin/salaries/show/{admin_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

admin_id   string   

The ID of the admin. Example: dolore

Query Parameters

year   integer   

Must be 4 digits. Must be at least 2023. Example: 2023

month   integer   

Must be between 1 and 2 digits. Must be at least 1. Must not be greater than 12. Example: 11

Get Unpaid Salary Details Of User API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/salaries/show/1/unpaid';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'year' => '2023',
            'month' => '11',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/salaries/show/1/unpaid"
);

const params = {
    "year": "2023",
    "month": "11",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/admin/salaries/show/{admin_id}/unpaid

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

admin_id   integer   

The ID of the admin. Example: 1

Query Parameters

year   integer   

Must be 4 digits. Must be at least 2023. Example: 2023

month   integer   

Must be between 1 and 2 digits. Must be at least 1. Must not be greater than 12. Example: 11

Get My All Salaries API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/salaries/paid|pending/rerum';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/salaries/paid|pending/rerum"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (404):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 404,
    "errors": [
        "Invalid URL"
    ],
    "data": []
}
 

Request      

GET api/admin/salaries/{salary_type}/{user_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

salary_type   string   

Example: paid|pending

user_id   string   

The ID of the user. Example: rerum

Receive My Salary API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/admin/salaries/receive/1';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'signature' => 'images/169219527022180996488.png',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/admin/salaries/receive/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "signature": "images\/169219527022180996488.png"
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PATCH api/admin/salaries/receive/{salary_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

salary_id   integer   

The ID of the salary. Example: 1

Body Parameters

signature   string   

Example: images/169219527022180996488.png

Seeker API's

Auth API'S

Seeker Login API

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/seeker/auth/login';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'username' => 'test1234',
            'password' => 'Ab@12345',
            'device_token' => 'Abasdas12123123314sdadasfasf5',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/seeker/auth/login"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "username": "test1234",
    "password": "Ab@12345",
    "device_token": "Abasdas12123123314sdadasfasf5"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/seeker/auth/login

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

username   string   

Must contain only letters and numbers. Must be at least 6 characters. Example: test1234

password   string   

Example: Ab@12345

device_token   string   

Example: Abasdas12123123314sdadasfasf5

Seeker Change Password First Time API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/seeker/auth/change-password';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'password' => 'Ab@12345',
            'password_confirmation' => 'Ab@12345',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/seeker/auth/change-password"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "password": "Ab@12345",
    "password_confirmation": "Ab@12345"
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PATCH api/seeker/auth/change-password

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

password   string   

Example: Ab@12345

password_confirmation   string   

Example: Ab@12345

Seeker Update Profile API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/seeker/auth/profile/update';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'Ali',
            'email' => 'md@gmail.com',
            'phone' => '090078601',
            'profile_picture' => '',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/seeker/auth/profile/update"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Ali",
    "email": "md@gmail.com",
    "phone": "090078601",
    "profile_picture": ""
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PATCH api/seeker/auth/profile/update

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

Must be at least 3 characters. Example: Ali

email   string   

Must be a valid email address. Example: md@gmail.com

phone   string  optional  

Example: 090078601

profile_picture   string  optional  

Seeker Change Password API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/seeker/auth/profile/change-password';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'current_password' => 'Ab@12345',
            'password' => 'Ab@12345',
            'password_confirmation' => 'Ab@12345',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/seeker/auth/profile/change-password"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "current_password": "Ab@12345",
    "password": "Ab@12345",
    "password_confirmation": "Ab@12345"
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PATCH api/seeker/auth/profile/change-password

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

current_password   string   

Example: Ab@12345

password   string   

Example: Ab@12345

password_confirmation   string   

Example: Ab@12345

Seeker Get Profile API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/seeker/auth/profile';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/seeker/auth/profile"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/seeker/auth/profile

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Seeker Logout API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/seeker/auth/logout';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/seeker/auth/logout"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/seeker/auth/logout

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Dashboard API'S

Seeker API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/seeker/dashboard';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/seeker/dashboard"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/seeker/dashboard

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Seeker Management API'S

Seeker Store API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/seeker/user/create';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'Ali',
            'username' => 'mk2896',
            'email' => 'md@gmail.com',
            'phone' => '090078601',
            'profile_picture' => '',
            'role_id' => 2,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/seeker/user/create"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Ali",
    "username": "mk2896",
    "email": "md@gmail.com",
    "phone": "090078601",
    "profile_picture": "",
    "role_id": 2
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/seeker/user/create

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

Must be at least 3 characters. Example: Ali

username   string   

Must contain only letters and numbers. Must be at least 6 characters. Example: mk2896

email   string   

Must be a valid email address. Example: md@gmail.com

phone   string  optional  

Example: 090078601

profile_picture   string  optional  
role_id   string   

Example: 2

Seeker Resend Email API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/seeker/user/8/resend-email';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/seeker/user/8/resend-email"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/seeker/user/{seeker_id}/resend-email

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

seeker_id   integer   

The ID of the seeker. Example: 8

Get All Seekers API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/seeker/user';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'role_id' => '1',
            'search_type' => 'username',
            'search_value' => 'mk2896',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/seeker/user"
);

const params = {
    "role_id": "1",
    "search_type": "username",
    "search_value": "mk2896",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/seeker/user

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

role_id   string  optional  

Example: 1

search_type   string  optional  

Example: username

Must be one of:
  • username
  • name
  • email
  • phone
search_value   string  optional  

This field is required when search_type is present. Example: mk2896

Get Single Seeker API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/seeker/user/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/seeker/user/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status_code": 401,
    "errors": [
        "User unauthorized"
    ],
    "data": []
}
 

Request      

GET api/seeker/user/{seeker_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

seeker_id   integer   

Example: 1

Update Seeker API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/seeker/user/1/update';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'Ali',
            'status' => 'active',
            'phone' => '090078601',
            'profile_picture' => '',
            'role_id' => 2,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/seeker/user/1/update"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Ali",
    "status": "active",
    "phone": "090078601",
    "profile_picture": "",
    "role_id": 2
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/seeker/user/{seeker_id}/update

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

seeker_id   integer   

Example: 1

Body Parameters

name   string   

Must be at least 3 characters. Example: Ali

status   string   

Example: active

Must be one of:
  • active
  • in-active
phone   string  optional  

Example: 090078601

profile_picture   string  optional  
role_id   string   

Example: 2

Sample API'S

Sample Approve/Disapprove Dispatched By Seeker API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/seeker/sample/3/approve-disapprove/dispatch';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'sample_status_id' => 6,
            'sample_status_remarks' => 'Some Remarks',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/seeker/sample/3/approve-disapprove/dispatch"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "sample_status_id": 6,
    "sample_status_remarks": "Some Remarks"
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PATCH api/seeker/sample/{sample_id}/approve-disapprove/dispatch

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

sample_id   integer   

The ID of the sample. Example: 3

Body Parameters

sample_status_id   string   

Example: 6

Must be one of:
  • 6
  • 7
sample_status_remarks   string  optional  

This field is required when sample_status_id is 7. Example: Some Remarks

Approve/Disapprove Quotation API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/seeker/sample/10/approve-disapprove/quotation';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'sample_status_id' => 9,
            'sample_status_remarks' => 'Some Remarks',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/seeker/sample/10/approve-disapprove/quotation"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "sample_status_id": 9,
    "sample_status_remarks": "Some Remarks"
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PATCH api/seeker/sample/{sample_id}/approve-disapprove/quotation

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

sample_id   integer   

The ID of the sample. Example: 10

Body Parameters

sample_status_id   string   

Example: 9

Must be one of:
  • 9
  • 10
sample_status_remarks   string  optional  

This field is required when sample_status_id is 10. Example: Some Remarks

Ask Quotation API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/seeker/sample/3/ask/quotation';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/seeker/sample/3/ask/quotation"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "PATCH",
    headers,
}).then(response => response.json());

Request      

PATCH api/seeker/sample/{sample_id}/ask/quotation

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

sample_id   integer   

The ID of the sample. Example: 3

Sample Resubmit Disapproved By Seeker API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/seeker/sample/18/re-submit';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/seeker/sample/18/re-submit"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "PATCH",
    headers,
}).then(response => response.json());

Request      

PATCH api/seeker/sample/{sample_id}/re-submit

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

sample_id   integer   

The ID of the sample. Example: 18

Purchase Order API'S

Purchase Order Store API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/seeker/purchase-order/2/store';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'quantity' => 14.0,
            'description' => 'Some description',
            'image' => 'images/169219527022180996488.png',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/seeker/purchase-order/2/store"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "quantity": 14,
    "description": "Some description",
    "image": "images\/169219527022180996488.png"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/seeker/purchase-order/{sample_id}/store

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

sample_id   integer   

The ID of the sample. Example: 2

Body Parameters

quantity   number   

Must be at least 0.1. Example: 14

description   string   

Must be at least 3 characters. Example: Some description

image   string   

Example: images/169219527022180996488.png

Buyer QC Approve/Disapprove Purchase Order API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/seeker/purchase-order/6/approve-disapprove/qc';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'purchase_order_status_id' => 9,
            'purchase_order_status_remarks' => 'Some Remarks',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/seeker/purchase-order/6/approve-disapprove/qc"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "purchase_order_status_id": 9,
    "purchase_order_status_remarks": "Some Remarks"
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PATCH api/seeker/purchase-order/{purchase_order_id}/approve-disapprove/qc

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

purchase_order_id   integer   

The ID of the purchase order. Example: 6

Body Parameters

purchase_order_status_id   string   

Example: 9

Must be one of:
  • 9
  • 10
purchase_order_status_remarks   string  optional  

This field is required when purchase_order_status_id is 9. Example: Some Remarks

Buyer Pay Purchase Order API

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://be.mdelighttraders.com/api/seeker/purchase-order/10/pay';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://be.mdelighttraders.com/api/seeker/purchase-order/10/pay"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "PATCH",
    headers,
}).then(response => response.json());

Request      

PATCH api/seeker/purchase-order/{purchase_order_id}/pay

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

purchase_order_id   integer   

The ID of the purchase order. Example: 10