格物 开放 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}

#企业购月结账单

GET/v1/enterprise/org/egp-bills

企业购月结账单(?billPeriod=2026-06)

鉴权用户态

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

企业购出账落下来的月结账单,只含本企业的。amount 单位元,amountCents 单位分。invoice 为空表示还没按这张账申请开票。billPeriod 按账单开始时间前缀筛,如 2026-06。

查询参数

字段类型必填说明
billPeriodstring否账期前缀,如 2026-06
pageinteger否页码。默认 1。≥ 1
pageSizeinteger否每页条数。默认 20。≥ 1,≤ 50
返回字段25 个,点击展开
字段类型说明
okboolean
totalinteger
pageinteger
pageSizeinteger
itemsobject[]
items[].billNostring
items[].amountstring结算金额,元
items[].amountCentsinteger结算金额,分
items[].billCycleinteger
items[].billCycleTypestringmonth / day
items[].billStartDatestring
items[].billEndDatestring
items[].billGenDatestring
items[].settleStartDatestring
items[].settleEndDatestring
items[].statusstringgenerated 已出账 / confirmed 已确认
items[].confirmedAtstring
items[].invoiceobject
items[].invoice.idstring开票申请 id,也是发给企业购的幂等号
items[].invoice.statusstringpending / applied / issued / failed / rejected
items[].invoice.upstreamApplyNostring
items[].invoice.upstreamInvoiceNosstring发票号码,多张逗号分隔
items[].invoice.fileUrlstring
items[].invoice.upstreamErrorstring
items[].invoice.subOrderCountinteger这次申请包含的子单数

调用示例

1curl -X GET "https://api.gowu.net/v1/enterprise/org/egp-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  "total": 0,4  "page": 0,5  "pageSize": 0,6  "items": [7    {8      "billNo": "string",9      "amount": "string",10      "amountCents": 0,11      "billCycle": 0,12      "billCycleType": "string",13      "billStartDate": "string",14      "billEndDate": "string",15      "billGenDate": "string",16      "settleStartDate": "string",17      "settleEndDate": "string",18      "status": "string",19      "confirmedAt": "string",20      "invoice": {21        "id": "string",22        "status": "string",23        "upstreamApplyNo": "string",24        "upstreamInvoiceNos": "string",25        "fileUrl": "string",26        "upstreamError": "string",27        "subOrderCount": 028      }29    }30  ]31}

#月结账单的开票状态与发票文件

GET/v1/enterprise/org/egp-bills/{billNo}/invoice

鉴权用户态

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

还没申请时 invoice 为空。账单不属于本企业时 404。

路径参数

字段类型必填说明
billNostring是企业购账单号
返回字段30 个,点击展开
字段类型说明
okboolean
billobject
bill.billNostring
bill.amountstring结算金额,元
bill.amountCentsinteger结算金额,分
bill.billCycleinteger
bill.billCycleTypestringmonth / day
bill.billStartDatestring
bill.billEndDatestring
bill.billGenDatestring
bill.settleStartDatestring
bill.settleEndDatestring
bill.statusstringgenerated 已出账 / confirmed 已确认
bill.confirmedAtstring
bill.invoiceobject
bill.invoice.idstring开票申请 id,也是发给企业购的幂等号
bill.invoice.statusstringpending / applied / issued / failed / rejected
bill.invoice.upstreamApplyNostring
bill.invoice.upstreamInvoiceNosstring发票号码,多张逗号分隔
bill.invoice.fileUrlstring
bill.invoice.upstreamErrorstring
bill.invoice.subOrderCountinteger这次申请包含的子单数
invoiceobject
invoice.idstring开票申请 id,也是发给企业购的幂等号
invoice.statusstringpending / applied / issued / failed / rejected
invoice.upstreamApplyNostring
invoice.upstreamInvoiceNosstring发票号码,多张逗号分隔
invoice.fileUrlstring
invoice.upstreamErrorstring
invoice.subOrderCountinteger这次申请包含的子单数

错误

  • 404 BILL_NOT_FOUND

调用示例

1curl -X GET "https://api.gowu.net/v1/enterprise/org/egp-bills/{billNo}/invoice" \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  "bill": {4    "billNo": "string",5    "amount": "string",6    "amountCents": 0,7    "billCycle": 0,8    "billCycleType": "string",9    "billStartDate": "string",10    "billEndDate": "string",11    "billGenDate": "string",12    "settleStartDate": "string",13    "settleEndDate": "string",14    "status": "string",15    "confirmedAt": "string",16    "invoice": {17      "id": "string",18      "status": "string",19      "upstreamApplyNo": "string",20      "upstreamInvoiceNos": "string",21      "fileUrl": "string",22      "upstreamError": "string",23      "subOrderCount": 024    }25  },26  "invoice": {27    "id": "string",28    "status": "string",29    "upstreamApplyNo": "string",30    "upstreamInvoiceNos": "string",31    "fileUrl": "string",32    "upstreamError": "string",33    "subOrderCount": 034  }35}

#按这张月结账单向企业购申请开票

POST/v1/enterprise/org/egp-bills/{billNo}/invoice

按这张月结账单向企业购申请开票(同账幂等)

鉴权用户态

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

把这张企业购月结账单里尚未按订单开过票的子单,一次提交给企业购开票。同一张账重复提交返回同一条申请,不会开出第二张票。抬头用企业资料里的那份,企业购接口不接收抬头。企业购账单查询没有返回子单明细时返回 BILL_LINES_UNAVAILABLE。

路径参数

字段类型必填说明
billNostring是企业购账单号

请求体application/json

字段类型必填说明
remarkstring否发票备注

返回字段申请已落库。上游受理失败时 ok=false、invoice.status=failed,用同一账单号再提交即可重试

字段类型说明
okboolean
codestring
messagestring
invoiceobject
invoice.idstring开票申请 id,也是发给企业购的幂等号
invoice.statusstringpending / applied / issued / failed / rejected
invoice.upstreamApplyNostring
invoice.upstreamInvoiceNosstring发票号码,多张逗号分隔
invoice.fileUrlstring
invoice.upstreamErrorstring
invoice.subOrderCountinteger这次申请包含的子单数

错误

  • 400 ORG_INVOICE_INCOMPLETE 企业抬头或税号未完善 / BILL_LINES_UNAVAILABLE 账单没有子单明细 / BILL_ORDERS_ALREADY_INVOICED 子单都已按订单开过票
  • 404 BILL_NOT_FOUND

调用示例

1curl -X POST "https://api.gowu.net/v1/enterprise/org/egp-bills/{billNo}/invoice" \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  "code": "string",4  "message": "string",5  "invoice": {6    "id": "string",7    "status": "string",8    "upstreamApplyNo": "string",9    "upstreamInvoiceNos": "string",10    "fileUrl": "string",11    "upstreamError": "string",12    "subOrderCount": 013  }14}

#某月确认收货、还没开票的现金单

GET/v1/enterprise/org/invoiceable-orders

某月确认收货、还没开票的现金单(?month=2026-10)

鉴权用户态

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

员工在企业购收银台付现金的订单不进企业购月结账单,按月统一开票时用这条查。返回 month 这个月确认收货、还没开过票的现金单,按订单分组(按确认收货时间先后),每单只列还能开的子单。月份按企业购记的确认收货时间(买家确认或超时自动确认)算;订单取消、整单退款、子单有售后进行中或已退款的不在里面;已经按订单、按月结账单或按子单申请过开票的子单也不在里面。summary 是整个月的合计,不随分页变。金额单位分。 企业采购的管理员与采购员能调(负责开票的人不必是管理员),普通员工返回 NOT_ORDER_OPERATOR。

查询参数

字段类型必填说明
monthstring是月份,如 2026-10
pageinteger否页码(按订单分页)。默认 1。≥ 1
pageSizeinteger否每页订单数。默认 20。≥ 1,≤ 100
返回字段25 个,点击展开
字段类型说明
okboolean
monthstring
summaryobject
summary.orderCountinteger
summary.subOrderCountinteger
summary.amountCentsinteger
totalinteger订单数
pageinteger
pageSizeinteger
itemsobject[]
items[].bizOrderIdstring企业购订单号
items[].outOrderIdstring
items[].receivedAtstring企业购记的确认收货时间(北京时间 yyyy-MM-dd HH:mm:ss)
items[].cashCentinteger员工付的现金,分
items[].postFeeCentsinteger运费,分
items[].buyerNamestring下单员工的姓名或昵称
items[].buyerUserIdstring下单员工在你系统里的用户 ID(x-open-user);不是经你的应用下的单不返回
items[].subOrdersobject[]这单里还能开票的子单
items[].subOrders[].subOrderIdstring企业购子单号,提交开票时传它
items[].subOrders[].itemIdstring
items[].subOrders[].skuIdstring
items[].subOrders[].itemNamestring
items[].subOrders[].buyAmountinteger
items[].subOrders[].itemPriceCentsinteger单价,分
items[].subOrders[].amountCentsinteger单价 × 数量,分(不含运费)

错误

  • 400 BAD_MONTH month 格式不对

调用示例

1curl -X GET "https://api.gowu.net/v1/enterprise/org/invoiceable-orders" \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  "month": "string",4  "summary": {5    "orderCount": 0,6    "subOrderCount": 0,7    "amountCents": 08  },9  "total": 0,10  "page": 0,11  "pageSize": 0,12  "items": [13    {14      "bizOrderId": "string",15      "outOrderId": "string",16      "receivedAt": "string",17      "cashCent": 0,18      "postFeeCents": 0,19      "buyerName": "string",20      "buyerUserId": "string",21      "subOrders": [22        {}23      ]24    }25  ]26}

#挑一批子单向企业购申请开票

POST/v1/enterprise/org/invoices

挑一批子单向企业购申请开票(idempotencyKey 幂等)

鉴权用户态

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

把从 GET /v1/enterprise/org/invoiceable-orders 里挑的子单一次提交给企业购开票,抬头用企业资料里的那份。一次最多 200 个子单;有一个不能开(不是本企业的、没确认收货、不是现金单、有售后、已开过票)就整批拒,rejected 里逐个列出原因,去掉后重提。子单出自企业不同时期的企业购身份时返回 MIXED_IDENTITY,按下单时间分开提交。 幂等:建议传 idempotencyKey(如你系统里的开票批次号)。同一个键重复提交返回同一条申请,不会开出第二张票;上游受理失败(ok=false、invoice.status=failed)时用同一个键重提即可重试。

请求体application/json

字段类型必填说明
subOrderIdsstring[]是企业购子单号。最多 200 项
idempotencyKeystring否幂等键,建议传你系统里的开票批次号。最长 128
remarkstring否发票备注
返回字段18 个,点击展开 · 申请已落库。上游受理失败时 ok=false、code=INVOICE_APPLY_FAILED、invoice.status=failed
字段类型说明
okboolean
codestring
messagestring
replayedbooleantrue = 同一个 idempotencyKey 之前提交过,返回的是原来那条
invoiceobject
invoice.idstring开票申请 id
invoice.scopestringbatch = 按子单批量开(现金单);bill = 按月结账单开。可选值:batch / bill
invoice.statusstringpending / applied(开票中)/ issued(已开出)/ failed(失败,可重提)/ rejected
invoice.titlestring发票抬头
invoice.taxNostring
invoice.amountstring金额,元
invoice.billNostringscope=bill 时的账单号
invoice.subOrderIdsstring[]
invoice.upstreamApplyNostring
invoice.upstreamInvoiceNosstring发票号码,多张逗号分隔
invoice.fileUrlstring发票下载地址(开出后才有)
invoice.upstreamErrorstring失败原因
invoice.createdAtstring

错误

  • 400 BAD_REQUEST 没传子单 / TOO_MANY_SUB_ORDERS 超过 200 个 / ORG_INVOICE_INCOMPLETE 企业抬头或税号未完善 / SUB_ORDERS_NOT_INVOICEABLE 有子单不能开(见 rejected)/ MIXED_IDENTITY 子单出自不同企业购身份
  • 409 SUB_ORDERS_OCCUPIED 有子单已在别的开票申请里(见 rejected),刷新列表后重新选

调用示例

1curl -X POST "https://api.gowu.net/v1/enterprise/org/invoices" \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 '{"subOrderIds":["string"]}'

返回示例

1{2  "ok": true,3  "code": "string",4  "message": "string",5  "replayed": true,6  "invoice": {7    "id": "string",8    "scope": "batch",9    "status": "string",10    "title": "string",11    "taxNo": "string",12    "amount": "string",13    "billNo": "string",14    "subOrderIds": [15      "string"16    ],17    "upstreamApplyNo": "string",18    "upstreamInvoiceNos": "string",19    "fileUrl": "string",20    "upstreamError": "string",21    "createdAt": "string"22  }23}

