格物 开放 API企业管理

REST API · 接口参考

REST API 参考 · 员工福利购物 / 企业采购

企业管理

以企业管理员身份调用:x-open-user 放一个被绑成 owner 或 admin 的用户。查额度池、看账单、向员工发放额度。

#企业概览、额度池余额与流水

GET/v1/enterprise/org

鉴权用户态

x-open-user 放企业管理员(owner / admin)。企业由该用户所属企业决定,请求里不接受 orgId。

返回字段27 个,点击展开
字段类型说明
okboolean
orgobject
org.idstring
org.namestring
org.statusstring
org.joinPolicystring可选值:auto / review
org.poolBalancenumber
org.memberCountinteger
org.invoiceobject
org.invoice.titlestring发票抬头,缺省 = 企业名称
org.invoice.taxNostring税号,固定等于统一社会信用代码
org.invoice.bankNamestring
org.invoice.bankAccountstring
org.invoice.addressstring
org.invoice.phonestring
org.invoiceReadyboolean
org.createdAtstring
ledgerobject[]额度池流水,最多 100 条,新的在前
ledger[].kindstringrecharge / grant / revoke / expire / refund / offboard / adjust 等
ledger[].kindLabelstring
ledger[].amountnumber带正负号
ledger[].balanceAfternumber
ledger[].remarkstring
ledger[].createdAtstring
defaultExpiryDaysnumber发放额度的默认有效期(天)
meobject
me.rolestring

调用示例

1curl -X GET "https://api.gowu.net/v1/enterprise/org" \2  -H "x-app-key: $GOWU_APP_KEY" \3  -H "x-timestamp: $TS" \4  -H "x-nonce: $NONCE" \5  -H "x-sign-version: 2" \6  -H "x-signature: $SIG" \7  -H "x-open-user: u-001"

返回示例

1{2  "ok": true,3  "org": {4    "id": "string",5    "name": "string",6    "status": "string",7    "joinPolicy": "auto",8    "poolBalance": 0,9    "memberCount": 0,10    "invoice": {11      "title": "string",12      "taxNo": "string",13      "bankName": "string",14      "bankAccount": "string",15      "address": "string",16      "phone": "string"17    },18    "invoiceReady": true,19    "createdAt": "string"20  },21  "ledger": [22    {23      "kind": "string",24      "kindLabel": "string",25      "amount": 0,26      "balanceAfter": 0,27      "remark": "string",28      "createdAt": "string"29    }30  ],31  "defaultExpiryDays": 0,32  "me": {33    "role": "string"34  }35}

#修改企业资料

PUT/v1/enterprise/org/profile

修改企业资料(名称、信用代码开户后不可改)

鉴权用户态

企业名称与统一社会信用代码开户后不可改(传了不同的值返回 IDENTITY_LOCKED)。税号固定等于信用代码。

请求体application/json

字段类型必填说明
shortNamestring否
regionstring否
contactNamestring否
adminTitlestring否
adminEmailstring否
licenseUrlstring否
joinPolicystring否可选值:auto / review
invoiceobject否
invoice.titlestring否发票抬头,缺省 = 企业名称
invoice.taxNostring否税号,固定等于统一社会信用代码
invoice.bankNamestring否
invoice.bankAccountstring否
invoice.addressstring否
invoice.phonestring否

返回字段

字段类型说明
okboolean例:true

错误

  • 400 IDENTITY_LOCKED / SAVE_FAILED / BAD_CREDIT_CODE

调用示例

1curl -X PUT "https://api.gowu.net/v1/enterprise/org/profile" \2  -H "x-app-key: $GOWU_APP_KEY" \3  -H "x-timestamp: $TS" \4  -H "x-nonce: $NONCE" \5  -H "x-sign-version: 2" \6  -H "x-signature: $SIG" \7  -H "x-open-user: u-001"

返回示例

1{2  "ok": true3}

#企业账单

GET/v1/enterprise/org/bills

企业账单(?id= 查看单张)

鉴权用户态

出现在福利 / 采购 · 售后、发票与账单

不带 id 返回最近 36 期(按期间倒序);带 id 返回单张。

查询参数

