MENU navbar-image

Introduction

This documentation provides all the information you will need to work with for this API. The application is built with Laravel 9 PHP framework & is systematically versioned (SEMVER).

Base URL

https://idmapi.smartflowtech.com

Authenticating requests

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

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

You can retrieve your access_token by logging in using the Login a user using personal access token endpoint. Remember to append Bearer to the access_token

Endpoints

Login a user using personal access token

Example request:
curl --request POST \
    "http://localhost:8000/api/auth/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"fugit\",
    \"password\": \"a\"
}"
const url = new URL(
    "http://localhost:8000/api/auth/login"
);

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

let body = {
    "email": "fugit",
    "password": "a"
};

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

Request      

POST api/auth/login

Body Parameters

email  string  

The id of the user

password  string  

The id of the user

Issue access & refresh tokens using oauth password grant type

Example request:
curl --request POST \
    "http://localhost:8000/api/auth/token" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"cmurazik@example.net\",
    \"password\": \"et\",
    \"client_id\": \"sit\",
    \"client_secret\": \"et\",
    \"grant_type\": \"ea\",
    \"username\": \"eum\"
}"
const url = new URL(
    "http://localhost:8000/api/auth/token"
);

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

let body = {
    "email": "cmurazik@example.net",
    "password": "et",
    "client_id": "sit",
    "client_secret": "et",
    "grant_type": "ea",
    "username": "eum"
};

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

Request      

POST api/auth/token

Body Parameters

email  string  

Must be a valid email address.

password  string  

The password of the user

client_id  string  

The client_id that was issued to the vendor

client_secret  string  

The client_secret that was issued to the vendor

grant_type  string  

Must be set to 'password'

username  string  

The email of the user

Get the logged-in user

requires authentication

Example request:
curl --request GET \
    --get "http://localhost:8000/api/user" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost:8000/api/user"
);

const headers = {
    "Authorization": "{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: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/user

Display a listing of the oauth client resource.

requires authentication

Can also filter/search by name, vendor or client application

Example request:
curl --request GET \
    --get "http://localhost:8000/api/oauth/clients?term=ut&per_page=16" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost:8000/api/oauth/clients"
);

const params = {
    "term": "ut",
    "per_page": "16",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "{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: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/oauth/clients

Query Parameters

term  string optional  

Search query parameter

per_page  integer optional  

Items per page

Store a newly created resource in storage.

requires authentication

Example request:
curl --request POST \
    "http://localhost:8000/api/oauth/clients" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"quod\",
    \"redirect\": \"amet\",
    \"vendor_id\": 19,
    \"vendor_name\": \"molestias\",
    \"client_app\": \"consequatur\"
}"
const url = new URL(
    "http://localhost:8000/api/oauth/clients"
);

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

let body = {
    "name": "quod",
    "redirect": "amet",
    "vendor_id": 19,
    "vendor_name": "molestias",
    "client_app": "consequatur"
};

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

Request      

POST api/oauth/clients

Body Parameters

name  string  

What you want to name this Oauth client

redirect  string optional  

The URL to redirect the users after logging in

vendor_id  integer  

The ID of the vendor as stored in CUPID DB

vendor_name  string  

The name of the vendor as stored in CUPID DB

client_app  string  

The client application(PPOISe software product. Eg: TAM, CUPID)

Display the oauth client resource.

requires authentication

Example request:
curl --request GET \
    --get "http://localhost:8000/api/oauth/clients/nihil" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost:8000/api/oauth/clients/nihil"
);

const headers = {
    "Authorization": "{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: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/oauth/clients/{id}

URL Parameters

id  string  

The Oauth client ID that was issued to the application instance

Update the specified resource in storage.

requires authentication

Example request:
curl --request PUT \
    "http://localhost:8000/api/oauth/clients/quas" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost:8000/api/oauth/clients/quas"
);

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

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

Request      

PUT api/oauth/clients/{id}

PATCH api/oauth/clients/{id}

URL Parameters

id  string  

The Oauth client ID that was issued to the application instance

Delete the specified resource from storage.

