Authoritative Tutorial: Kingdee YXC Logistics Company Query API Field Manual
What This API Solves
In retail cross-system integrations, logistics company master data is shared between sales-out, shipping, and freight settlement. The partner retail platform needs stable logistics codes and contacts, while Kingdee YXC is typically the system of record. By exposing the query endpoint /jdy/v2/bd/logistics_company, logistics master data can flow reliably into the partner platform, supporting shipment mapping, freight settlement, and code cross-reference, eliminating dual manual maintenance.
API Capability Overview
- Authentication: Kingdee YXC V2 standard OpenAPI auth. Obtain an AccessToken via
/jdy/v2/oauth/tokenusing AppKey/AppSecret, then pass it through request headers. - Request Structure: GET
/jdy/v2/bd/logistics_company, with two pagination parameters:pageandpage_size. Detail records are fetched viaotherRequest.detailAPIpointing to/jdy/v2/bd/logistics_company_detail. - Response Structure: Standard JSON containing a
dataarray and pagination metadata (total rows, total pages). Each record exposes bothid(primary key) andnumber/bill_no(business code). - Pagination / Incremental Mode: Page-based pagination (default
page_size=10). Scheduled jobs typically use the crontab*/5 * * * *. Incremental checks rely onmodify_timetimestamps. - Strategy Type:
effect: QUERY— a read-only master data strategy. The Target side is configured as a no-op write.
Typical Field Mapping
| Field Name | Type | Meaning | Engineering Notes |
|---|---|---|---|
| id | string | Kingdee internal primary key | Map to logistics_company_id; recommended as idempotency key |
| bill_no | string | Logistics company document number | Core cross-system matching code; enforce uniqueness |
| contact_linkman / contact_phone | string | Contact person / phone | Typically mapped into partner carrier profile |
| contact_country/province/city/district_*** | string | Contact address four-level administrative divisions | Returned as ID, Name, and Number; pick by scenario |
| contact_address | string | Detailed contact address | Concatenate province/city/district; store full address on target |
| dispatcher_country/province/city/district_*** | string | Dispatch address four-level administrative divisions | Apply when dispatch and contact addresses differ |
| dispatcher_address / dispatcher_linkman / dispatcher_phone | string | Dispatch address & contact | Usually mapped as an independent group in Qeasy |
| recevice_delivery | string | Pickup mode | Field name has a typo (should be receive); add compatibility on the target side |
| delivery_type_id/name/number | string | Delivery type | Use code-based mapping to avoid name ambiguity |
| payment_entry / cus_bear_fee_entry / attachments_url / custom_field | object | Payment / fees / attachments / extension | Structured objects; parse against Kingdee docs |
| total_amount / total_un_settle_amount / deduction_balance / all_debt / last_debt | string | Settlement and debts | Strings holding numerics; use BigDecimal to avoid precision loss |
| setting_term_*** / currency_id / due_date | string | Settlement terms / currency / due date | Drive freight settlement reconciliation |
| bill_status / trans_type / io_status | string | Business status | Common filter for incremental sync |
| creator_*** / modifier_*** / auditor_*** / create_time / modify_time / audit_time | string | Audit fields | modify_time is a typical anchor for incremental sync |
| f_logistics_id / customer_id / dept_*** / emp_*** | string | Business relations | Logistics hierarchy, customer ownership, responsibility |
How to Configure in Qeasy
- Adapter: In Qeasy's "Data Source Management", create a "Kingdee YXC V2" connection, fill in tenant ID, AppKey/AppSecret, and call
/jdy/v2/oauth/tokento retrieve the AccessToken. - API Wrapper: Pick the "Logistics Company Query" template under "Kingdee YXC · Business Documents". The default method is GET, and
page/page_sizeare appended automatically. - Metadata Mapping: In metadata, map
idto theidfield andnumbertobill_no, and enableidCheck: trueandautoFillResponse: true. The Qeasy field mapper auto-expandscontact_*anddispatcher_*groups and supports a "province/city/district + detail → full address" merge rule. - Detail Drill-Down: Enable
detailAPIunder "Other Request" so that/jdy/v2/bd/logistics_company_detailis invoked peridafter the list query. - Write Strategy: Since this is a query-only strategy, the Target is configured as a no-op write. It normally runs as a master data prerequisite, with downstream tasks (such as sales-out sync) chained via
depends_on.
Cross-Scenario Best Practices
- Dual-Track Primary Key + Code: Kingdee returns both
idandbill_no. In Qeasy we always useidas the idempotency key andbill_noas the business code, so downstream matching stays stable even if codes change. - Handle Address Groups Separately:
contact_*(contact address) anddispatcher_*(dispatch address) share the same structure but differ semantically. Never merge them into one target field, or dispatch data will overwrite contact data. - Parse Objects on Demand:
payment_entry,cus_bear_fee_entry,attachments_url, andcustom_fieldare structured objects. Qeasy supports JSONPath extraction, but always inspect the response shape in the preview panel before writing expressions. - Use
modify_timefor Incremental Sync: Across multiple retail projects, logistics companies change rarely but do change. Usingmodify_timefor incremental filtering is far more stable than full scans; a 5-minute schedule works well. - Unify BigDecimal for Money:
total_amount,all_debt, etc. are strings. Always parse with BigDecimal during cross-system transmission to avoid floating-point discrepancies in reconciliation. - Typo Compatibility:
recevice_deliveryis a known typo preserved by the Kingdee API. Keep bothreceive_deliveryandrecevice_deliveryvalid on the target side to survive upgrades.
Pitfall Retrospective
- Default
page_size=10causing first-sync data loss: Kingdee defaults to 10 records per page. With more than 10 logistics companies, paging silently truncates results. The safe approach in Qeasy is to explicitly setpage_sizeto 50 or 100, and cap maximum pages in the paginator. - Using
idas the business code: Mapping Kingdeeiddirectly into the partner platform's logistics code breaks downstream lookups whenever Kingdee rebuilds primary keys. We always usebill_noas the business code and reserveidfor internal idempotency. - Dispatch address overwritten by contact address: Both addresses are literally "address" in the source, which is easy to misconfigure. The Qeasy field mapper separates them by the
dispatcher_*prefix; engineers only need to align groups. - Objects written as raw strings:
payment_entryand similar objects, written without expansion, become[object Object]on the target. Use Qeasy's JSONPath or a script node to flatten them before mapping. - Missing incremental field forces full reloads: Some clients skip
modify_time, causing repeated full loads. Markmodify_timeas the "incremental field" in Qeasy's field settings and enable "increment by modify time" in the filter.
When to Use This API
Pick it when you need Kingdee YXC as the source of truth for logistics master data and want to synchronize it into an e-commerce ERP, retail middle platform, or WMS. If you only read logistics info from a single Kingdee sales-out document, reuse the sales-out API directly. If the target system already owns logistics master data, this API can be skipped.