Vendors

Retrieve all vendors

get

Retrieve all vendors for a company

Query parameters
per_pageintegerOptional

limit of records per page

Example: 10
pageintegerOptional

page number

Example: 2
namestringOptional

This field is used to filter by vendor name. (LIKE)

Example: Hay
sort_bystringOptional

This parameter is used to sort the records by a specific field (created_at,name)

Example: name
sort_dirstringOptional

Order type(asc or desc)

Example: asc
Responses
200

Successful operation

application/json
get
GET /api/vendors HTTP/1.1
Host: app.greenplaces.com
Accept: */*
{
  "status": "Ok",
  "message": "Success",
  "data": [
    {
      "id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
      "name": "test name",
      "description": "description...",
      "website": "https://www.example.com/",
      "notes": "notes...",
      "services_provided": "example",
      "products_purchased": "example",
      "account_manager_name": "name manager",
      "account_manager_email": "[email protected]",
      "currency": "USD",
      "score": "2",
      "updated_at": "2023-06-12T17:30:21.000000Z",
      "created_at": "2023-06-12T17:30:21.000000Z"
    }
  ],
  "meta": {
    "pagination": {
      "current": "1",
      "last_page": "1",
      "per_page": "10",
      "total": "6"
    }
  }
}

Store a vendor

post

Store a vendor for a company

Body

create vendor request body data

namestringRequired

name of the Vendor

Example: test name
websitestringRequired

website of the Vendor

Example: https://www.example.com/
descriptionstringOptional

description of the Vendor

Example: description...
notesstringOptional

notes of the Vendor

Example: notes...
services_providedstringOptional

services_provided of the Vendor

Example: example
products_purchasedstringOptional

products_purchased of the Vendor

Example: example
account_manager_namestringOptional

account_manager_name of the Vendor

Example: name manager
account_manager_emailstringOptional

account_manager_email of the Vendor

Example: [email protected]
currencystringOptional

currency of the Vendor

Example: USD
scoreintegerOptional

score of the Vendor

Example: 22
Responses
200

Successful operation

application/json
post
POST /api/vendors HTTP/1.1
Host: app.greenplaces.com
Content-Type: application/json
Accept: */*
Content-Length: 280

{
  "name": "test name",
  "website": "https://www.example.com/",
  "description": "description...",
  "notes": "notes...",
  "services_provided": "example",
  "products_purchased": "example",
  "account_manager_name": "name manager",
  "account_manager_email": "[email protected]",
  "currency": "USD",
  "score": "22"
}
{
  "status": "Ok",
  "message": "Success",
  "data": {
    "id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
    "name": "test name",
    "description": "description...",
    "website": "https://www.example.com/",
    "notes": "notes...",
    "services_provided": "example",
    "products_purchased": "example",
    "account_manager_name": "name manager",
    "account_manager_email": "[email protected]",
    "currency": "USD",
    "score": "2",
    "updated_at": "2023-06-12T17:30:21.000000Z",
    "created_at": "2023-06-12T17:30:21.000000Z"
  },
  "meta": {}
}

Retrieve a vendor

get

Retrieve a vendor for a company

Path parameters
idstringRequired

Id of the vendor

Example: 996501df-0bfc-4f95-954d-3a5d5dc48469
Responses
200

Successful operation

application/json
get
GET /api/vendors/{id} HTTP/1.1
Host: app.greenplaces.com
Accept: */*
{
  "status": "Ok",
  "message": "Success",
  "data": {
    "id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
    "name": "test name",
    "description": "description...",
    "website": "https://www.example.com/",
    "notes": "notes...",
    "services_provided": "example",
    "products_purchased": "example",
    "account_manager_name": "name manager",
    "account_manager_email": "[email protected]",
    "currency": "USD",
    "score": "2",
    "updated_at": "2023-06-12T17:30:21.000000Z",
    "created_at": "2023-06-12T17:30:21.000000Z"
  },
  "meta": {}
}

Update a vendor

put

Update a vendor for a company

Path parameters
idstringRequired

Id of the vendor

Example: 996501df-0bfc-4f95-954d-3a5d5dc48469
Body

create vendor request body data

namestringRequired

name of the Vendor

Example: test name
websitestringRequired

website of the Vendor

Example: https://www.example.com/
descriptionstringOptional

description of the Vendor

Example: description...
notesstringOptional

notes of the Vendor

Example: notes...
services_providedstringOptional

services_provided of the Vendor

Example: example
products_purchasedstringOptional

products_purchased of the Vendor

Example: example
account_manager_namestringOptional

account_manager_name of the Vendor

Example: name manager
account_manager_emailstringOptional

account_manager_email of the Vendor

Example: [email protected]
currencystringOptional

currency of the Vendor

Example: USD
scoreintegerOptional

score of the Vendor

Example: 22
Responses
200

Successful operation

application/json
put
PUT /api/vendors/{id} HTTP/1.1
Host: app.greenplaces.com
Content-Type: application/json
Accept: */*
Content-Length: 280

{
  "name": "test name",
  "website": "https://www.example.com/",
  "description": "description...",
  "notes": "notes...",
  "services_provided": "example",
  "products_purchased": "example",
  "account_manager_name": "name manager",
  "account_manager_email": "[email protected]",
  "currency": "USD",
  "score": "22"
}
{
  "status": "Ok",
  "message": "Success",
  "data": {
    "id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
    "name": "test name",
    "description": "description...",
    "website": "https://www.example.com/",
    "notes": "notes...",
    "services_provided": "example",
    "products_purchased": "example",
    "account_manager_name": "name manager",
    "account_manager_email": "[email protected]",
    "currency": "USD",
    "score": "2",
    "updated_at": "2023-06-12T17:30:21.000000Z",
    "created_at": "2023-06-12T17:30:21.000000Z"
  },
  "meta": {}
}

Delete vendor

delete

remove vendor

Path parameters
idstringRequired

Id of the vendor

Example: 996501df-0bfc-4f95-954d-3a5d5dc48469
Responses
200

Successful operation

application/json
delete
DELETE /api/vendors/{id} HTTP/1.1
Host: app.greenplaces.com
Accept: */*
{
  "status": "Ok",
  "message": "Success",
  "data": null,
  "meta": {}
}