requires authentication

Example request:
curl --request DELETE \
    "http://localhost:8000/api/oauth/clients/commodi" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost:8000/api/oauth/clients/commodi"
);

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

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

Request      

DELETE api/oauth/clients/{id}

URL Parameters

id  string  

The Oauth client ID that was issued to the application instance

Revoke oauth client access to the authentication server

requires authentication

Example request:
curl --request GET \
    --get "http://localhost:8000/api/oauth/revoke_client/nihil" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost:8000/api/oauth/revoke_client/nihil"
);

const headers = {
    "Authorization": "{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: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/oauth/revoke_client/{id}

URL Parameters

id  string  

The Oauth client ID that was issued to the application instance

Show the unencrypted secret key if the user provides the correct password to the account

requires authentication

Example request:
curl --request POST \
    "http://localhost:8000/api/oauth/display_secret/voluptatibus" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"password\": \"ut\"
}"
const url = new URL(
    "http://localhost:8000/api/oauth/display_secret/voluptatibus"
);

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

let body = {
    "password": "ut"
};

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

Request      

POST api/oauth/display_secret/{id}

URL Parameters

id  string  

The ID of the display secret.

client_id  string  

The Oauth client ID that was issued to the application instance

Body Parameters

password  string  

The password the authenticated admin user

Display a list of all oauth tokens issued to users. Can also filter/search by users' name, email, vendor & client app

requires authentication

Example request:
curl --request GET \
    --get "http://localhost:8000/api/oauth/token_access_logs" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost:8000/api/oauth/token_access_logs"
);

const headers = {
    "Authorization": "{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: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/oauth/token_access_logs

Get application metrics for dashboard

requires authentication

Example request:
curl --request GET \
    --get "http://localhost:8000/api/dashboard" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost:8000/api/dashboard"
);

const headers = {
    "Authorization": "{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: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/dashboard

Blacklist a users' IP address

requires authentication

Example request:
curl --request GET \
    --get "http://localhost:8000/api/oauth/blacklist_ip/16/pariatur" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost:8000/api/oauth/blacklist_ip/16/pariatur"
);

const headers = {
    "Authorization": "{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: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/oauth/blacklist_ip/{user_id}/{ip_address}

URL Parameters

user_id  integer  

The user_id to whom this IP will be blocked

ip_address  string  

The IP address you want to block

Logout a user

requires authentication

Example request:
curl --request GET \
    --get "http://localhost:8000/api/auth/logout" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost:8000/api/auth/logout"
);

const headers = {
    "Authorization": "{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: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/auth/logout

Delete a token

requires authentication

Example request:
curl --request DELETE \
    "http://localhost:8000/api/oauth/delete_token/vel" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost:8000/api/oauth/delete_token/vel"
);

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

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

Request      

DELETE api/oauth/delete_token/{id}

URL Parameters

id  string  

The ID of the token

Display a listing of vendor groups or search by name.

requires authentication

Example request:
curl --request GET \
    --get "http://localhost:8000/api/cupid/groups?term=repellat&per_page=17" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost:8000/api/cupid/groups"
);

const params = {
    "term": "repellat",
    "per_page": "17",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

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

Example response (200):


{
    "data": [
        {
            "vendors": []
        },
        {
            "vendors": []
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "« Previous",
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next »",
                "active": false
            }
        ],
        "path": "/",
        "per_page": 20,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/cupid/groups

Query Parameters

term  string optional  

Search query parameter

per_page  integer optional  

Items per page

Create a new vendor group

requires authentication

Example request:
curl --request POST \
    "http://localhost:8000/api/cupid/groups" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"rerum\",
    \"description\": \"iste\",
    \"active\": false
}"
const url = new URL(
    "http://localhost:8000/api/cupid/groups"
);

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

let body = {
    "name": "rerum",
    "description": "iste",
    "active": false
};

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

Example response (200):


{
    "data": {
        "vendors": []
    }
}
 

Request      

POST api/cupid/groups

Body Parameters

name  string  

description  string  

active  boolean optional  

Display a vendor group resource.

requires authentication

Example request:
curl --request GET \
    --get "http://localhost:8000/api/cupid/groups/iste" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost:8000/api/cupid/groups/iste"
);

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

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