#企业开票申请列表

GET/v1/enterprise/org/invoices

企业开票申请列表(批量开票 / 按账开票)

鉴权用户态

本企业的开票申请(管理员与采购员能调):按子单批量开的(scope=batch)和按月结账单开的(scope=bill),新的在前。开出后带发票号与下载地址。

查询参数

字段类型必填说明
statusstring否按状态筛:pending / applied / issued / failed / rejected
pageinteger否页码。默认 1。≥ 1
pageSizeinteger否每页条数。默认 20。≥ 1,≤ 100
返回字段18 个,点击展开
字段类型说明
okboolean
totalinteger
pageinteger
pageSizeinteger
itemsobject[]
items[].idstring开票申请 id
items[].scopestringbatch = 按子单批量开(现金单);bill = 按月结账单开。可选值:batch / bill
items[].statusstringpending / applied(开票中)/ issued(已开出)/ failed(失败,可重提)/ rejected
items[].titlestring发票抬头
items[].taxNostring
items[].amountstring金额,元
items[].billNostringscope=bill 时的账单号
items[].subOrderIdsstring[]
items[].upstreamApplyNostring
items[].upstreamInvoiceNosstring发票号码,多张逗号分隔
items[].fileUrlstring发票下载地址(开出后才有)
items[].upstreamErrorstring失败原因
items[].createdAtstring

调用示例

1curl -X GET "https://api.gowu.net/v1/enterprise/org/invoices" \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  "items": [7    {8      "id": "string",9      "scope": "batch",10      "status": "string",11      "title": "string",12      "taxNo": "string",13      "amount": "string",14      "billNo": "string",15      "subOrderIds": [16        "string"17      ],18      "upstreamApplyNo": "string",19      "upstreamInvoiceNos": "string",20      "fileUrl": "string",21      "upstreamError": "string",22      "createdAt": "string"23    }24  ]25}

#开票申请详情:状态、发票号与下载地址

GET/v1/enterprise/org/invoices/{id}

鉴权用户态

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

还在开票中(applied)时会向企业购查一次,开出来了直接带发票号与下载地址。不属于本企业时 404。

路径参数

字段类型必填说明
idstring是开票申请 id

返回字段

字段类型说明
okboolean
invoiceobject
invoice.idstring开票申请 id
invoice.scopestringbatch = 按子单批量开(现金单);bill = 按月结账单开。可选值:batch / bill
invoice.statusstringpending / applied(开票中)/ issued(已开出)/ failed(失败,可重提)/ rejected
invoice.titlestring发票抬头
invoice.taxNostring
invoice.amountstring金额,元
invoice.billNostringscope=bill 时的账单号
invoice.subOrderIdsstring[]
invoice.upstreamApplyNostring
invoice.upstreamInvoiceNosstring发票号码,多张逗号分隔
invoice.fileUrlstring发票下载地址(开出后才有)
invoice.upstreamErrorstring失败原因
invoice.createdAtstring

错误

  • 404 INVOICE_NOT_FOUND

调用示例

1curl -X GET "https://api.gowu.net/v1/enterprise/org/invoices/{id}" \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  "invoice": {4    "id": "string",5    "scope": "batch",6    "status": "string",7    "title": "string",8    "taxNo": "string",9    "amount": "string",10    "billNo": "string",11    "subOrderIds": [12      "string"13    ],14    "upstreamApplyNo": "string",15    "upstreamInvoiceNos": "string",16    "fileUrl": "string",17    "upstreamError": "string",18    "createdAt": "string"19  }20}

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

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[].rolestringowner 超级管理员 / admin 管理员 / purchaser 采购员(只在企业采购里有,能操作全公司订单)/ member 普通员工。可选值:owner / admin / purchaser / 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、purchaser 或 member;purchaser 采购员只在企业采购里有,能操作全公司订单,员工福利里设它返回 ROLE_NOT_ALLOWED)。不能对自己操作;owner 不能直接停用或离职,需先交接。

路径参数

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

查询参数

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

请求体application/json

字段类型必填说明
actionstring是可选值:suspend / reactivate / offboard / set-role
reasonstring否offboard 时可填
rolestring否set-role 时必填。可选值:admin / purchaser / 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}