🚀 QuickBooks 時間カード API ドキュメント
この API は、QuickBooks 時間カードシステムとのやり取りを可能にし、データの照会と操作を行うことができます。
🚀 クイックスタート
プロジェクトでこの API を使用するには、以下の手順に従ってください。
1. 依存関係のインストール
npm install quickbooks-node
2. クライアントの初期化
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'
});
3. API メソッドの使用
qb.users.get()
.then(user => {
console.log('Logged in as:', user.name);
})
.catch(err => {
console.error('Error:', err);
});
✨ 主な機能
- ユーザー情報の取得と管理
- 勤務時間記録の操作
- 給与明細とプロジェクトレポートの生成
- カスタムフィールドの設定と取得
- オブジェクトの変更状態の監視
- 通知と顧客の管理
📚 ドキュメント
詳細情報については、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'
});
qb.users.get()
.then(user => {
console.log('Logged in as:', user.name);
})
.catch(err => {
console.error('Error:', err);
});
🔧 技術詳細
ユーザー関連インターフェイス
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
給与明細レポートを生成します。
パラメータ
{
"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
貢献者
貢献者リスト: