Authoritative Tutorial on the Kingdee Cloud Skylight Payment Voucher Query Interface (ExecuteBillQuery / AP_PAYBILL)
What This Interface Solves
In Kingdee Cloud Skylight × DingTalk integration scenarios, the payment voucher carries the core role of payables, payment approval, fund flow, and reconciliation. This interface incrementally pulls payment voucher master data (with entry-level details and related modification info) from Kingdee Cloud Skylight into DingTalk or a middle platform, enabling DingTalk approval forms to be linked back to Kingdee vouchers, payables management, financial reconciliation, and fund-flow visualization.
Interface Capability Overview
- API: ExecuteBillQuery (Kingdee Cloud Skylight universal document query, POST)
- FormId:
AP_PAYBILL(payment voucher form) - Strategy type: QUERY (read-only, no writes to target)
- Primary key field:
FPAYBILLENTRY_FEntryID(entry-level PK; metadataidpoints here) - Number field:
FBillNo(business number; metadatanumberpoints here) - Incremental condition:
FCreateDate>='{{LAST_SYNC_TIME|dateTime}}'(by creation time) - Pagination:
Limit(max rows),StartRow(offset),TopRowCount(total returned) - Schedule: typically
*/2 9-23 * * *(every 2 minutes, 09:00–23:00) - Authentication: Kingdee Cloud Skylight WebAPI standard auth (account set + user + secret; refer to Kingdee's official protocol)
Typical Field Mapping
| Field | Type | Meaning | Field-Tested Notes |
|---|---|---|---|
FID | string | Voucher header PK | Unique per voucher; one voucher can have many entries |
FPAYBILLENTRY_FEntryID | string | Entry PK | Row-level unique; metadata id MUST be set here, otherwise incremental sync will duplicate |
FBillNo | string | Voucher number | Key for cross-system matching and DingTalk write-back; metadata number MUST be set here |
FDOCUMENTSTATUS | string | Document status | Distinguishes draft/submitted/approved; DingTalk side usually uses this to decide whether to sync |
FWRITTENOFFSTATUS | string | Write-off status | Progress of matching against AP invoices; essential for reconciliation |
FCancelStatus / FCancellerId / FCancelDate | string | Cancellation info | Confirm with business whether to sync; usually recommend filtering |
FCreateDate | string | Creation date | Field used for incremental sync; Kingdee may return with milliseconds—unify format before comparing |
FModifyDate | string | Last modified date | Switch incremental field to this if you need to capture approval/cancellation changes |
FPAYORGID / FSETTLEORGID / FPURCHASEORGID | string | Pay/settle/purchase orgs | All are FNumber codes; remember the org dimension during cross-system mapping |
FCONTACTUNIT / FCONTACTUNITTYPE | string | Contact unit & type | Usually the supplier; sync fails if supplier master data is missing |
FRECTUNIT / FRECTUNITTYPE | string | Receiver unit & type | Actual payee, may differ from contact unit |
FCURRENCYID / FSETTLECUR / FMAINBOOKID | string | Currency / settle currency / book currency | In multi-currency cases, must combine with FEXCHANGERATE, FSETTLERATE, FEXCHANGETYPE for conversion |
FPAYTOTALAMOUNTFOR_H / FREALPAYAMOUNTFOR_H | string | Header payable/actual pay (original currency) | Business currency; do NOT mix with base-currency amounts |
FPAYTOTALAMOUNT_H / FPAYAMOUNT / FREALPAYAMOUNT_H | string | Header payable/pay/actual pay (base currency) | Authoritative for financial reporting |
FPAYAMOUNTFOR | string | Entry payment amount (original currency) | Row-level amount for entry-level reconciliation |
FDATE | string | Business date | Business event date, may be later than FCreateDate |
FBookingDate | string | Expected payment date | Used for cash planning and scheduling |
FTHIRDBILLNO | string | Third-party document number | Key link for DingTalk approval write-back; always carry it in integrations |
FWBSETTLENO | string | Bank settlement number | For reconciliation and bank-receipt matching |
FSOURCESYSTEM | string | Source system | Marks the origin (DingTalk, Guanyi, etc.); useful for traceability |
FSRCBILLNO | string | Source document number | Links upstream docs (PO invoices, payment requests) |
FGYACCOUNTWATERID / FGYSHOPNAME / FGYCUSTOMERID | string | Guanyi integration extension fields | Only meaningful in Guanyi e-commerce scenarios |
FPRESETTEXT1/2, FPRESETBASE1/2, FPRESETASSISTANT1/2 | string | Extension fields | Customer-specific extensions, enable as needed |
How to Configure on Qeasy Cloud
On the Qeasy Cloud Data Integration Platform, this interface is usually built with the Kingdee Cloud Skylight adapter + QUERY strategy combination:
- Data source connection: Choose Kingdee Cloud Skylight as the data source in Qeasy Cloud and fill in the connection info such as
ACCTID(account set),username,appSecret, andserverUrl(refer to the platform wizard for details). - Strategy type: Create a new strategy and choose
QUERY_ONLY, with Kingdee Cloud Skylight as the source and DingTalk (or the platform itself) as the target. - Interface selection: In the adapter dropdown pick
ExecuteBillQueryand setFormIdtoAP_PAYBILL. - Metadata configuration:
idfield:FPAYBILLENTRY_FEntryIDnumberfield:FBillNo- Incremental field:
FCreateDate, FilterString template:FCreateDate>='{{LAST_SYNC_TIME|dateTime}}'
- Field mapping: The Qeasy Cloud field mapper will automatically fetch the field list from metadata; drag Kingdee
Fxxxfields onto the target-side conceptual fields likepayment_voucher_no,payee_code, etc. In multi-currency scenarios, use the built-in "rate conversion" function. - Scheduling: Set crontab to
*/2 9-23 * * *; the Qeasy Cloud scheduler picks up the incremental watermark automatically and resumes from breakpoints. - Target write: When syncing to DingTalk, route through DingTalk Approval/Log apps and use
FTHIRDBILLNOas the link key to write back to the corresponding approval.
Cross-Scenario Field Notes
idMUST be the entry-level PK: HeaderFIDrepeats across entries and breaks incremental sync; onlyFPAYBILLENTRY_FEntryIDguarantees row uniqueness.FBillNois the lifeline of cross-system linking: DingTalk approval write-back, reconciliation, and document jump all depend on it—set asnumberand create a unique index on the target side.FTHIRDBILLNOis the bridge between Kingdee and DingTalk: DingTalk writes this field after approval, so subsequent Kingdee queries can reverse-link to the approval and close the loop.- Choose between two incremental fields:
FCreateDatesuits "first full, then new";FModifyDatesuits capturing approvals/cancellations. In real projects we usually run both in parallel—new vouchers viaFCreateDate, updates viaFModifyDate. - Multi-currency must be handled in pairs: Never mix original-currency (
_FORsuffix) with base-currency (_Hno-suffix) amounts. Always carry rate fields (FEXCHANGERATE,FSETTLERATE) for cross-currency reconciliation or amounts diverge by orders of magnitude. - Never drop the org dimension:
FPAYORGID,FSETTLEORGID, andFPURCHASEORGIDare often different (especially in multi-org groups); always filter by pay-org for payable or cash-pooling scenarios.
Pitfall Playbook
- Pitfall: Using
FIDas PK causes duplicate rows—multiple entries share the sameFIDand are skipped as "already exists." Fix: ChangeidtoFPAYBILLENTRY_FEntryIDand add a unique constraint on the target side. - Pitfall:
FCreateDatetime-zone/format mismatch—Kingdee returns time strings in multiple formats (yyyy-MM-dd HH:mm:ssor with milliseconds), and direct string comparison drops records. Fix: Use the Qeasy Cloud field mapper'sdateTimefunction to normalize toyyyy-MM-dd HH:mm:ssbefore writing LAST_SYNC_TIME. - Pitfall: Empty
FTHIRDBILLNOblocks DingTalk write-back—older vouchers have no third-party number, so DingTalk approvals can't be matched. Fix: On the DingTalk side, fall back toFBillNofirst, then tryFTHIRDBILLNO; log the null rate so the business can backfill. - Pitfall: Multi-currency reconciliation amounts mismatch—only original OR base currency was synced, and rates were lost. Fix: Sync original, base, and rate fields together; do a "amount × rate" cross-check on the target side.
- Pitfall: Cancelled vouchers get pushed out—
FCancelStatus='B'vouchers are pushed to DingTalk as normal payments. Fix: AppendFCancelStatus<>'B'in FilterString, or filter before writing on the target side.
When to Use
Suits Kingdee Cloud Skylight × DingTalk/Guanyi/custom middleware integration with minute-level incremental sync of payment vouchers and closed-loop linking to external approval/reconciliation systems. Not suitable for write-back into Kingdee (use SaveBill-class interfaces for that), nor for purely non-Kingdee financial system integrations.