字段类型必填说明
idstring否账单 id
返回字段33 个,点击展开 · 不带 id 时返回 items,带 id 时返回 bill
字段类型说明
okboolean
itemsobject[]
items[].idstring
items[].periodstring例:2026-09
items[].grantednumber
items[].usednumber
items[].refundednumber
items[].returnednumber
items[].serviceFeenumber
items[].adjustnumber
items[].adjustReasonstring
items[].payablenumber
items[].paidnumber
items[].statusstringgenerated / confirmed / paid / closed 等
items[].generatedAtstring
items[].confirmedAtstring
items[].paidAtstring
billobject
bill.idstring
bill.periodstring例:2026-09
bill.grantednumber
bill.usednumber
bill.refundednumber
bill.returnednumber
bill.serviceFeenumber
bill.adjustnumber
bill.adjustReasonstring
bill.payablenumber
bill.paidnumber
bill.statusstringgenerated / confirmed / paid / closed 等
bill.generatedAtstring
bill.confirmedAtstring
bill.paidAtstring

错误

  • 404 账单不存在

调用示例

1curl -X GET "https://api.gowu.net/v1/enterprise/org/bills" \2  -H "x-app-key: $GOWU_APP_KEY" \3  -H "x-timestamp: $TS" \4  -H "x-nonce: $NONCE" \5  -H "x-sign-version: 2" \6  -H "x-signature: $SIG" \7  -H "x-open-user: u-001"

返回示例

1{2  "ok": true,3  "items": [4    {5      "id": "string",6      "period": "2026-09",7      "granted": 0,8      "used": 0,9      "refunded": 0,10      "returned": 0,11      "serviceFee": 0,12      "adjust": 0,13      "adjustReason": "string",14      "payable": 0,15      "paid": 0,16      "status": "string",17      "generatedAt": "string",18      "confirmedAt": "string",19      "paidAt": "string"20    }21  ],22  "bill": {23    "id": "string",24    "period": "2026-09",25    "granted": 0,26    "used": 0,27    "refunded": 0,28    "returned": 0,29    "serviceFee": 0,30    "adjust": 0,31    "adjustReason": "string",32    "payable": 0,33    "paid": 0,34    "status": "string",35    "generatedAt": "string",36    "confirmedAt": "string",37    "paidAt": "string"38  }39}

#向员工发放 / 回收额度,或全员发放

POST/v1/enterprise/org/points

向员工发放 / 回收额度,或全员发放(100 = 1 元)。用 userId 指定员工即可

鉴权用户态

出现在福利 / 采购 · 额度与下单员工福利 · 福豆任务、签到与生日

以管理员身份调用。action:grant 发放(缺省)、revoke 回收、grant-all 全员发放。grant / revoke 用 userId(你的用户 ID)或 accountId 指定员工,两者都传以 accountId 为准。 theme 是福利类型,可选值用 GET /v1/enterprise/points/themes 查,传了不认识的值返回 400。每批有效期夹到 1–90 天,到期未用完退回企业。金额单位:100 = 1 元。

请求体application/json

字段类型必填说明
actionstring否可选值:grant / revoke / grant-all。默认 "grant"
userIdstring否你的用户 ID(grant / revoke 时与 accountId 二选一)
accountIdstring否平台内部员工账号 id
amountinteger是额度(100 = 1 元);grant-all 时为每人金额。≥ 1
themestring否福利类型 key。默认 "special"
namestring否这批额度的名称,如「中秋福利」
expiresInDaysnumber否有效期(天),不传用企业默认,最终夹到 1–90
budgetCategorystring否计入哪个预算类目,缺省 = theme
lotIdstring否仅 revoke:指定从哪一批回收,不传按到期先后
remarkstring否

返回字段

字段类型说明
okboolean
replaybooleangrant / revoke:是否为重复请求的回放
resultobjectgrant-all 时返回
result.grantedinteger
result.amountnumber
result.failedobject[]
result.failed[].accountIdstring
result.failed[].messagestring

错误

  • 400 BAD_REQUEST(金额或福利类型不合法、缺少员工)/ BUDGET_EXCEEDED / INSUFFICIENT_POINTS(额度池或员工余额不足,附 balance、shortfall)/ NO_ACCOUNT / LOT_UNAVAILABLE / EMPTY

调用示例

1curl -X POST "https://api.gowu.net/v1/enterprise/org/points" \2  -H "x-app-key: $GOWU_APP_KEY" \3  -H "x-timestamp: $TS" \4  -H "x-nonce: $NONCE" \5  -H "x-sign-version: 2" \6  -H "x-signature: $SIG" \7  -H "x-open-user: u-001" \8  -H "content-type: application/json" \9  -d '{"action":"grant","userId":"u-001","amount":50000,"theme":"festival","name":"中秋福利","expiresInDays":60}'

返回示例

1{2  "ok": true,3  "replay": true,4  "result": {5    "granted": 0,6    "amount": 0,7    "failed": [8      {9        "accountId": "string",10        "message": "string"11      }12    ]13  }14}

#福利类型列表

GET/v1/enterprise/points/themes

福利类型列表(发放时 theme 的可选值)

鉴权appKey

出现在福利 / 采购 · 额度与下单

发放额度时 theme 的可选值,由运营在后台维护,不要写死。只返回启用中的类型。

返回字段

字段类型说明
itemsobject[]
items[].keystring例:festival
items[].labelstring例:节日福利
items[].sortinteger

调用示例

1curl -X GET "https://api.gowu.net/v1/enterprise/points/themes" \2  -H "x-app-key: $GOWU_APP_KEY"

返回示例

1{2  "items": [3    {4      "key": "festival",5      "label": "节日福利",6      "sort": 07    }8  ]9}

#管理看板:员工数、额度池、本月发放与消耗

GET/v1/enterprise/org/dashboard

鉴权用户态

管理首页的汇总数:某个期间内的发放、使用、回池、退回与使用率。全部从额度流水按期间汇总,金额单位 100 = 1 元。

查询参数

字段类型必填说明
periodstring否期间:2026 / 2026-Q3 / 2026-09;不传 = 当前年份。例:2026-Q3

返回字段

字段类型说明
okboolean
periodstring
membersinteger在职员工数
poolBalancenumber企业额度池当前余额
grantednumber期间内发放(含任务奖励)
usednumber期间内下单使用
returnednumber回池:回收 + 过期 + 离职 + 兑换扣回
refundednumber取消 / 退款退回员工
usageRatenumber使用率(%),一位小数:(used − refunded) / granted
perCapitanumber人均发放
coveredinteger期间内被发放过额度的人数
redemptionsinteger期间内下单笔数

错误

  • 400 操作失败,message 说明原因(部分情况不带 code)

调用示例

1curl -X GET "https://api.gowu.net/v1/enterprise/org/dashboard" \2  -H "x-app-key: $GOWU_APP_KEY" \3  -H "x-timestamp: $TS" \4  -H "x-nonce: $NONCE" \5  -H "x-sign-version: 2" \6  -H "x-signature: $SIG" \7  -H "x-open-user: u-001"

返回示例

1{2  "ok": true,3  "period": "string",4  "members": 0,5  "poolBalance": 0,6  "granted": 0,7  "used": 0,8  "returned": 0,9  "refunded": 0,10  "usageRate": 0,11  "perCapita": 0,12  "covered": 0,13  "redemptions": 014}

#员工列表

GET/v1/enterprise/org/members

员工列表(含各自额度余额)

鉴权用户态

本企业员工及各自余额,含已停用、已离职的(看 status),不分页。只列在你这个接入方所属产品下的员工。

返回字段

字段类型说明
okboolean
itemsobject[]
items[].idstring成员记录 id
items[].orgIdstring
items[].accountIdstring员工的平台账号 id;单个员工接口的路径参数
items[].rolestring可选值:owner / admin / member
items[].statusstring可选值:active / suspended / offboarded
items[].realNamestring
items[].nicknamestring
items[].phonestring
items[].birthdaystring
items[].departmentIdstring
items[].balancenumber员工额度余额(100 = 1 元)
items[].createdAtstring

调用示例

1curl -X GET "https://api.gowu.net/v1/enterprise/org/members" \2  -H "x-app-key: $GOWU_APP_KEY" \3  -H "x-timestamp: $TS" \4  -H "x-nonce: $NONCE" \5  -H "x-sign-version: 2" \6  -H "x-signature: $SIG" \7  -H "x-open-user: u-001"

返回示例