Example response (200):


{
    "data": {
        "vendors": []
    }
}
 

Request      

GET api/cupid/groups/{id}

URL Parameters

id  string  

The company group ID that was issued to the application instance

Update a vendor group.

requires authentication

Example request:
curl --request PUT \
    "http://localhost:8000/api/cupid/groups/14" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"dolorem\",
    \"description\": \"at\",
    \"active\": true
}"
const url = new URL(
    "http://localhost:8000/api/cupid/groups/14"
);

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

let body = {
    "name": "dolorem",
    "description": "at",
    "active": true
};

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

Example response (200):


{
    "data": {
        "vendors": []
    }
}
 

Request      

PUT api/cupid/groups/{id}

PATCH api/cupid/groups/{id}

URL Parameters

id  integer  

The vendor group ID that was issued to the application instance

Body Parameters

name  string  

description  string  

active  boolean optional  

Delete a vendor group

requires authentication

Example request:
curl --request DELETE \
    "http://localhost:8000/api/cupid/groups/7" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost:8000/api/cupid/groups/7"
);

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

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

Request      

DELETE api/cupid/groups/{id}

URL Parameters

id  integer  

The ID of the company group

Display a listing of the vendors or search by name, phone number, email, address, city, state, country.

requires authentication

Example request:
curl --request GET \
    --get "http://localhost:8000/api/cupid/vendors?term=perferendis&per_page=20" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost:8000/api/cupid/vendors"
);

const params = {
    "term": "perferendis",
    "per_page": "20",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

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

Example response (200):


{
    "data": [
        [],
        []
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "« Previous",
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next »",
                "active": false
            }
        ],
        "path": "/",
        "per_page": 20,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/cupid/vendors

Query Parameters

term  string optional  

Search query parameter

per_page  integer optional  

Items per page

Create a new vendor

requires authentication

Example request:
curl --request POST \
    "http://localhost:8000/api/cupid/vendors" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"quia\",
    \"sm_company_id\": 11,
    \"address\": \"commodi\",
    \"phone_number\": \"velit\",
    \"email\": \"est\",
    \"country\": \"deleniti\",
    \"state\": \"eaque\",
    \"city\": \"omnis\",
    \"products_sold\": \"ratione\",
    \"payment_type\": \"dicta\",
    \"has_active_paga_account\": true,
    \"status\": false,
    \"on_loyalty_program\": false,
    \"create_wallet\": true
}"
const url = new URL(
    "http://localhost:8000/api/cupid/vendors"
);

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

let body = {
    "name": "quia",
    "sm_company_id": 11,
    "address": "commodi",
    "phone_number": "velit",
    "email": "est",
    "country": "deleniti",
    "state": "eaque",
    "city": "omnis",
    "products_sold": "ratione",
    "payment_type": "dicta",
    "has_active_paga_account": true,
    "status": false,
    "on_loyalty_program": false,
    "create_wallet": true
};

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

Example response (200):


{
    "data": []
}
 

Request      

POST api/cupid/vendors

Body Parameters

name  string  

group_id  string optional  

sm_company_id  integer optional  

address  string  

phone_number  string  

email  string  

Must be a valid email address.

country  string  

state  string  

city  string optional  

products_sold  string optional  

payment_type  string optional  

has_active_paga_account  boolean optional  

status  boolean optional  

on_loyalty_program  boolean optional  

create_wallet  boolean optional  

Display a vendor resource.

requires authentication

Example request:
curl --request GET \
    --get "http://localhost:8000/api/cupid/vendors/tempora" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost:8000/api/cupid/vendors/tempora"
);

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

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

Example response (200):


{
    "data": []
}
 

Request      

GET api/cupid/vendors/{id}

URL Parameters

id  string  

The vendor ID that was issued to the application instance

Update a vendor.

requires authentication

