Querying Transfer Orders in Practice: Inventory Transfer Sync from YonBIP to Wangdiantong
What This Strategy Solves
When transfer documents flow between multiple warehouses, the upstream ERP and the downstream retail system often work in silos: a transfer request is issued on one side, while the other side waits for manual entry. The "Querying Transfer Orders" strategy extracts transfer documents from the upstream YonBIP incrementally by time window, and lands them on the Wangdiantong side through the Qeasy data integration platform, keeping both sides in sync and avoiding long-term discrepancies between store stock-outs and upstream accounting.
Data Flow and Field Mapping
The overall flow is YonBIP (source) → Qeasy Integration Platform (middleware) → Wangdiantong (target). The source side is a paginated query API, the target side is a document-write API, and the middleware only performs field remapping and deduplication without persisting business data.
| Dimension | Source (YonBIP query API) | Middleware Handling | Target (Wangdiantong write API) |
|---|---|---|---|
| Document number | code (e.g., DBDD0003) | Passed through as idempotency key | provider_no and other business numbers |
| Pagination | pageSize=100, pageIndex starts at 1 | Loop pagination until an empty page | — |
| Time window | open_vouchdate_begin / open_vouchdate_end | Dynamically composed by scheduler based on last successful time | — |
| Document date | open_vouchdate | Normalized to yyyy-MM-dd HH:mm:ss | Written into business date field |
| Warehouse/Org | inwarehouse and other warehouse codes | Translated via centralized code mapping table | Landed as Wangdiantong-side warehouse code |
| Line items | Nested array (material lines) | Header and body staged: header first, then bulk push of body | Written into line item fields |
In practice, code mapping must be managed centrally, never scattered across scripts; header and body are best split into two steps, as stuffing everything into one large array across public-cloud links tends to drop packets.
How to Configure on Qeasy
In the Qeasy data integration platform's strategy canvas, this strategy is a "query + write" combination. Key configuration points:
- Data source registration: Register the source as YonBIP, fill in its platform identifier and authorization (tenant and credentials are managed by the user side, the platform does not store them); register Wangdiantong as the target.
- Source action: Choose
QUERYtype, point the API to the paginated query interface,method=POST,idCheck=true, take the document number as thenumberfield, and the row-unique key as theidfield. - Target action: Choose
EXECUTEtype, point the API to the supplier/document write interface,method=POST, and use placeholders like{{code}}and{{name}}in the request body to reference source fields. - Field mapping: Source field on the left, target field on the right. Constant fields (such as minimum purchase quantity, arrival cycle, etc.) are hard-coded on the target side, while business fields go through mapping.
- Deduplication and idempotency: Use the document number as the idempotency key, the platform automatically skips records that have already been successfully landed.
- Response parsing: Enable
autoFillResponseto automatically merge paginated results, avoiding hand-written loops in scripts.
Implementation Steps
We typically break a single strategy into three phases:
Phase 1: Determine the incremental starting point
Do not do a full historical backfill on the first run. First, set a business-approved starting point using open_vouchdate_begin (e.g., the last 7 days), confirm the document numbers match on both sides and no fields are missing, then consider extending the window further back.
Phase 2: Full trigger and reconciliation The full trigger is usually executed once during off-peak hours (early morning). After landing, sample 5–10 transfer orders and compare fields one by one between source and target. Differences should be corrected in the mapping table, never patched directly in production data.
Phase 3: Schedule frequency and monitoring
The source strategy's schedule is registered as */10 * * * * in the metadata, i.e., every 10 minutes. We recommend running incremental and full loads on dual tracks: the full load job should have its own independent time window, never concurrent with the incremental job, to avoid pagination cursors interfering with each other. Monitor three indicators — API success rate, average latency, and idempotency hit rate — and alert on any anomaly.
Pitfall Retrospective
- Pagination cursor not persisted:
pageIndexis hard-coded to 1, so data after the second page is never fetched. The safe approach is to write thecodeor max date to storage after each page flip so the job can resume from the breakpoint after an interruption. - Time window condition left empty: To save effort, some teams omit
open_vouchdate_begin/end, causing the first run to pull the entire history and instantly flood the target. Incremental tasks must have a time window — this is a hard rule. - Code mapping scattered everywhere: Warehouse, organization, and customer code translations are hard-coded in scripts, so every change requires a redeployment. On Qeasy, use a centralized mapping table (the platform's built-in lookup transformer) — one change on the business side takes effect across the chain.
- Header and body stuffed together: Putting the body array into the header request body over a long cross-cloud link causes failures that force a full re-run. Staged pushing is the lesson learned.
- Wrong field used as idempotency key: Some teams use the line item
idas the idempotency key, causing the same header to be repeatedly created. Always use the document-level number (e.g.,code) as the idempotency key.
Applicable and Non-applicable Scenarios
Applicable: Multi-organization, multi-warehouse scenarios where upstream ERP transfer/reallocation documents need to be synchronized to downstream retail or WMS systems in near real-time, with stable document numbering.
Non-applicable: Scenarios where the transfer logic itself has custom workflows on both ends and bidirectional writes are required with mutual primary keys; as well as systems where the source does not support time-window queries and second-level real-time performance is required.