1{2  "ok": true,3  "items": [4    {5      "id": "string",6      "orgId": "string",7      "accountId": "string",8      "role": "owner",9      "status": "active",10      "realName": "string",11      "nickname": "string",12      "phone": "string",13      "birthday": "string",14      "departmentId": "string",15      "balance": 0,16      "createdAt": "string"17    }18  ]19}

#员工详情 / 修改资料

GETPUT/v1/enterprise/org/members/{userId}

员工详情 / 修改资料(带 ?by=userId 时路径里放你的用户 ID)

鉴权用户态

GET

员工额度明细

员工手上还有余量的额度批次,以及离职时的回收记录。

路径参数

字段类型必填说明
accountIdstring是员工的平台账号 id;带 ?by=userId 时为你的用户 ID

查询参数

字段类型必填说明
bystring否传 userId 时,路径里放你自己的用户 ID。可选值:userId

返回字段

字段类型说明
okboolean
lotsobject[]
lots[].idstring
lots[].namestring
lots[].themestring
lots[].themeLabelstring
lots[].amountnumber发放额度
lots[].remainingnumber剩余额度
lots[].grantedAtstring
lots[].expiresAtstring可能为 null
offboardRecordobject[]
offboardRecord[].lotIdstring
offboardRecord[].namestring
offboardRecord[].amountnumber
offboardRecord[].atstring

错误

  • 404 资源不存在,或不归属你的 appKey / 当前用户

PUT

修改员工资料

路径参数

字段类型必填说明
accountIdstring是员工的平台账号 id;带 ?by=userId 时为你的用户 ID

查询参数

字段类型必填说明
bystring否传 userId 时,路径里放你自己的用户 ID。可选值:userId

请求体application/json

字段类型必填说明
realNamestring否
departmentIdstring否null 或空串 = 清空部门。可能为 null
birthdaystring否YYYY-MM-DD 或 MM-DD
genderstring否可选值:male / female / ``

返回字段

字段类型说明
okboolean例:true

错误

  • 400 操作失败,message 说明原因(部分情况不带 code)
  • 404 资源不存在,或不归属你的 appKey / 当前用户

调用示例

1curl -X GET "https://api.gowu.net/v1/enterprise/org/members/{userId}?by=userId" \2  -H "x-app-key: $GOWU_APP_KEY" \3  -H "x-timestamp: $TS" \4  -H "x-nonce: $NONCE" \5  -H "x-sign-version: 2" \6  -H "x-signature: $SIG" \7  -H "x-open-user: u-001"

返回示例

1{2  "ok": true,3  "lots": [4    {5      "id": "string",6      "name": "string",7      "theme": "string",8      "themeLabel": "string",9      "amount": 0,10      "remaining": 0,11      "grantedAt": "string",12      "expiresAt": "string"13    }14  ],15  "offboardRecord": [16    {17      "lotId": "string",18      "name": "string",19      "amount": 0,20      "at": "string"21    }22  ]23}

#停用 / 恢复员工

POST/v1/enterprise/org/members/{userId}

停用 / 恢复员工(带 ?by=userId 时路径里放你的用户 ID)

鉴权用户态

suspend 停用(额度保留,可恢复)· reactivate 恢复 · offboard 离职(未用额度退回企业)· set-role 改角色(role 为 admin 或 member)。不能对自己操作;owner 不能直接停用或离职,需先交接。

路径参数

字段类型必填说明
accountIdstring是员工的平台账号 id;带 ?by=userId 时为你的用户 ID

查询参数

字段类型必填说明
bystring否传 userId 时,路径里放你自己的用户 ID。可选值:userId

请求体application/json

字段类型必填说明
actionstring是可选值:suspend / reactivate / offboard / set-role
reasonstring否offboard 时可填
rolestring否set-role 时必填。可选值:admin / member

返回字段

字段类型说明
okboolean
rolestringset-role 时返回
resultobjectoffboard 时返回
result.lotsinteger
result.amountnumber
result.legacynumber

错误

  • 400 SELF 不能对自己操作 / OWNER_LOCKED / LAST_MANAGER / NOT_FOUND,或 message 说明的状态不允许
  • 404 资源不存在,或不归属你的 appKey / 当前用户

调用示例

