Syncing Feishu Payment Requests to Kingdee Cloud Skylight: A Practical Guide Using the Daily Payment Request Form
What This Strategy Solves
At one retail client, expense reimbursement and daily payment approvals live in Feishu, while financial bookkeeping sits in Kingdee Cloud Skylight. After an approval finishes, business users want the result to automatically become a payment voucher in Kingdee, so finance no longer chases anyone for paperwork at month-end. This specific strategy takes the daily payment request form from Feishu, splits it by payment type (daily expense, procurement, payroll/tax), and writes the corresponding payment voucher into Kingdee. The value is closing the loop between approval and bookkeeping.
Data Flow and Field Mapping
Data flows from a Feishu approval instance into a Kingdee payment voucher, passing through Qeasy for field renaming, organization and bill-type code translation, and header/line-item splitting.
| Business meaning | Feishu field | Middle-layer handling | Kingdee field |
|---|---|---|---|
| Bill number | serial_number | Pass-through | FBillNo |
| Bill type | Application type text | CASE WHEN mapped to code | FBillTypeID |
| Business date | end_time (ms timestamp) | FROM_UNIXTIME, left 10 chars → date | FDATE |
| Settlement org | Org text | SUBSTRING_INDEX before _ | FSETTLEORGID |
| Payer org | Org text | SUBSTRING_INDEX before _ | FPAYORGID |
| Currency | Currency field | Direct mapping | FCURRENCYID |
| Line items | Detail widget | Split into entry rows | FPAYBILLENTRY |
How to Configure in Qeasy
In the Qeasy data integration platform, this strategy belongs to the Feishu → Kingdee Cloud Skylight EXECUTE write-back chain. There are four key configuration points.
- Source configuration: pick Feishu as the source platform, use the
/open-apis/approval/v4/instancesAPI, takeserial_numberas the primary key, and turn onautoFillResponseso response fields are parsed automatically without manual modeling. - Incremental window: pull by
start_time/end_timeon the source side. Bind to a relative variable such as{{CURRENT_TIME}}000rather than hard-coded values. - Target configuration: pick Kingdee Cloud Skylight as the target, call
batchSave, and routeFBillNothroughidCheckto avoid duplicate submissions. - Centralized code mapping: text-to-code conversions for bill type, organization, and currency should live in Qeasy's central code-mapping table rather than buried in individual field expressions. A common pattern we use with Qeasy clients is keeping all encoding lookups in one place so adding a new bill type later only touches one mapping.
Implementation Steps
We roll out this sync in three phases to keep the pace manageable.
- Phase 1: backfill the incremental starting point. In Qeasy, run a one-off 7-day retrospective to pull all approved Feishu requests that have not yet produced Kingdee vouchers. Run the backfill script separately from the regular schedule so dirty data never enters the daily flow.
- Phase 2: switch on full incremental flow. Once the backfill is reconciled, switch the strategy to the production schedule. The Feishu side polls near real-time (minutes-level) for completed approval events, and the Kingdee side writes through
batchSave. - Phase 3: schedule cadence and rerun mechanism. For daily payment request forms we recommend a 5–10 minute interval, plus a low-traffic full-pull at night as a safety net. Configure three retries on the Qeasy side and use
FBillNoas the idempotency key so retries never produce duplicate vouchers.
Pitfalls We Have Seen
- Timestamp units do not match. Feishu returns milliseconds while Kingdee
FDATEexpects a second-precision string. The fix isFROM_UNIXTIME(LEFT(...,10),'%Y-%m-%d %H:%i:%s'). Getting the unit wrong shifts dates by about 40 years. - Org fields carry suffixes. Feishu org fields look like
xxx_code; you mustSUBSTRING_INDEX(..., '_', 1)or Kingdee will reject with "organization does not exist." - No fallback in the bill-type branch. When business adds a new payment type that CASE WHEN does not cover, Kingdee falls back to a default type and books the wrong account. Give an explicit ELSE branch and wire up an exception alert.
- Header and lines processed together. The Feishu detail widget is a single JSON blob; Kingdee needs it split into multiple entry rows. A pattern we often apply on Qeasy is two-phase processing: persist the header first, then loop and persist the lines, so each step has its own readable log.
idCheckleft disabled in production. It is tempting to turn it off during debugging to retry freely, but if you forget to re-enable it, network jitter will produce duplicate vouchers—very painful during reconciliation.
When to Use and When Not to
Use when: approvals live in Feishu, bookkeeping lives in Kingdee Cloud Skylight, and approval results can map cleanly to voucher master data. Fits small-to-mid retail or service companies with stable field definitions and infrequent new bill types.
Do not use when: the approval flow needs complex budget reservation or contract settlement pre-processing; Kingdee is required to go through a workflow instead of direct EXECUTE; or the approval form structure changes too often and field semantics are unstable.