Qeasy Cloud
Get Started

Refresh Kingdee YXC Authorization: A Practical Guide to Keeping Access Tokens in Sync

· 陈洁琳· Integration Solutions· 15 views· 4 min read

What This Strategy Solves

In a supply-chain integration between Kingdee YXC and Jushuitan, almost every downstream strategy—finished-goods sync, inventory query, stocktake sheet push—depends on Kingdee's AccessToken. When a token expires or is reset, downstream calls do not fail loudly; they fail silently. The business team only notices the next morning that inventory did not refresh.

The strategy "Refresh Kingdee YXC Authorization" exists to solve exactly this. It runs a lightweight scheduled job that continuously pulls the latest authorization from Kingdee back into the Qeasy data integration platform, ensuring every downstream call works with a live credential. It does not move any business data itself, but it is a prerequisite for the rest of the pipeline to stay healthy.

Data Flow and Field Mapping

The pipeline is intentionally short: the source is Kingdee YXC, the middle layer is Qeasy, and the target is Qeasy itself (a no-op write used only as a landing marker). The key fields are:

RolePlatformKey FieldNote
SourceKingdee YXC V2outerInstanceIdThe enterprise internal application identifier used to locate the tenant's authorization
SourceKingdee YXC V2/jdyconnector/app_management/push_app_authorizeThe authorization query/push endpoint that returns the latest authorization
MiddleQeasy integration platformAuto-fill responseCaptures the source response into Qeasy's built-in structure
TargetQeasy integration platformWrite no-opDoes not call out; only marks the end of this dispatch

There is a subtle point worth noting: the target's api field is "Write no-op" and its effect is EXECUTE, while the source side is QUERY. In other words, the source side asks, and the target side only lands the result. There is no cross-system business field mapping, which is the biggest difference between an authorization strategy and a normal business sync strategy.

How to Configure It on Qeasy

This is how we usually set it up on the customer site:

  1. Source strategy: pick WebAPI, method GET, call /jdyconnector/app_management/push_app_authorize. The request body only carries outerInstanceId, which comes from Kingdee's "Enterprise Internal Application" identifier. Set autoFillResponse to true so Qeasy automatically accepts the returned structure and reduces field maintenance cost.
  2. Target strategy: also WebAPI, but effect is EXECUTE, method POST, api is "Write no-op". This stage does not send any business parameters; it only tells the platform that the dispatch ended normally.
  3. Platform codes: source Kingdee.YXC, target datahub. Both connectors must be configured in Qeasy and isolated by tenant.
  4. Dependency: we recommend placing this strategy as a warm-up step before all B_TO_A business strategies. In Qeasy's strategy orchestration, mark it as a fallback layer before sequence=A, and have other strategies depend on it. Downstream traffic is only released once the authorization is in place.

Implementation Steps

Authorization strategies do not need to be complex. Three phases are enough:

  • Phase 1: start with an incremental trigger. On first go-live, manually trigger once so the latest Kingdee authorization is pulled back into Qeasy immediately, preventing downstream strategies from hitting 401 during cold start.
  • Phase 2: scheduling cadence. Source crontab 3 0 * * * (00:03), target crontab 23 2 * * * (02:23). The two times are offset to avoid the business peak and to leave enough window for the authorization write. Kingdee's official authorization is typically valid for 24 hours, so a daily early-morning run is sufficient.
  • Phase 3: monitoring and retry. Attach a dedicated alert to this strategy in Qeasy. Two consecutive failures should page operations directly. 90% of authorization failures are due to a disabled app or an expired tenant, not a code bug.

Pitfalls We Have Seen

  • Classic mistake 1: running the authorization refresh strategy concurrently with business strategies in the same crontab. The authorization is not ready yet, and the business strategy starts hitting 401. We now always move the authorization strategy's sequence earlier and set "block when dependency is unmet" in Qeasy.
  • Classic mistake 2: filling in the wrong outerInstanceId. Note that Kingdee's "Enterprise Internal Application" identifier and its "ISV Application" identifier are two different things; mixing them up will return no authorization. The safe approach is to maintain a dedicated application-identifier dictionary in Qeasy's centralized code-mapping management, so every strategy does not fill in its own copy.
  • Classic mistake 3: assuming "Write no-op" can be skipped. Without it, Qeasy considers this dispatch not closed and raises a "no matching target" alert in the logs, which actively hurts troubleshooting.
  • Classic mistake 4: the authorization refresh succeeds, but downstream still reports an invalid token. This is usually because the token cache on the Qeasy side was not refreshed. You need to enable "force overwrite" on the strategy or manually clear the cache once.
  • Classic mistake 5: ignoring tenant isolation. When the same integration template is reused across multiple subsidiaries, each subsidiary has its own outerInstanceId. They must be configured per tenant and cannot be reused.

When This Applies and When It Does Not

Applies: warm-up step before any Kingdee YXC AccessToken-dependent downstream strategy goes live; unified renewal in multi-tenant or multi-subsidiary scenarios; batch recovery after a Kingdee application re-authorization. Does not apply: scenarios that actually move business data (finished goods, inventory, documents); or self-built system integrations that do not rely on Kingdee's ISV authorization system at all.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-jushuitan-kingdee-cloud-5950-nfa1de4e5-e7b2fe5d

Comments