1curl -X POST "https://api.gowu.net/v1/enterprise/org/members/{userId}?by=userId" \2  -H "x-app-key: $GOWU_APP_KEY" \3  -H "x-timestamp: $TS" \4  -H "x-nonce: $NONCE" \5  -H "x-sign-version: 2" \6  -H "x-signature: $SIG" \7  -H "x-open-user: u-001" \8  -H "content-type: application/json" \9  -d '{"action":"suspend"}'

返回示例

1{2  "ok": true,3  "role": "string",4  "result": {5    "lots": 0,6    "amount": 0,7    "legacy": 08  }9}

#签到规则、发放默认有效期等企业级设置

GETPATCH/v1/enterprise/org/points-settings

鉴权用户态

出现在员工福利 · 福豆任务、签到与生日

GET

企业额度设置

effective 生效值;overrides 企业自己设过的项(null = 跟随平台);platform 平台默认。

返回字段19 个,点击展开
字段类型说明
okboolean
effectiveobject
effective.checkinEnabledboolean
effective.checkinDailyAmountnumber
effective.checkinStreakDaysnumber
effective.checkinStreakBonusnumber
effective.pointsExpiryDaysnumber发放默认有效期(天),1–90
overridesobject
overrides.checkinEnabledboolean
overrides.checkinDailyAmountnumber
overrides.checkinStreakDaysnumber
overrides.checkinStreakBonusnumber
overrides.pointsExpiryDaysnumber发放默认有效期(天),1–90
platformobject
platform.checkinEnabledboolean
platform.checkinDailyAmountnumber
platform.checkinStreakDaysnumber
platform.checkinStreakBonusnumber
platform.pointsExpiryDaysnumber发放默认有效期(天),1–90

PATCH

修改企业额度设置

请求体application/json · 只传要改的项;显式传 null = 退回跟随平台默认

字段类型必填说明
checkinEnabledboolean否可能为 null
checkinDailyAmountnumber否≥ 1,≤ 10000。可能为 null
checkinStreakDaysnumber否≥ 2,≤ 60。可能为 null
checkinStreakBonusnumber否≥ 0,≤ 100000。可能为 null
pointsExpiryDaysnumber否≥ 1,≤ 90。可能为 null
返回字段19 个,点击展开
字段类型说明
okboolean
effectiveobject
effective.checkinEnabledboolean
effective.checkinDailyAmountnumber
effective.checkinStreakDaysnumber
effective.checkinStreakBonusnumber
effective.pointsExpiryDaysnumber发放默认有效期(天),1–90
overridesobject
overrides.checkinEnabledboolean
overrides.checkinDailyAmountnumber
overrides.checkinStreakDaysnumber
overrides.checkinStreakBonusnumber
overrides.pointsExpiryDaysnumber发放默认有效期(天),1–90
platformobject
platform.checkinEnabledboolean
platform.checkinDailyAmountnumber
platform.checkinStreakDaysnumber
platform.checkinStreakBonusnumber
platform.pointsExpiryDaysnumber发放默认有效期(天),1–90

错误

  • 400 参数不合法

调用示例

1curl -X GET "https://api.gowu.net/v1/enterprise/org/points-settings" \2  -H "x-app-key: $GOWU_APP_KEY" \3  -H "x-timestamp: $TS" \4  -H "x-nonce: $NONCE" \5  -H "x-sign-version: 2" \6  -H "x-signature: $SIG" \7  -H "x-open-user: u-001"

返回示例

1{2  "ok": true,3  "effective": {4    "checkinEnabled": true,5    "checkinDailyAmount": 0,6    "checkinStreakDays": 0,7    "checkinStreakBonus": 0,8    "pointsExpiryDays": 09  },10  "overrides": {11    "checkinEnabled": true,12    "checkinDailyAmount": 0,13    "checkinStreakDays": 0,14    "checkinStreakBonus": 0,15    "pointsExpiryDays": 016  },17  "platform": {18    "checkinEnabled": true,19    "checkinDailyAmount": 0,20    "checkinStreakDays": 0,21    "checkinStreakBonus": 0,22    "pointsExpiryDays": 023  }24}

#员工消耗记录与汇总

GET/v1/enterprise/org/consumption

员工消耗记录与汇总(按人、时间筛选)

鉴权用户态可选

可选。全体员工的消耗侧流水:下单扣减,以及取消、退款、建单失败的退回(用 direction 区分)。summary 跟随当前筛选条件,不是全量。新的在前。

查询参数

