Sales Settlement Currency Query API Tutorial: Field Mapping to Kingdee Integration
What This API Solves
In multi-currency business scenarios, settlement currency master data is the foundation of monetary fields on sales orders, contracts, and receipts. When a retail enterprise integrates Sales Xiaoshouyi CRM with Kingdee Cloud Galaxy, the trickiest part is not the orders themselves but misaligned currencies—RMB stored as CNY, RMB, or simply empty—causing reconciliation failures across systems. This API pulls settlement currency master data via Sales Xiaoshouyi WebAPI /rest/data/v2/query, serving as the authoritative source for cross-system currency alignment and avoiding endless data fixes downstream.
API Capability Overview
- Authentication: OAuth2 authorization code mode; obtain
access_tokenfrom the Sales Xiaoshouyi open platform before calling. - Method & Endpoint:
GET /rest/data/v2/querywith parameters in the query string. - Request Parameters:
table(object API name, defaultcustomEntity70__c),select(comma-separated fields),where(SOQL-style filter),limit(page size, default 10, max 1000),offset(pagination offset). - Response Structure: Standard
{ records: [...], totalSize, done }, each record being an object of fields. - Pagination: Traditional
limit+offset; in Qeasy, the adapter automatically calculates pages fromtotalSizeand loops untildone=true. - Incremental Mode: The native API does not expose a
lastModifiedTimefield, so the industry uses a quasi-incremental approach with full pulls plus a time-window filter. - Scheduling Recommendation: Typical schedule
*/30 23 * * *(runs at 23:00 and 23:30 daily), avoiding business peak hours.
Typical Field Mapping
| Field Name | Type | Meaning | Hands-on Notes |
|---|---|---|---|
id | string | Unique primary key of the currency in Sales Xiaoshouyi; configured as both id and number in metadata | Prefer id for cross-system matching; with idCheck on, the platform auto-deduplicates |
name | string | Display name of the currency, e.g., "RMB", "USD" | Naming may vary across tenants; rely on codes for matching |
customItem8__c | string | Platform custom item, usually storing the currency code (CNY/USD/EUR) in this scenario | This is the key field for matching Kingdee currencies; map to ISO 4217 codes |
customEntity70__c | string | Custom object reference or parent association | Often empty for most tenants; pass through as a regular field |
customItem10__c | string | Extension attributes, possibly currency symbol, decimal places, exchange rate type | Meaning varies by tenant config; must verify in the actual tenant backend |
How to Configure on Qeasy
- Adapter Selection: Choose "Sales Xiaoshouyi WebAPI" as source, set endpoint to
/rest/data/v2/query, and Table tocustomEntity70__c. - Field Mapper: In Qeasy's field mapper, map
idto the target "Currency Primary Key",customItem8__cto "Currency Code", andnameto "Currency Name". Qeasy automatically normalizes null and empty strings. - Target Configuration: Set Target to "Write No-Op" since this is a pure query strategy; data lands on the platform for downstream Kingdee currency alignment and document synchronization reuse.
- Scheduling & Pagination: Qeasy's looper automatically paginates by
totalSize; raise single-pagelimitto 500 to reduce request count. - Primary Key Validation: Enable
idCheck=truealong withautoFillResponseto prevent duplicate writes.
Cross-Solution Practical Points
- Build cross-reference using Kingdee currency codes as the baseline: Kingdee Cloud Galaxy currency codes are stable master data; align Sales Xiaoshouyi's
customItem8__cto them so sales order sync does not break due to naming mismatches. - Synchronize currency master data before business documents: Always run the currency strategy first, then trigger downstream chains such as sales orders and receipts; otherwise, "currency not found" exceptions occur.
- Watch out for duplicate
namefield definitions: When the source config declaresnametwice in response, Qeasy uses the last declaration only; preview the actual response on the platform before defining mappings. - Infer custom field meanings from the strategy name: Fields like
customItem8__candcustomItem10__cwithout business labels must be interpreted by strategy name ("Settlement Currency"); do not reuse mappings from other master data strategies. - Use time-window filtering for incrementals, not API fields: The native API does not return
lastModifiedTime; a safe approach is addingLastModifiedDate >= LAST_N_DAYS:1towhereand rerunning daily so new currencies enter the system promptly. - Schedule away from business peaks: Running at 23:00 and 23:30 is empirical; it avoids daytime write peaks and leaves a retry window before dawn.
Pitfall Recap
- Pitfall 1: Using
nameas the code. A retail enterprise matched "RMB" directly to Kingdee, but Kingdee stored "CNY", causing all order currency fields to fail. Fix: UsecustomItem8__c(code) for cross-system mapping;nameis for display only. - Pitfall 2: Treating
customEntity70__cas a business field. Mistaking it for a currency code yields parent object references downstream that match nothing. Fix: Open the object in the Sales Xiaoshouyi backend first to inspect actual content. - Pitfall 3: Leaving
limitat the default 10. With many currencies, request count explodes and one run takes over ten minutes. Fix: Raiselimitto 500–1000 and let Qeasy's looper finish in one pass. - Pitfall 4: Misusing full delete-and-insert for incrementals. Assuming a query strategy means overwrite-on-rerun wipes downstream cached codes, breaking in-flight order references. Fix: Use upsert semantics for currency master data—insert and update only, never delete.
- Pitfall 5: Schedule colliding with Kingdee settlement. Running currency sync at 1:00 AM clashes with Kingdee's daily settlement and triggers table locks. Fix: Shift to 23:00 and 23:30 to avoid the Kingdee settlement window.
When to Use
Suitable for bidirectional integration between Kingdee Cloud Galaxy and Sales Xiaoshouyi requiring aligned settlement currency master data; not suitable for lightweight single-point queries on Sales Xiaoshouyi or scenarios with a single currency and no alignment need. Multi-currency, cross-border projects involving order and receipt flows across systems are strongly advised to build this currency query strategy first.