Qeasy Cloud
Get Started

Sales Outbound to Sales Invoice Sync: A Practical Guide for Jushuitan → Chanjet T+ with Payment-Term Mapping

· 许创贵· Integration Solutions· 23 views· 4 min read
畅捷通T+Jushuitan供应链集成销售订单同步账期路由轻易云

What This Strategy Solves

Pushing e-commerce orders from Jushuitan into Chanjet T+ for financial posting looks like a simple document copy. But when customers settle by payment term (e.g., JD self-operated stores), different stores use different fund channels and the payment-term definitions diverge, breaking reconciliation. In a real project, a retail enterprise was running multiple self-operated stores in parallel; we used the Qeasy data integration platform to split Jushuitan sales outbound documents by payment term and route them into the corresponding T+ books, aligning document flow with cash flow.

Data Flow and Field Mapping

The overall flow is: Jushuitan (B side) → Qeasy middle layer → Chanjet T+ (A side).

Business MeaningJushuitan (Source)Qeasy Middle LayerChanjet T+ (Target)
Document No.io_id (outbound id)io_idVoucherCode
Store Codeshop_idshop_id + payment-term tagDepartmentCode
Customer/Dealercustomer_idCode mapping → CustomerCodeCustomerCode
SKU Codesku_idCode mapping → InventoryCodeInventoryCode
Outbound QtyqtyqtyQuantity
Tax-Inclusive PricepricepriceTaxPrice
Tax Amounttaxtax → derivedTaxAmount
Payment-Term Tag(no explicit field)Injected by shop_id routingWritten to header custom field

Key point: the payment-term tag does not exist in the source; we inject it in the middle layer based on the store code. A common pattern on customer sites is to keep the "store → payment-term" relation as a single mapping table inside Qeasy, so adding a new store means updating one mapping entry, not the strategy.

How to Configure on Qeasy

Configuring this strategy on Qeasy typically takes four steps:

  1. Register data sources: connect to Jushuitan (open platform) and Chanjet T+ (T+ APIs); credentials live inside Qeasy connectors, never hard-coded in scripts.
  2. Fetch strategy: on the Jushuitan side, call io_query for sales outbound documents and use modified_start / modified_end for incremental; for the first run use date_type=2 with a creation-time window for full backfill.
  3. Middle-layer transformation: in the Qeasy transformer, do three things — SKU/customer code mapping, store-to-book routing, and header/body split. We prefer to handle headers (store, payment term, order time) and line items in two phases: write the header first, then push line items carrying the header id. This avoids lines being dropped when the header is not yet committed.
  4. Write strategy: call Chanjet T+'s sales invoice create API, route by book id; failed documents land in an error-handling queue for manual reissue or scheduled rerun.

Implementation Steps

When rolling this out at a customer site, we typically proceed in three phases:

  • T0 Full backfill: run a one-shot full backfill of historical outbound documents; to avoid pressuring T+, batch by store — 200 documents per batch, start the next only after the previous completes.
  • T1 Incremental start: take the cutover date as the boundary; set modified_start to midnight of the cutover day and run incrementally on a schedule thereafter.
  • T2 Schedule frequency: in dense e-commerce scenarios the interval is typically 5–15 minutes; payment-term books can run at 30 minutes to 1 hour, with dedup by io_id in a Qeasy staging table before each batch.

The safe pattern is dual-track — full for history, incremental for daily operations, with no interference between them.

Pitfalls and Lessons

  1. Payment term is not a field, it's a routing rule. A typical mistake is hunting for a "payment term" field in Jushuitan and discovering it has to be reverse-looked-up by store code. This is where things break — store codes are numeric strings in Jushuitan and a different set in T+; a central mapping table is mandatory.
  2. Don't push header and body in one shot. T+'s sales invoice create API depends heavily on the header; if the header fails, line items are simply dropped. The safer pattern: write the header, land it in the staging table with a success flag, then push line items carrying the header id — much better idempotency.
  3. Pick the right idempotency key. We use io_id + line_no as the idempotency key to avoid duplicates on rerun; using io_id alone causes T+ to reject the entire document on retry.
  4. Tax rate and tax-inclusive price conversion. Jushuitan provides tax-inclusive prices; T+ sales invoices usually require tax-exclusive unit price + tax amount. The tax rate is taken from the document date, not the item master — cross-month documents need special attention.
  5. Layered error handling. Network jitter and T+ temporary unavailability are normal. We let Qeasy classify failed documents into two buckets: retryable (network/lock) auto-retried, and human-required (missing field, unmapped code) routed to a todo queue, to avoid false alarms of "total failure".

When to Use and When Not to Use

Use it for: multi-store, multi-payment-term e-commerce retail where documents must be split by payment term/book — the typical Jushuitan-front, T+-back combination. Do not use it for: simple single-store, single-book sync (a flat rule suffices, no routing layer needed); or scenarios demanding real-time, sub-second write-back — this strategy runs on a schedule, so minute-level latency is expected.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-p9210a3-jushuitan-9687-bd-bf-7e6a410e

Comments