字段类型必填说明
accountIdstring否只看某个员工(平台账号 id)
fromstring(date)否起始日期 YYYY-MM-DD(含)
tostring(date)否截止日期 YYYY-MM-DD(含)
kindstring否只看某一类;不传 = 四类都要。可选值:order / order_cancel / refund / order_rollback
pageinteger否默认 1。≥ 1
pageSizeinteger否上限 1000,供导出分批拉取。默认 20。≥ 1,≤ 1000
返回字段24 个,点击展开
字段类型说明
okboolean
totalinteger
pageinteger
pageSizeinteger
summaryobject
summary.spentnumber下单扣减合计
summary.refundednumber各种退回合计
summary.netnumber净消耗 = spent − refunded,不小于 0
summary.peopleinteger有消耗的人数
summary.ordersinteger下单笔数
itemsobject[]
items[].accountIdstring
items[].namestring姓名,没有则昵称或手机号
items[].phonestring
items[].departmentNamestring
items[].kindstring可选值:order / order_cancel / refund / order_rollback
items[].kindLabelstring
items[].amountnumber恒为正数,方向看 direction
items[].directionstring可选值:out / in
items[].outOrderIdstring
items[].bizOrderIdstring订单还没建成时为空
items[].orderStatusinteger
items[].remarkstring
items[].createdAtstring

调用示例

1curl -X GET "https://api.gowu.net/v1/enterprise/org/consumption" \2  -H "x-app-key: $GOWU_APP_KEY" \3  -H "x-timestamp: $TS" \4  -H "x-nonce: $NONCE" \5  -H "x-sign-version: 2" \6  -H "x-signature: $SIG" \7  -H "x-open-user: u-001"

返回示例

1{2  "ok": true,3  "total": 0,4  "page": 0,5  "pageSize": 0,6  "summary": {7    "spent": 0,8    "refunded": 0,9    "net": 0,10    "people": 0,11    "orders": 012  },13  "items": [14    {15      "accountId": "string",16      "name": "string",17      "phone": "string",18      "departmentName": "string",19      "kind": "order",20      "kindLabel": "string",21      "amount": 0,22      "direction": "out",23      "outOrderId": "string",24      "bizOrderId": "string",25      "orderStatus": 0,26      "remark": "string",27      "createdAt": "string"28    }29  ]30}

#近期生日员工

GET/v1/enterprise/org/birthdays

近期生日员工(?range=today|week|month),发生日福利用

鉴权用户态适用 员工福利可选

出现在员工福利 · 福豆任务、签到与生日

可选。按月日匹配(不看年份)列出近期过生日的员工;?missing=1 改为返回还没登记生日的员工名单。生日用「修改员工资料」接口登记。

查询参数

字段类型必填说明
rangestring否可选值:today / week / month。默认 "today"
missingstring否传 1 返回缺生日名单(此时忽略 range,响应不带 range)。可选值:1

返回字段

字段类型说明
okboolean
rangestring
itemsobject[]
items[].accountIdstring
items[].namestring
items[].phonestring
items[].birthdaystring缺生日名单不带
items[].daysUntilinteger距生日还有几天,今天为 0;缺生日名单不带

调用示例

1curl -X GET "https://api.gowu.net/v1/enterprise/org/birthdays" \2  -H "x-app-key: $GOWU_APP_KEY" \3  -H "x-timestamp: $TS" \4  -H "x-nonce: $NONCE" \5  -H "x-sign-version: 2" \6  -H "x-signature: $SIG" \7  -H "x-open-user: u-001"

返回示例

1{2  "ok": true,3  "range": "string",4  "items": [5    {6      "accountId": "string",7      "name": "string",8      "phone": "string",9      "birthday": "string",10      "daysUntil": 011    }12  ]13}

#部门管理

GETPOSTPUTDELETE/v1/enterprise/org/departments

鉴权用户态可选

GET

部门列表

返回字段

字段类型说明
okboolean
itemsobject[]
items[].idstring
items[].namestring
items[].sortnumber
items[].memberCountinteger
items[].createdAtstring

POST

新建部门

请求体application/json

字段类型必填说明
namestring是
sortnumber否默认 0

返回字段

字段类型说明
okboolean
idstring

错误

  • 400 操作失败,message 说明原因(部分情况不带 code)

