Qeasy Cloud
Get Started

Authoritative Tutorial on Querying T+ Inventory API: From Field Handbook to Jushuitan Integration

· 谢锴斌· Engineering Best Practices· 16 views· 5 min read
畅捷通T+Jushuitan存货查询聚水潭集成字段手册轻易云供应链集成

What Problem Does This API Solve

In supply chain integration, inventory master data is the key link between ERP and e-commerce/warehousing systems. The /tplus/api/v2/inventory/QueryPage endpoint is used to paginate inventory master data from Chanjet T+, supporting scenarios such as syncing inventory to Jushuitan products, mapping T+ inventory codes with Jushuitan product codes, and material mapping for sales/purchase orders. This strategy is read-only (Target is a no-op write), typically scheduled at 40 12,23 * * *, and uses incremental pulling based on UpdateDateBegin/UpdateDateEnd.

API Capabilities Overview

  • Authentication: Chanjet T+ OpenAPI app key authentication (AppKey/Secret signature mechanism) carried in request headers.
  • Request structure: POST /tplus/api/v2/inventory/QueryPage with body containing PageIndex, PageSize, selectfields, UpdateDateBegin, UpdateDateEnd.
  • Pagination: Standard pagination; PageSize defaults to 50, PageIndex starts at 1; loop through pages until empty.
  • Incremental mode: Primarily uses Ts (update timestamp) or UpdateDateBegin/UpdateDateEnd time window. The former is more precise, the latter suits batch backfill.
  • Response structure: Array with pagination metadata; each record contains 50+ business fields, where InventoryClass, Unit and similar are object fields with Code, Name sub-properties.

Typical Field Mappings

Field NameTypeMeaningPractical Notes
IDstringUnique inventory primary keyUsed for cross-system mapping and incremental deduplication; metadata sets idCheck:true for primary key validation
CodestringInventory business codeConfigured as number in metadata; the core key for T+ to Jushuitan code mapping
NamestringInventory nameMaps to Jushuitan goods_name/spec_name
SpecificationstringSpecification/modelRecommend mapping to Jushuitan spec
DefaultBarCodestringDefault barcodeFor multi-barcode items, prefer this or iterate InvBarCodeDTOs
InventoryClassobjectInventory category (with Code, Name)Maps to Jushuitan category; remember to expand sub-properties
Unit / BaseUnitCode / BaseUnitNameobject/stringMain unit of measureMaps to Jushuitan unit; multi-scenario units must be selected per business line
UnitByPurchase/Sale/Stock/Retail/ManufactureobjectMulti-scenario unitsSales uses UnitBySale, purchase uses UnitByPurchase to avoid mismatch
DisabledstringWhether disabledFilter true records before syncing to avoid "ghost products" downstream
IsPurchase / IsSale / IsSuite / IsBatch / IsSerialNumberstringBusiness attribute flagsControl whether downstream participates in purchase/sale/batch/serial flows
InvSCost / LatestCost / AvagCoststringReference/Latest/Average costPick one to map to Jushuitan cost; recommend AvagCost
RetailPriceNew / InvLSPricestringRetail price/Latest sale priceMap to Jushuitan price; watch tax-inclusive/exclusive convention
TsstringUpdate timestampPrimary basis for incremental sync
BrandCode / BrandNamestringBrand code and nameOften mapped to Jushuitan brand as a custom field
Expired / ExpiredUnitstringShelf life and unitRequired for shelf-life items; Expired=0 means disabled
TaxRatestringTax rateWatch tax rate conventions (13/9/6 etc.)
SkuInfoList / InvBarCodeDTOsarray/stringSKU list/Barcode listMulti-value fields should be expanded in the mapper
priuserdefnvc1~6stringUser-defined extension fieldsMeaning depends on enterprise configuration; often used for color/size

How to Configure on Qeasy

On the Qeasy Data Integration Platform, the Chanjet T+ inventory query API is encapsulated as a standard adapter, allowing engineers to complete the connection through visual configuration:

  1. Adapter selection: Choose the Chanjet T+ OpenAPI adapter and configure AppKey/Secret and account info.
  2. API selection: Select the QueryPage interface, configure pagination parameters (default PageSize=50) and incremental window (UpdateDateBegin/UpdateDateEnd, with built-in {{LAST_SYNC_TIME}} ~ {{CURRENT_TIME}} placeholders).
  3. Field mapper: The Qeasy field mapper automatically expands object fields (e.g., InventoryClass.Code, Unit.Name) and supports selectfields for trimming returned fields, reducing transmission overhead.
  4. Deduplication and primary key validation: With idCheck:true in metadata combined with the platform's dedup component, deduplicate by ID to prevent duplicate writes.
  5. No-op write strategy: When the Target is configured as a "no-op write", the platform only lands the query results into the mid-stage data pool without triggering downstream writes—ideal for read-only scenarios.
  6. Scheduling configuration: Set cron expressions via the platform scheduler, typically 40 12,23 * * *, to achieve twice-daily accurate pulls.

Cross-Scenario Practical Points

  • Code mapping over name: For cross-system association, prioritize Code matching; on Jushuitan side map to spec_code or goods_no. Name matching is only auxiliary.
  • Object fields must be expanded: Fields like InventoryClass and Unit are objects in the API response and must have .Code/.Name explicitly extracted in the mapper, otherwise serialization will fail.
  • Ts is safer for incremental: Compared to UpdateDateBegin/UpdateDateEnd time window, the Ts timestamp has finer granularity and can capture multiple modifications within the same minute; window mode is suitable for historical backfill.
  • Disabled inventory must be filtered: Disabled=true items must be filtered before writing to Jushuitan, otherwise dirty data of disabled products still participating in business will appear.
  • Multi-scenario units per business: Sales orders use UnitBySale.Name, purchase orders use UnitByPurchase.Name. Don't default to BaseUnitName, or unit confusion will occur.
  • Document custom field configuration: priuserdefnvc1~6 have different meanings across enterprises; add annotations in Qeasy mapping configuration to avoid future maintenance pitfalls.

Pitfall Review

  • Unexpanded object fields cause batch failure: A common error is directly mapping InventoryClass as a whole to Jushuitan category—the platform cannot serialize the object to a string. The safe approach is to explicitly expand InventoryClass.Code and InventoryClass.Name in the field mapper.
  • Incremental window time drift: When UpdateDateBegin uses {{LAST_SYNC_TIME}}, scheduling latency may cause data loss. Add a padding (e.g., push forward 2 minutes) or switch to Ts incremental.
  • Multi-value barcode mishandling: InvBarCodeDTOs is an array; mapping it directly to a string field will error. Use join(',') in the mapper or pick the first element.
  • Disabled inventory synced: Ignoring Disabled filtering causes disabled products on Jushuitan to still participate in business. Add a Disabled=false filter condition in the platform filter component.
  • Tax rate/price tax-inclusive confusion: Whether InvLSPrice is tax-inclusive varies by enterprise configuration; confirm the tax convention with business before syncing to avoid price disputes.

When to Use

Prioritize this API when the business needs to sync Chanjet T+ inventory master data to the Jushuitan product library, establish material code mapping between the two systems, or support material mapping for sales/purchase orders. It is not suitable for scenarios requiring real-time inventory queries or transactional writes—those should use inventory query or document write APIs.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/engineering/hb-p2-195-t-7b16

Comments