Example request:
curl --request PUT \
    "http://localhost:8000/api/cupid/vendors/12" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"mollitia\",
    \"sm_company_id\": 12,
    \"address\": \"blanditiis\",
    \"phone_number\": \"quia\",
    \"email\": \"beatae\",
    \"country\": \"distinctio\",
    \"state\": \"quibusdam\",
    \"city\": \"et\",
    \"products_sold\": \"vel\",
    \"payment_type\": \"cumque\",
    \"has_active_paga_account\": true,
    \"status\": false,
    \"on_loyalty_program\": false,
    \"create_wallet\": true
}"
const url = new URL(
    "http://localhost:8000/api/cupid/vendors/12"
);

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

let body = {
    "name": "mollitia",
    "sm_company_id": 12,
    "address": "blanditiis",
    "phone_number": "quia",
    "email": "beatae",
    "country": "distinctio",
    "state": "quibusdam",
    "city": "et",
    "products_sold": "vel",
    "payment_type": "cumque",
    "has_active_paga_account": true,
    "status": false,
    "on_loyalty_program": false,
    "create_wallet": true
};

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

Example response (200):


{
    "data": []
}
 

Request      

PUT api/cupid/vendors/{id}

PATCH api/cupid/vendors/{id}

URL Parameters

id  integer  

The vendor ID that was issued to the application instance

Body Parameters

name  string  

group_id  string optional  

sm_company_id  integer optional  

address  string  

phone_number  string  

email  string  

Must be a valid email address.

country  string  

state  string  

city  string optional  

products_sold  string optional  

payment_type  string optional  

has_active_paga_account  boolean optional  

status  boolean optional  

on_loyalty_program  boolean optional  

create_wallet  boolean optional  

Delete a vendor

requires authentication

Example request:
curl --request DELETE \
    "http://localhost:8000/api/cupid/vendors/15" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost:8000/api/cupid/vendors/15"
);

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

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

Request      

DELETE api/cupid/vendors/{id}

URL Parameters

id  integer  

The ID of the vendor

Get all the vendors(from CUPID DB)

requires authentication

Example request:
curl --request GET \
    --get "http://localhost:8000/api/cupid/get-all-vendors" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost:8000/api/cupid/get-all-vendors"
);

const headers = {
    "Authorization": "{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: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/cupid/get-all-vendors

Update user profile & password

requires authentication

Example request:
curl --request PATCH \
    "http://localhost:8000/api/profile/update-profile/5" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"ipsam\",
    \"email\": \"elaina.streich@example.org\",
    \"username\": \"quaerat\",
    \"gender\": \"Female\",
    \"phone\": \"dolores\",
    \"current_password\": \"aut\",
    \"password\": \"quas\"
}"
const url = new URL(
    "http://localhost:8000/api/profile/update-profile/5"
);

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

let body = {
    "name": "ipsam",
    "email": "elaina.streich@example.org",
    "username": "quaerat",
    "gender": "Female",
    "phone": "dolores",
    "current_password": "aut",
    "password": "quas"
};

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

Example response (200):


{
    "data": {
        "title": "Dr.",
        "name": "Prof. Tyrell Rowe III",
        "email": "dstoltenberg@example.org",
        "username": "zbogan",
        "email_verified_at": "2023-02-19T11:22:55.000000Z",
        "phone": "442-992-9696",
        "avatar": "https://via.placeholder.com/640x480.png/00ffbb?text=molestias",
        "is_admin": false,
        "is_vendor": false,
        "updated_at": "2023-02-19T11:22:55.000000Z",
        "created_at": "2023-02-19T11:22:55.000000Z",
        "id": 6
    }
}
 

Request      

PATCH api/profile/update-profile/{id}

URL Parameters

id  integer  

The ID of the user

Body Parameters

name  string  

email  string  

Must be a valid email address.

username  string  

gender  string  

Must be one of Male or Female.

phone  string  

current_password  string optional  

password  string optional  

password_confirmation  string optional  

The value and password must match.

Reset user password

requires authentication

