Skip to main content

Overview

The Account API provides comprehensive endpoints for managing financial accounts, payment/receipt transactions, and account statements in jshERP. This includes account management, account heads (transaction headers), and account items (transaction details).

Account Management

Manage financial settlement accounts including bank accounts, cash accounts, and other payment methods.

Get Account Info

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

List Accounts

Retrieve a paginated list of accounts with optional search filters.
GET /account/list?search={search}
JSON string containing search parameters:
  • name: Account name filter
  • serialNo: Serial number filter
  • remark: Remark filter

Create Account

Create a new financial account.
POST /account/add
name
string
required
Account name
serialNo
string
Serial/Account number
initialAmount
BigDecimal
Initial balance
enabled
boolean
Enable status (default: true)
remark
string
Additional remarks
curl -X POST "http://localhost:9999/jshERP-boot/account/add" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "ICBC Main Account",
    "serialNo": "6222021001012345678",
    "initialAmount": 100000.00,
    "enabled": true,
    "remark": "Primary bank account"
  }'

Update Account

Update an existing account’s information.
PUT /account/update
id
Long
required
Account ID to update
name
string
Updated account name
serialNo
string
Updated serial number

Delete Account

Delete an account by ID.
DELETE /account/delete?id={id}
id
Long
required
Account ID to delete

Batch Delete Accounts

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

Get All Accounts

Retrieve all active accounts.
GET /account/getAccount
code
integer
Response status code
data
object
accountList
array
Array of account objects
curl -X GET "http://localhost:9999/jshERP-boot/account/getAccount"

Find by Select

Get accounts for dropdown selection.
GET /account/findBySelect
data
array

Update Default Account

Set an account as the default account.
POST /account/updateIsDefault
id
Long
required
Account ID to set as default

Batch Set Status

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

Account Statements & Reports

List with Balance

Get accounts list with current balance information.
GET /account/listWithBalance
name
string
required
Account name filter (empty string for all)
serialNo
string
required
Serial number filter (empty string for all)
rows
array

Get Statistics

Get aggregated statistics for accounts.
GET /account/getStatistics
name
string
required
Account name filter
serialNo
string
required
Serial number filter
code
integer
Response status code
data
object

Find Account In/Out List

Get detailed transaction history for an account.
GET /account/findAccountInOutList
currentPage
integer
required
Current page number
pageSize
integer
required
Records per page
accountId
Long
required
Account ID
initialAmount
BigDecimal
required
Initial amount for balance calculation
number
string
Bill number filter
beginTime
string
Start date (YYYY-MM-DD HH:mm:ss)
endTime
string
End date (YYYY-MM-DD HH:mm:ss)
code
integer
Response status code
data
object
curl -X GET "http://localhost:9999/jshERP-boot/account/findAccountInOutList?currentPage=1&pageSize=20&accountId=1&initialAmount=100000"

Validation

Check Name Exists

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

Account Head (Financial Transactions)

Manage financial transaction headers including payments, receipts, transfers, and other accounting entries.

Get Account Head Info

GET /accountHead/info?id={id}
id
Long
required
Account head ID

List Account Heads

Retrieve financial transaction headers with advanced filtering.
GET /accountHead/list?search={search}
search
string
JSON string containing search parameters:
  • type: Transaction type (收入/支出/收款/付款/转账)
  • billNo: Bill number
  • beginTime: Start date
  • endTime: End date
  • organId: Organization ID
  • accountId: Account ID
  • status: Status filter
  • number: Reference number

Create Account Head and Details

Create a new financial transaction with header and line items.
POST /accountHead/addAccountHeadAndDetail
info
string
required
JSON string of account head information
rows
string
required
JSON string of account item rows
curl -X POST "http://localhost:9999/jshERP-boot/accountHead/addAccountHeadAndDetail" \
  -H "Content-Type: application/json" \
  -d '{
    "info": "{\"type\":\"付款\",\"organId\":5,\"totalPrice\":5000,\"operTime\":\"2024-03-15 10:00:00\"}",
    "rows": "[{\"accountId\":1,\"eachAmount\":5000,\"remark\":\"采购货款\"}]"
  }'

Update Account Head and Details

Update an existing financial transaction.
PUT /accountHead/updateAccountHeadAndDetail
info
string
required
JSON string of updated account head information (must include id)
rows
string
required
JSON string of updated account item rows

Delete Account Head

DELETE /accountHead/delete?id={id}
id
Long
required
Account head ID to delete

Batch Delete Account Heads

DELETE /accountHead/deleteBatch?ids={ids}
ids
string
required
Comma-separated account head IDs

Batch Set Status

Approve or reverse approval for financial transactions.
POST /accountHead/batchSetStatus
status
string
required
Status value (“0” for pending, “1” for approved)
ids
string
required
Comma-separated account head IDs

Get Detail by Number

Retrieve financial transaction details by bill number.
GET /accountHead/getDetailByNumber?billNo={billNo}
billNo
string
required
Bill number
code
integer
Response status code
data
object
Complete account head object with details

Get Financial Bill by Bill ID

Get payment/receipt records associated with a depot transaction.
GET /accountHead/getFinancialBillNoByBillId?billId={billId}
billId
Long
required
Depot head (purchase/sale) bill ID
code
integer
Response status code
data
array
Array of associated financial transaction records

Account Item (Transaction Details)

Manage individual line items within financial transactions.

Get Detail List

Retrieve line items for a specific financial transaction.
GET /accountItem/getDetailList?headerId={headerId}
headerId
Long
required
Account head ID
code
integer
Response status code
data
object
curl -X GET "http://localhost:9999/jshERP-boot/accountItem/getDetailList?headerId=123"

Build docs developers (and LLMs) love