Qeasy Cloud
Get Started

Xiaoman OKKICRM Product Query API Field Handbook: A Practical Tutorial from Product Master Data to Sales Order Integration

· 谢锴斌· Engineering Best Practices· 10 views· 5 min read

What Problem Does This Interface Solve

In the integration scenario between Xiaoman OKKICRM and Jushuitan for sales orders, product master data is the cornerstone of order line-item linkage. This interface (/v1/product/list) is used to pull CRM-side product records incrementally, providing a product_no→SKU mapping basis for downstream order writes, and supporting product reconciliation, category statistics, and price completion. Across multiple client implementations, it typically serves as a "read-only strategy" that refreshes the product archive cache on schedule without writing back.

Interface Capability Overview

  • Authentication: Xiaoman OKKICRM uses API Key/Access Token header authentication; the request only needs to carry authorization info in the header.
  • Request Structure: POST /v1/product/list, with the body containing pagination (start_index, count), incremental window (start_time, end_time), and filter conditions (removed, product_type).
  • Response Structure: JSON object, usually containing data (product list) and pagination metadata (total count, current page, etc.). Each product record includes product_id, product_no, name, group_id/group_name, image, cost_with_tax, fob, minimum_order_quantity, etc.
  • Pagination Mode: Standard page-number pagination, start_index starts from 1, default 20 records per page; in real scenarios, we suggest tuning count based on the peer-side rate limit.
  • Incremental Mode: Pull by update time window. start_time/end_time support date or datetime format, usually cooperating with the platform's LAST_SYNC_TIME and CURRENT_TIME variables for rolling fetch.
  • Filtering Capability: removed defaults to 0 to query active products; set to 1 to query deleted ones. product_type supports three filters: 1=non-spec, 2=multi-spec, 3=bundle.

Typical Field Mappings

Field NameTypeMeaningPractical Notes
product_idstringUnique identifier within XiaomanUse as primary key; do not confuse with product_no
product_nostringProduct business codeCore key for cross-system reconciliation; mapped to Jushuitan SKU
namestringProduct display nameWatch out for special characters and encoding issues
group_idstringProduct category IDUsed for category mapping; mind the category hierarchy
group_namestringProduct category nameDisplay only; sensitive to backend renaming
imagestringProduct main image URLVerify URL validity to avoid expired links
cost_with_taxobjectTax-inclusive costObject structure with amount/currency sub-fields; deconstruct before margin analysis
fobobjectFree On Board priceInternational trade term; mind currency consistency
minimum_order_quantityobjectMinimum order quantity (MOQ)Object structure with quantity/unit; extract inner sub-fields when validating orders
product_typeintProduct type (1 non-spec / 2 multi-spec / 3 bundle)Usually not returned directly; needs the detail API or behavior inference

How to Configure on Qeasy

On the Qeasy Data Integration Platform, this interface is typically encapsulated as a product query component within the "Xiaoman OKKICRM adapter". Engineers only need to select the corresponding API in the data source configuration page, and the platform automatically provides a paginator, incremental window, and field mapper.

  • Adapter Encapsulation: The platform has preset the /v1/product/list endpoint, eliminating handwritten HTTP requests. Authentication is managed through a unified connector to avoid scattering across multiple strategies.
  • Incremental Variable Binding: Qeasy's field mapper automatically binds start_time to LAST_SYNC_TIME and end_time to CURRENT_TIME, so you don't need to manually assemble the time window.
  • Empty-Operation Target: This strategy is pure read-only; simply select "Write Empty Operation" for the Target, and the platform will not trigger downstream writes, but will land data into the intermediate table or cache layer.
  • Field Mapper: Complex fields (cost_with_tax, fob, MOQ) can be deconstructed with expressions in the mapper, e.g., cost_with_tax.amount to fetch the amount sub-field directly, avoiding repeated parsing in scripts.
  • Scheduling Configuration: A typical cron such as 15 7-22 * * * triggers at minute 15 of every hour from 07:00 to 22:59, staggered from the CRM-side update peak to reduce rate-limit risk.

Cross-Scenario Practical Points

  1. product_no is the cross-system lifeline: Across multiple client projects, we've found that as long as a stable mapping is built between product_no and Jushuitan SKU, the accuracy of order line-item linkage improves significantly. product_id is only a primary key and should not be used for business reconciliation.
  2. Incremental window should be slightly later than the peer side: We suggest using peer-side time + 1~2 minutes for end_time, and the last successful sync time for start_time, to avoid boundary data loss. In real scenarios, we usually widen the window by a few seconds — quite safe.
  3. Pull the three product types separately: Non-spec, multi-spec, and bundle products differ greatly in field structure. The safe way is to call three times by product_type and then merge downstream, avoiding messy single-call returns.
  4. Call the detail interface on demand: The list interface returns only base fields. For complete price, spec, MOQ, etc., you need /v1/product/info with product_no as the key. In Qeasy, you can configure a two-level "list + detail" fetch in the mapper.
  5. Object fields must be deconstructed: cost_with_tax, fob, and MOQ are all object structures; landing them as a whole will trigger type errors downstream. Using dot paths or expressions in the Qeasy field mapper is the standard practice.
  6. Trade-off on deleted products: removed=0 for active products is mainstream, but some reconciliation scenarios need removed=1 as well to inversely check historical orders of delisted items. This is a place where you can stumble; clarify the business contract first.

Pitfall Review

  • Pitfall 1: Boundary data loss in time window — start_time is precise to the second, but peer-side time zone is inconsistent, causing some products to be missed. Fix: unify UTC or peer-side time zone, and widen the window by a few seconds on both ends.
  • Pitfall 2: Landing the whole object field — Writing the entire cost_with_tax object to the downstream table causes deserialization errors. Fix: use obj.amount in the Qeasy mapper to extract sub-fields, or land it as a JSON field.
  • Pitfall 3: Multi-spec product treated as single-spec — Only one record is taken as the complete product. Fix: pull by product_type in rounds, and complete the SKU matrix in the detail interface.
  • Pitfall 4: Duplicate product_no — The peer side allows multiple records with the same product_no (legacy data), causing primary key conflicts downstream. Fix: use a composite key of product_id + product_no, or deduplicate in the mapper.
  • Pitfall 5: Incremental baseline time drift — The platform's CURRENT_TIME drifts from the peer-side server time, and the window grows larger over long runs. Fix: write back LAST_SYNC_TIME using the update timestamp returned by the peer side, not the local time.

When to Use

This interface is suitable for scenarios where Xiaoman OKKICRM product master data needs to be synchronized to Jushuitan or other downstream systems, especially when order line items depend on the CRM-side product archive for mapping. If you only need to query products within the CRM, calling the API directly is enough; if two-way sync is required, configure a separate write strategy and handle product_no idempotency properly.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/engineering/hb-p2-117-6a4a

Comments