Example request:
curl --request POST \
    "http://localhost:8000/api/reset-password?email=nesciunt" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost:8000/api/reset-password"
);

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

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

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

Request      

POST api/reset-password

Query Parameters

email  string  

email The user email

Register a user to SSO

Example request:
curl --request POST \
    "http://localhost:8000/api/register" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"title\": \"quisquam\",
    \"name\": \"voluptas\",
    \"phone\": \"omnis\",
    \"email\": \"jodie.morissette@example.org\",
    \"username\": \"qui\",
    \"gender\": \"Female\",
    \"newsletter\": true,
    \"active\": false,
    \"suspended\": true,
    \"is_admin\": true,
    \"is_vendor\": false
}"
const url = new URL(
    "http://localhost:8000/api/register"
);

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

let body = {
    "title": "quisquam",
    "name": "voluptas",
    "phone": "omnis",
    "email": "jodie.morissette@example.org",
    "username": "qui",
    "gender": "Female",
    "newsletter": true,
    "active": false,
    "suspended": true,
    "is_admin": true,
    "is_vendor": false
};

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

Request      

POST api/register

Body Parameters

title  string optional  

name  string  

phone  string  

email  string  

Must be a valid email address.

username  string optional  

gender  string optional  

Must be one of Male or Female.

newsletter  boolean optional  

active  boolean  

suspended  boolean  

is_admin  boolean  

is_vendor  boolean  

User Endpoints

Display a listing of the users or search by name, email, address, state, country.

requires authentication

Example request:
curl --request GET \
    --get "http://localhost:8000/api/users?term=consequuntur&per_page=10" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost:8000/api/users"
);

const params = {
    "term": "consequuntur",
    "per_page": "10",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

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

Example response (200):


{
    "data": [
        {
            "title": "Mr.",
            "name": "Daija Adams",
            "email": "delmer73@example.org",
            "username": "tamia.larson",
            "email_verified_at": "2023-02-19T11:22:55.000000Z",
            "phone": "283-933-9647",
            "avatar": "https://via.placeholder.com/640x480.png/00dd00?text=exercitationem",
            "is_admin": false,
            "is_vendor": false,
            "updated_at": "2023-02-19T11:22:55.000000Z",
            "created_at": "2023-02-19T11:22:55.000000Z",
            "id": 7
        },
        {
            "title": "Prof.",
            "name": "Ms. Layla Cassin",
            "email": "faustino19@example.com",
            "username": "lindgren.sofia",
            "email_verified_at": "2023-02-19T11:22:55.000000Z",
            "phone": "+1-863-815-6033",
            "avatar": "https://via.placeholder.com/640x480.png/009922?text=corporis",
            "is_admin": false,
            "is_vendor": false,
            "updated_at": "2023-02-19T11:22:55.000000Z",
            "created_at": "2023-02-19T11:22:55.000000Z",
            "id": 8
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "« Previous",
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next »",
                "active": false
            }
        ],
        "path": "/",
        "per_page": 20,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/users

Query Parameters

term  string optional  

Search query parameter

per_page  integer optional  

Items per page

Create a new user

requires authentication

Example request:
curl --request POST \
    "http://localhost:8000/api/users" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"title\": \"quos\",
    \"name\": \"ipsa\",
    \"phone\": \"dolorem\",
    \"email\": \"gus96@example.com\",
    \"username\": \"ex\",
    \"gender\": \"Female\",
    \"newsletter\": false,
    \"active\": true,
    \"suspended\": true,
    \"is_admin\": false,
    \"is_vendor\": true
}"
const url = new URL(
    "http://localhost:8000/api/users"
);

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

let body = {
    "title": "quos",
    "name": "ipsa",
    "phone": "dolorem",
    "email": "gus96@example.com",
    "username": "ex",
    "gender": "Female",
    "newsletter": false,
    "active": true,
    "suspended": true,
    "is_admin": false,
    "is_vendor": true
};

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

Example response (200):


{
    "data": {
        "title": "Prof.",
        "name": "Prof. Immanuel Carter",
        "email": "rosenbaum.reina@example.org",
        "username": "aletha49",
        "email_verified_at": "2023-02-19T11:22:55.000000Z",
        "phone": "248.562.4691",
        "avatar": "https://via.placeholder.com/640x480.png/004455?text=dolorem",
        "is_admin": false,
        "is_vendor": false,
        "updated_at": "2023-02-19T11:22:55.000000Z",
        "created_at": "2023-02-19T11:22:55.000000Z",
        "id": 9
    }
}
 

Request      

POST api/users

Body Parameters

title  string optional  

name  string  

phone  string  

email  string  

Must be a valid email address.

username  string optional  

gender  string optional  

Must be one of Male or Female.

newsletter  boolean optional  

active  boolean  

suspended  boolean  

is_admin  boolean  

is_vendor  boolean  

Show a specified user.

requires authentication

Example request:
curl --request GET \
    --get "http://localhost:8000/api/users/19" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost:8000/api/users/19"
);

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

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

