🚀 QuickBooks 時間卡片 API 文檔
本 API 提供了與 QuickBooks 時間卡片系統交互的能力,可實現數據查詢與操作,助力企業高效管理用戶信息、工作時間記錄、生成各類報告等。
🚀 快速開始
要在項目中使用此 API,請按照以下步驟操作:
- 安裝依賴:
npm install quickbooks-node
- 初始化客戶端:
const QuickBooks = require('quickbooks-node');
const qb = new QuickBooks({
consumerKey: 'your_consumer_key',
consumerSecret: 'your_consumer_secret',
accessToken: 'your_access_token',
accessTokenSecret: 'your_access_secret'
});
- 使用 API 方法:
qb.users.get()
.then(user => {
console.log('Logged in as:', user.name);
})
.catch(err => {
console.error('Error:', err);
});
✨ 主要特性
- 獲取和管理用戶信息
- 操作工作時間記錄
- 生成 payroll 和項目報告
- 配置和檢索自定義字段
- 監控對象修改狀態
- 管理通知和客戶
📚 詳細文檔
用戶相關接口
get_users
獲取系統中的所有用戶信息。
{
"page": number,
"limit": number
}
{
"users": [],
"total_pages": number,
"current_page": number
}
get_user
根據 ID 獲取單個用戶信息。
{
"id": number
}
{
"user": {
"id": number,
"name": string,
"email": string,
"status": string,
"role": string,
"time_zone": string,
"last_login": string,
"created_at": string,
"updated_at": string
}
}
create_user
創建新用戶。
{
"name": string,
"email": string,
"password": string,
"role": string,
"time_zone": string
}
{
"user": {
"id": number,
"name": string,
"email": string,
"status": string,
"role": string,
"time_zone": string,
"last_login": string,
"created_at": string,
"updated_at": string
}
}
update_user
更新用戶信息。
{
"id": number,
"name": string,
"email": string,
"role": string,
"time_zone": string
}
{
"user": {
"id": number,
"name": string,
"email": string,
"status": string,
"role": string,
"time_zone": string,
"last_login": string,
"created_at": string,
"updated_at": string
}
}
delete_user
刪除用戶。
{
"id": number
}
時間卡片相關接口
get_timecards
獲取所有時間卡片記錄。
{
"user_id": number,
"start_date": string,
"end_date": string,
"status": string,
"page": number,
"limit": number
}
{
"timecards": [],
"total_pages": number,
"current_page": number
}
get_timecard
根據 ID 獲取單個時間卡片記錄。
{
"id": number
}
{
"timecard": {
"id": number,
"user_id": number,
"date": string,
"start_time": string,
"end_time": string,
"duration": number,
"status": string,
"notes": string,
"created_at": string,
"updated_at": string
}
}
create_timecard
創建新的時間卡片記錄。
{
"user_id": number,
"date": string,
"start_time": string,
"end_time": string,
"duration": number,
"status": string,
"notes": string
}
{
"timecard": {
"id": number,
"user_id": number,
"date": string,
"start_time": string,
"end_time": string,
"duration": number,
"status": string,
"notes": string,
"created_at": string,
"updated_at": string
}
}
update_timecard
更新時間卡片記錄。
{
"id": number,
"user_id": number,
"date": string,
"start_time": string,
"end_time": string,
"duration": number,
"status": string,
"notes": string
}
{
"timecard": {
"id": number,
"user_id": number,
"date": string,
"start_time": string,
"end_time": string,
"duration": number,
"status": string,
"notes": string,
"created_at": string,
"updated_at": string
}
}
delete_timecard
刪除時間卡片記錄。
{
"id": number
}
報告相關接口
generate_payroll_report
生成 payroll 報告。
{
"start_date": string,
"end_date": string,
"user_id": number,
"department": string,
"status": string
}
{
"report": {
"id": number,
"start_date": string,
"end_date": string,
"total_hours": number,
"total_overtime": number,
"subtotal": number,
"taxes": number,
"grand_total": number,
"created_at": string
}
}
generate_project_report
生成項目報告。
{
"project_id": number,
"start_date": string,
"end_date": string,
"user_id": number,
"status": string
}
{
"report": {
"id": number,
"project_id": number,
"start_date": string,
"end_date": string,
"total_hours": number,
"subtotal": number,
"grand_total": number,
"created_at": string
}
}
自定義字段相關接口
get_custom_fields
獲取所有自定義字段。
{
"page": number,
"limit": number
}
{
"custom_fields": [],
"total_pages": number,
"current_page": number
}
get_custom_field
根據 ID 獲取單個自定義字段。
{
"id": number
}
{
"custom_field": {
"id": number,
"name": string,
"type": string,
"required": boolean,
"options": array,
"created_at": string,
"updated_at": string
}
}
create_custom_field
創建新的自定義字段。
{
"name": string,
"type": string,
"required": boolean,
"options": array
}
{
"custom_field": {
"id": number,
"name": string,
"type": string,
"required": boolean,
"options": array,
"created_at": string,
"updated_at": string
}
}
update_custom_field
更新自定義字段。
{
"id": number,
"name": string,
"type": string,
"required": boolean,
"options": array
}
{
"custom_field": {
"id": number,
"name": string,
"type": string,
"required": boolean,
"options": array,
"created_at": string,
"updated_at": string
}
}
delete_custom_field
刪除自定義字段。
{
"id": number
}
對象修改狀態相關接口
get_last_modified
獲取指定對象的最後修改時間。
{
"object_type": string,
"object_id": number
}
{
"last_modified_at": string
}
系統管理相關接口
backup_system
備份系統數據。
{
"status": string,
"message": string
}
restore_system
恢復系統數據。
{
"status": string,
"message": string
}
📄 許可證
MIT License
貢獻者
貢獻者列表:
有關更多詳細信息,請參閱 QuickBooks API 文檔。