Qeasy Cloud
Get Started

Authoritative Tutorial on the Jky Outbound Application Query API Field Manual

· 钟家寿· Engineering Best Practices· 6 views· 5 min read

What This API Solves

In the supply chain integration between Jky (Jikeyun) and Yonyou NCC, the stock transfer out order is the central document connecting inventory flows on both sides. The erp.stockout.get API is used to pull outbound documents incrementally by modification time, defaulting to outType=202 (stock transfer out). This API does not write to the target; it is commonly used as a data source for reconciliation, status validation, and cross-system traceability. We use it to synchronize the status, in/out quantities, and warehouse codes of Jky stock transfer orders into the NCC transfer-out document view.

API Capabilities Overview

  • Authentication: Jky Open Platform AppKey + AppSecret signature. In the Jky adapter of Qeasy, this is typically handled via one-click account authorization, no manual signing required.
  • Request Structure: POST form/JSON with business parameters; pagination pageIndex/pageSize, business filter outType, incremental window modifyTimeFrom/modifyTimeTo.
  • Response Structure: code=200 indicates success; the body is a list of outbound documents (header + nested details). The header key is allocateId, the line key is skuRelDataId.
  • Pagination Mode: Page index starts from 0, default page size is 50; the Qeasy adapter automatically paginates and merges results into one logical table.
  • Incremental Mode: Pulls based on the gmtModified time window, combined with Qeasy's {{LAST_SYNC_TIME}} and {{CURRENT_TIME}} placeholders. It runs every 2 minutes from 6:00 to 22:00 daily, with automatic checkpoint recovery managed by the platform.

Typical Field Mappings

Field NameTypeMeaningPractical Notes
allocateIdstringTransfer order primary keySynonymous with outId, used for cross-system linkage; in Qeasy it is usually mapped to the source document ID of the target
allocateNostringTransfer order business numberWritten into the NCC transfer-out document number or backfilled in memo for two-way traceability
outWarehouseCode / intWarehouseCodestringOut/in warehouse codesint is a typo variant of in; always map archives by code rather than name
inWarehouseCode / inWarehouseNamestringIn-warehouse code and nameSynonymous with int*; pick one set during integration
skuNo / materialCodestringSKU and material codesSKU is the Jky dimension; material code is the alignment key with NCC
skuCount / goodsCountstringQuantityUse skuCount for line-level quantity, goodsCount for header-level totals
inCountSum / outCountSumstringAccumulated in/out quantitiesReliable basis for judging transfer execution progress
status / outStatus / inStatusstringDocument and in/out statusesStatus codes may change with Jky versions; Qeasy's mapper recommends falling back to names
gmtModifiedstringModification timeThe only reliable anchor for incremental sync; never use gmtCreate
memostringRemarksRecommend backfilling the NCC transfer-out document number here for easier reconciliation
field1~30 / detailField1~30stringCustom extension fieldsMeaning varies by tenant configuration; collect a field mapping table from the business side before integration
currencyRate / outCurrencyCodestringExchange rate and currencyMust verify the local currency for inter-company transfers

How to Configure in Qeasy

  1. Adapter Selection: In Qeasy's Data Source, create a new Jky connection, select the erp.stockout.get adapter, fill in AppKey/Secret or reuse a platform-hosted application.
  2. Request Parameters: outType=202, default page size 50; incremental window uses placeholders {{LAST_SYNC_TIME|datetime}} and {{CURRENT_TIME|datetime}}. Qeasy automatically resumes from the last successful time.
  3. Field Mapper: Qeasy automatically expands the details based on the response JSON, splitting header and detail one-to-one; simply drag-and-drop warehouse, material, and quantity into the NCC transfer-out document.
  4. Write Strategy: Set Target to "No Operation"; this strategy only reads. Results land in a Qeasy data table for downstream strategies, or can be referenced directly in BI/reconciliation reports.
  5. Scheduling: Set the cron to 1-59/2 6-22 * * *; the Qeasy scheduler avoids nighttime windows, reducing pressure on the source.

Cross-Scenario Practical Points

  1. Use Codes as Primary Mapping Keys: Always map warehouses, SKUs, and departments by Code rather than name, to avoid misalignment when archives are renamed.
  2. Choose One of intWarehouse* and inWarehouse*: These synonymous fields appear alternately across versions. Pick one set and add a constant mapping in Qeasy to reduce branching.
  3. Use gmtModified Exclusively for Incremental Sync: We have seen multiple scenarios miss or duplicate data due to mixing applyDate or gmtCreate. The stable approach is to use gmtModified as the sole incremental key.
  4. Backfill Source Document Number in memo: Write back the NCC transfer-out document number into Jky's memo, so a single SQL query can locate discrepancies during difference analysis.
  5. Fall Back to Status Names: Status codes occasionally change during Jky upgrades. The Qeasy mapper recommends pulling both status and statusName, using the name for business judgments.
  6. Align Extension Fields Before Enabling: Custom fields like field1~30 and goodsField1~30 must have their meaning aligned with the business side first. Qeasy can save field alias templates to avoid repeated communication across scenarios.

Pitfall Recap

  • Pitfall 1: Treating goodsCount as line-level quantity. It is a header-level total; use skuCount for lines, otherwise the magnitude is off by tens of times and inventory reconciliation immediately goes red.
  • Pitfall 2: Using gmtCreate for incremental sync. Creation time does not update on modification, so audit, reverse-audit, or quantity changes never trigger, leaving audited documents permanently unpulled.
  • Pitfall 3: intWarehouseCode is empty. Some older API versions do not return this typo variant. The safe approach is to add a fallback rule in Qeasy's mapper: when intWarehouseCode is empty, take inWarehouseCode.
  • Pitfall 4: Unclear meaning of extension fields. Directly using field1 as warehouse and field2 as batch number causes mass misalignment after business-side config changes. Always solidify the field mapping table first.
  • Pitfall 5: Forgetting to verify currency for inter-company transfers. Stock transfer outs involve both source and target organizations; mismatched currency and exchange rates cause reconciliation failures. Be sure to add a validation in Qeasy.

When to Use

When business revolves around stock transfer outs and you need to reconcile Jky transfer orders with NCC transfer-out documents bi-directionally, this API is the preferred data source. If you only need sales outbound or other types, switch outType to the corresponding value and reuse the same adapter. For pure write scenarios, use erp.stockout.add/update instead.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/engineering/hb-p2-063-2-1-ff86

Comments