PUT

修改部门

请求体application/json

字段类型必填说明
idstring是
namestring否
sortnumber否

返回字段

字段类型说明
okboolean例:true

错误

  • 404 资源不存在,或不归属你的 appKey / 当前用户

DELETE

删除部门

部门下还有员工时不能删。

查询参数

字段类型必填说明
idstring是部门 id

返回字段

字段类型说明
okboolean例:true

错误

  • 400 操作失败,message 说明原因(部分情况不带 code)

调用示例

1curl -X GET "https://api.gowu.net/v1/enterprise/org/departments" \2  -H "x-app-key: $GOWU_APP_KEY" \3  -H "x-timestamp: $TS" \4  -H "x-nonce: $NONCE" \5  -H "x-sign-version: 2" \6  -H "x-signature: $SIG" \7  -H "x-open-user: u-001"

返回示例

1{2  "ok": true,3  "items": [4    {5      "id": "string",6      "name": "string",7      "sort": 0,8      "memberCount": 0,9      "createdAt": "string"10    }11  ]12}

#部门预算

GETPOSTDELETE/v1/enterprise/org/budgets

鉴权用户态可选

GET

预算列表 / 预算看板

带 dashboard=<期间> 返回该期间的预算执行看板(lines + totals);否则返回预算列表,可用 period 筛选。

查询参数

字段类型必填说明
periodstring否如 2026 / 2026-Q3 / 2026-09
dashboardstring否看板期间,格式同 period
返回字段29 个,点击展开
字段类型说明
okboolean
itemsobject[]
items[].idstring
items[].periodKindstring可选值:year / quarter / month
items[].periodstring
items[].categorystring
items[].departmentIdstring
items[].amountnumber
items[].alertPctinteger
items[].overspendPolicystring可选值:allow / block
periodstring
linesobject[]
lines[].idstring
lines[].periodKindstring可选值:year / quarter / month
lines[].periodstring
lines[].categorystring
lines[].departmentIdstring
lines[].amountnumber
lines[].alertPctinteger
lines[].overspendPolicystring可选值:allow / block
lines[].grantednumber
lines[].usednumber
lines[].remainingnumber
lines[].ratePctnumber
lines[].alertstring可选值:none / warn / over
totalsobject
totals.amountnumber
totals.grantednumber
totals.usednumber

错误

  • 400 操作失败,message 说明原因(部分情况不带 code)

POST

设置预算

按 期间 + 类目 + 部门 新建或覆盖。

请求体application/json

字段类型必填说明
periodstring是2026 / 2026-Q3 / 2026-09
categorystring否福利类型 key;空 = 不分类目
departmentIdstring否空 = 不分部门
amountinteger是≥ 0
alertPctinteger否默认 80。≥ 1,≤ 100
overspendPolicystring否可选值:allow / block。默认 "allow"

返回字段

字段类型说明
okboolean
idstring

错误

  • 400 操作失败,message 说明原因(部分情况不带 code)

DELETE

删除预算

查询参数

字段类型必填说明
idstring是预算 id

返回字段

字段类型说明
okboolean例:true

错误

  • 404 资源不存在,或不归属你的 appKey / 当前用户

调用示例

1curl -X GET "https://api.gowu.net/v1/enterprise/org/budgets" \2  -H "x-app-key: $GOWU_APP_KEY" \3  -H "x-timestamp: $TS" \4  -H "x-nonce: $NONCE" \5  -H "x-sign-version: 2" \6  -H "x-signature: $SIG" \7  -H "x-open-user: u-001"

返回示例

1{2  "ok": true,3  "items": [4    {5      "id": "string",6      "periodKind": "year",7      "period": "string",8      "category": "string",9      "departmentId": "string",10      "amount": 0,11      "alertPct": 0,12      "overspendPolicy": "allow"13    }14  ],15  "period": "string",16  "lines": [17    {18      "id": "string",19      "periodKind": "year",20      "period": "string",21      "category": "string",22      "departmentId": "string",23      "amount": 0,24      "alertPct": 0,25      "overspendPolicy": "allow",26      "granted": 0,27      "used": 0,28      "remaining": 0,29      "ratePct": 0,30      "alert": "none"31    }32  ],33  "totals": {34    "amount": 0,35    "granted": 0,36    "used": 037  }38}