Skip to main content

Overview

The Material API provides comprehensive endpoints for managing products, materials, inventory items, and their associated information including pricing, units, categories, and stock levels.

Material Management

Get Material Info

Retrieve detailed information about a specific material by ID.
GET /material/info?id={id}
id
Long
required
The unique identifier of the material
code
integer
Response status code (200 for success)
data
object

List Materials

Retrieve a paginated list of materials with optional search filters.
GET /material/list?search={search}
JSON string containing search parameters:
  • categoryId: Category filter
  • materialParam: Name/barcode search
  • standard: Standard specification
  • model: Model number
  • color: Color filter
  • brand: Brand filter
  • mfrs: Manufacturer filter
  • enabled: Enabled status
  • enableSerialNumber: Serial tracking filter
  • enableBatchNumber: Batch tracking filter

Create Material

Create a new material/product.
POST /material/add
name
string
required
Material name
categoryId
Long
required
Category ID
unit
string
required
Unit of measure
model
string
Model number
standard
string
Product standard
color
string
Color
brand
string
Brand name
mfrs
string
Manufacturer
weight
BigDecimal
Product weight
enabled
boolean
Enable status (default: true)
enableSerialNumber
string
Enable serial number tracking (“1” for yes)
enableBatchNumber
string
Enable batch number tracking (“1” for yes)
curl -X POST "http://localhost:9999/jshERP-boot/material/add" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Laptop Computer",
    "categoryId": 5,
    "model": "XPS-15",
    "brand": "Dell",
    "unit": "台",
    "standard": "15.6inch",
    "enabled": true
  }'

Update Material

Update an existing material’s information.
PUT /material/update
id
Long
required
Material ID to update
name
string
Updated material name
model
string
Updated model

Delete Material

Delete a material by ID.
DELETE /material/delete?id={id}
id
Long
required
Material ID to delete

Batch Delete Materials

Delete multiple materials at once.
DELETE /material/deleteBatch?ids={ids}
ids
string
required
Comma-separated material IDs (e.g., “1,2,3”)

Batch Set Status

Enable or disable multiple materials at once.
POST /material/batchSetStatus
status
boolean
required
true to enable, false to disable
ids
string
required
Comma-separated material IDs

Material Search & Selection

Find by Select

Search materials for dropdown/select components with pagination.
GET /material/findBySelect
page
integer
required
Page number (1-based)
rows
integer
required
Number of rows per page
q
string
Search query (name, barcode, etc.)
categoryId
Long
Filter by category
depotId
Long
Include stock info for depot
standardOrModel
string
Filter by standard or model
color
string
Filter by color
brand
string
Filter by brand
enableSerialNumber
string
Filter serial-tracked items
enableBatchNumber
string
Filter batch-tracked items
total
integer
Total matching records
rows
array
curl -X GET "http://localhost:9999/jshERP-boot/material/findBySelect?page=1&rows=20&q=laptop&depotId=1"

Get Material by Parameter

Quick search materials by keyword.
GET /material/getMaterialByParam?q={keyword}
q
string
required
Search keyword

Get Material by Barcode

Retrieve material information by barcode with pricing and stock.
GET /material/getMaterialByBarCode
barCode
string
required
Material barcode
depotId
Long
Depot ID for stock info
organId
Long
Organization ID for pricing
mpList
string
required
Material property list (comma-separated)
prefixNo
string
Bill prefix (CGDD, XSCK, etc.) for price selection
code
integer
Response status code
data
array
curl -X GET "http://localhost:9999/jshERP-boot/material/getMaterialByBarCode?barCode=LAP001&depotId=1&mpList=model,brand&prefixNo=XSCK"

Find by ID

Get material information by material ID.
GET /material/findById?id={id}
id
Long
required
Material ID

Find by ID with Barcode

Get material information by material extend ID.
GET /material/findByIdWithBarCode
meId
Long
required
Material extend ID
mpList
string
required
Material property list

Stock & Inventory

Get List with Stock

Retrieve materials with current stock levels.
GET /material/getListWithStock
currentPage
integer
required
Page number
pageSize
integer
required
Records per page
materialParam
string
required
Material search parameter
depotIds
string
Comma-separated depot IDs
categoryId
Long
Category filter
zeroStock
integer
required
Include zero stock (0=exclude, 1=include)
column
string
Sort column (default: createTime)
order
string
Sort order (asc/desc, default: desc)
code
integer
Response status code
data
object

Get Material Depot Stock

Get stock distribution across depots for a material.
GET /material/getMaterialDepotStock
materialId
Long
required
Material ID
depotIds
string
Comma-separated depot IDs (optional, uses user’s depots if not provided)
rows
array

Validation & Utilities

Check Name Exists

Check if a material name already exists.
GET /material/checkIsNameExist
id
Long
required
Material ID (use 0 for new material)
name
string
required
Material name to check
code
integer
Response status code
data
object
status
boolean
true if name exists, false otherwise

Check Material Exists

Check if a material with specific attributes exists.
GET /material/checkIsExist
id
Long
required
Material ID (use 0 for new)
name
string
required
Material name
model
string
required
Model
color
string
required
Color
standard
string
required
Standard
mfrs
string
required
Manufacturer
unit
string
required
Unit
unitId
Long
required
Unit ID

Get Max Barcode

Get the next available barcode number.
GET /material/getMaxBarCode
code
integer
Response status code
data
object
barCode
string
Next available barcode

Change Name to PinYin

Convert Chinese name to pinyin abbreviation.
POST /material/changeNameToPinYin
name
string
required
Chinese name to convert
code
integer
Response status code
data
string
Pinyin abbreviation

Batch Operations

Batch Update

Update multiple materials at once.
POST /material/batchUpdate
ids
string
required
Comma-separated material IDs
field
string
required
Field name to update
value
string
required
New value

Batch Set Current Stock

Recalculate and set current stock for materials.
POST /material/batchSetMaterialCurrentStock
ids
string
required
Comma-separated material IDs

Batch Set Current Unit Price

Recalculate and set current cost price for materials.
POST /material/batchSetMaterialCurrentUnitPrice
ids
string
required
Comma-separated material IDs

Import & Export

Export Excel

Export materials to Excel file.
GET /material/exportExcel
categoryId
string
Category filter
materialParam
string
Material search parameter
color
string
Color filter
enabled
string
Enabled status filter

Import Excel

Import materials from Excel file.
POST /material/importExcel
file
file
required
Excel file containing material data
code
integer
Response status code (200 for success)
data
object
Import result message and details

Serial Number Materials

Get Material Enable Serial Number List

Get materials with serial number tracking enabled.
GET /material/getMaterialEnableSerialNumberList
q
string
Search query
page
integer
required
Page number
rows
integer
required
Rows per page

Get Material Name List

Get list of all material names for autocomplete.
GET /material/getMaterialNameList
data
array

Build docs developers (and LLMs) love