Example response (200):


{
    "data": {
        "title": "Prof.",
        "name": "Ava Wunsch",
        "email": "milo.gusikowski@example.org",
        "username": "mpouros",
        "email_verified_at": "2023-02-19T11:22:55.000000Z",
        "phone": "(281) 829-8262",
        "avatar": "https://via.placeholder.com/640x480.png/0033bb?text=qui",
        "is_admin": false,
        "is_vendor": false,
        "updated_at": "2023-02-19T11:22:55.000000Z",
        "created_at": "2023-02-19T11:22:55.000000Z",
        "id": 10
    }
}
 

Request      

GET api/users/{id}

URL Parameters

id  integer  

The ID of the user

Update the specified user

requires authentication

Example request:
curl --request PUT \
    "http://localhost:8000/api/users/4" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"title\": \"magnam\",
    \"name\": \"dolorem\",
    \"phone\": \"ullam\",
    \"email\": \"linda69@example.net\",
    \"username\": \"rerum\",
    \"gender\": \"Male\",
    \"newsletter\": true,
    \"active\": true,
    \"suspended\": true,
    \"is_admin\": false,
    \"is_vendor\": true
}"
const url = new URL(
    "http://localhost:8000/api/users/4"
);

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

let body = {
    "title": "magnam",
    "name": "dolorem",
    "phone": "ullam",
    "email": "linda69@example.net",
    "username": "rerum",
    "gender": "Male",
    "newsletter": true,
    "active": true,
    "suspended": true,
    "is_admin": false,
    "is_vendor": true
};

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

Example response (200):


{
    "data": {
        "title": "Prof.",
        "name": "Prof. Giovanni Schumm III",
        "email": "jacobs.lesley@example.net",
        "username": "ghessel",
        "email_verified_at": "2023-02-19T11:22:55.000000Z",
        "phone": "551-985-0882",
        "avatar": "https://via.placeholder.com/640x480.png/005533?text=et",
        "is_admin": false,
        "is_vendor": false,
        "updated_at": "2023-02-19T11:22:55.000000Z",
        "created_at": "2023-02-19T11:22:55.000000Z",
        "id": 11
    }
}
 

Request      

PUT api/users/{id}

PATCH api/users/{id}

URL Parameters

id  integer  

The ID of the user

Body Parameters

title  string optional  

name  string  

phone  string  

email  string  

Must be a valid email address.

username  string optional  

gender  string optional  

Must be one of Male or Female.

newsletter  boolean optional  

active  boolean  

suspended  boolean  

is_admin  boolean  

is_vendor  boolean  

Delete a user

requires authentication

Example request:
curl --request DELETE \
    "http://localhost:8000/api/users/14" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost:8000/api/users/14"
);

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

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

Request      

DELETE api/users/{id}

URL Parameters

id  integer  

The ID of the user

Permanently delete a user

requires authentication

Example request:
curl --request DELETE \
    "http://localhost:8000/api/users/f_del_user/17" \
    --header "Authorization: {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost:8000/api/users/f_del_user/17"
);

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

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

Request      

DELETE api/users/f_del_user/{id}

URL Parameters

id  integer  

The ID of the user