Qeasy Cloud
Get Started
POSThttps://{数据中心地址}/k3cloud/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.ExecuteBillQuery.common.kdsvcLoginByAppSecret 会话

Generic Bill Query (ExecuteBillQuery · Sales Order)

金蝶云星空单据通用查询接口,通过 FormId + FieldKeys + FilterString 以类 SQL 方式分页拉取销售订单等任意单据数据,是订单同步的核心取数接口。

## Overview ExecuteBillQuery is the most versatile read API in Kingdee K3 Cloud: given a bill FormId, a comma-separated FieldKeys list and a SQL-like FilterString, it returns bill data page by page. For sales orders the FormId is SAL_SaleOrder; other common FormIds include PUR_PurchaseOrder (purchase order), SAL_OUTSTOCK (sales delivery) and AR_RECEIVABLE (receivable). ### Request essentials 1. Authenticate first with LoginByAppSecret and replay the session cookie on this call. 2. FieldKeys is a comma-separated list of field identifiers; entry-row fields need their entity prefix, e.g. FSaleOrderEntry_FMaterialId.FNumber. 3. For incremental sync, filter on the bill modify time (FModifyDate >= last watermark) and typically require FDocumentStatus = 'C' (approved). 4. Page with StartRow and Limit (keep Limit at or below 2000 rows); when the returned row count is smaller than Limit you have reached the last page. 5. Leave TopRowCount at 0 so pagination is fully controlled by StartRow/Limit. ### Integration advice When Qeasy syncs Kingdee sales orders it uses FModifyDate as the incremental cursor and composes an idempotency key from FBillNo plus the entry-row sequence before writing to downstream systems, preventing duplicate vouchers in the target. ### Troubleshooting A FieldKeys entry that does not exist on the bill fails the whole call, so validate identifiers with the online OpenAPI debugger in the Kingdee console first. String literals inside FilterString need doubled single quotes. For secondary-development custom fields, use the identifiers from the BOS designer, and make sure the third-party application has been granted query permission on that bill type — missing grants surface as empty results rather than errors.

Code examples

curl
curl -X POST "https://demo.ik3cloud.com/k3cloud/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.ExecuteBillQuery.common.kdsvc" \
  -H "Content-Type: application/json" \
  -b cookies.txt \
  -d '{"FormId":"SAL_SaleOrder","FieldKeys":"FBillNo,FCustId.FNumber,FSaleOrderEntry_FMaterialId.FNumber,FSaleOrderEntry_FQty,FModifyDate","FilterString":"FModifyDate >= ''2026-06-01 00:00:00''","OrderString":"FModifyDate ASC","StartRow":0,"Limit":2000,"TopRowCount":0}'

Error codes

CodeMessageMeaning
500ResponseStatus.ErrorCode=500查询执行失败,常见原因是 FieldKeys 字段标识错误或 FilterString 语法错误
-1会话失效Cookie 会话过期,需重新调用 LoginByAppSecret 登录