Top

Items

List items
GET /items
Get the list of all active items with pagination.
Get an item
GET /items/:item_id
Get the details of an item.
Create an item
POST /items
Create a new item.
Update an item
PUT /items/:item_id
Update the details of an item.
Delete an item
DELETE /items/:item_id
Delete the item created.items that are part of transaction cannot be deleted.
Mark item as active.
POST /items/:item_id/active
Mark an inactive item as active.
Mark item as inactive
POST /items/:item_id/inactive
Mark an active item as inactive.

List items

GET  /items

Get the list of all active items with pagination.

Parameters

name string
[100]
Search items by name.
Variants: name_startswith and name_contains
description string
[100]
Search items by description.
Variants: description_startswith and description_contains
rate double Search items by rate.
Variants: rate_less_than, rate_less_equals, rate_greater_than and rate_greater_equals
tax_id string Search items by tax id.
filter_by string Filter items by status.
Allowed Values: Status.All, Status.Active and Status.Inactive
search_text string
[100]
Search items by name or description.
sort_column string Sort items.
Allowed Values: name, rate and tax_name

Sample Response

Status: 200 OK
Content Type: application/json;charset=UTF-8
{
  "code": 0,
  "message": "success",
  "items": [
    {
      "item_id": "982000000030049",
      "name": "Hard Drive",
      "status": "active",
      "description": "500GB, USB 2.0 interface 1400 rpm, protective hard case.",
      "rate": 120.00,
      "tax_id": "",
      "tax_name": "",
      "tax_percentage": 0
    },
    {
      "item_id": "982000000030051",
      "name": "Premium Plan - Web hosting",
      "status": "active",
      "description": "10 GB Space, 300 GB Transfer 100 Email Accounts 10 MySQL Databases",
      "rate": 33.00,
      "tax_id": "",
      "tax_name": "",
      "tax_percentage": 0
    }
  ],
  "page_context": {
    "page": 1,
    "per_page": 200,
    "has_more_page": false,
    "report_name": "Items",
    "applied_filter": "Status.All",
    "sort_column": "name",
    "sort_order": "A"
  }
}

Get an item

GET  /items/:item_id

Get the details of an item.

Sample Response

Status: 200 OK
Content Type: application/json;charset=UTF-8
{
  "code": 0,
  "message": "success",
  "item": {
    "item_id": "982000000030049",
    "name": "Hard Drive",
    "status": "active",
    "description": "500GB, USB 2.0 interface 1400 rpm, protective hard case.",
    "rate": 120.00,
    "unit": "",
    "tax_id": "",
    "tax_name": "",
    "tax_percentage": 0,
    "tax_type": ""
  }
}

Create an item

POST  /items

Create a new item.

Request attributes

name* string
[100]
Name of the item.
description string
[2000]
Description for the item.
rate* double Price of the item.
tax_id string ID of the tax to be associated to the item.

Sample Request

{
  "name": "Hard Drive",
  "description": "500GB, USB 2.0 interface 1400 rpm, protective hard case.",
  "rate": 120.00,
  "tax_id": ""
}

Sample Response

Status: 201 Created
Content Type: application/json;charset=UTF-8
{
  "code": 0,
  "message": "The item has been added.",
  "item": {
    "item_id": "982000000030049",
    "name": "Hard Drive",
    "status": "active",
    "description": "500GB, USB 2.0 interface 1400 rpm, protective hard case.",
    "rate": 120.00,
    "unit": "",
    "tax_id": "",
    "tax_name": "",
    "tax_percentage": 0,
    "tax_type": ""
  }
}

Update an item

PUT  /items/:item_id

Update the details of an item.

Request attributes

name* string
[100]
Name of the item.
description string
[2000]
Description for the item.
rate* double Price of the item.
tax_id string ID of the tax to be associated to the item.

Sample Request

{
  "name": "Hard Drive",
  "description": "500GB, USB 2.0 interface 1400 rpm, protective hard case.",
  "rate": 120.00,
  "tax_id": ""
}

Sample Response

Status: 200 OK
Content Type: application/json;charset=UTF-8
{
  "code": 0,
  "message": "Item details have been saved.",
  "item": {
    "item_id": "982000000030049",
    "name": "Hard Drive",
    "status": "active",
    "description": "500GB, USB 2.0 interface 1400 rpm, protective hard case.",
    "rate": 120.00,
    "unit": "",
    "tax_id": "",
    "tax_name": "",
    "tax_percentage": 0,
    "tax_type": ""
  }
}

Delete an item

DELETE  /items/:item_id

Delete the item created.items that are part of transaction cannot be deleted.

Sample Response

Status: 200 OK
Content Type: application/json;charset=UTF-8
{
  "code": 0,
  "message": "The item has been deleted."
}

Mark item as active.

POST  /items/:item_id/active

Mark an inactive item as active.

Sample Response

Status: 200 OK
Content Type: application/json;charset=UTF-8
{
  "code": 0,
  "message": "The item has been marked as active."
}

Mark item as inactive

POST  /items/:item_id/inactive

Mark an active item as inactive.

Sample Response

Status: 200 OK
Content Type: application/json;charset=UTF-8
{
  "code": 0,
  "message": "The item has been marked as inactive."
}