Authoritative Tutorial: Jushuitan Refund & Return Query API Field Manual (Non-Qimen)
What Problem Does This API Solve
The Jushuitan "Refund & Return Query" API is used to pull after-sales orders (returns, refunds-only, exchanges, re-deliveries, etc.) from e-commerce platforms back into a local data warehouse. It is commonly seen in scenarios such as localizing after-sales data, return/exchange analysis, financial reconciliation, and inventory back-flushing for retail companies. Once landed in MySQL, the data can be linked with sales orders and inventory flows to close the after-sales loop of the supply chain.
API Capability Overview
- Endpoint:
/open/refund/single/query(non-Qimen direct-connect version; field set differs from the Qimen variant P2-010) - Authentication: Jushuitan Open Platform Access Token, application-level authorization
- Request Structure: POST with form/JSON body.
modified_begin/modified_enddefine the modification time range;date_typeselects the time field type (0 = modified, 2 = io_date outbound time); it cannot be empty together with the online order number, and the interval must not exceed 7 days - Pagination/Incremental: Incremental based on modification time. Across many customer projects, schedules are typically hourly (
15 */1 * * *), deduplicated byas_idon write - Response Structure: Single-layer after-sales object with flat header fields and an
itemsarray for line items that must be flattened on write - Write Mode: MySQL side typically uses
REPLACE INTOwith primary key deduplication; theAfterTargetGeneratescript converts empty values to null and filters out emoji and characters outside the BMP
Typical Field Mapping
Header Core Fields
| Field | Type | Meaning | Hands-on Notes |
|---|---|---|---|
| as_id | string | After-sales order number, unique within Jushuitan | Primary key; incremental identification depends on it |
| outer_as_id | string | Platform refund/return order number | Key for reconciliation with the e-commerce platform |
| so_id / o_id | string | Original online order number / internal order ID | Links to sales orders for inventory back-flushing |
| shop_id / shop_name | string | Shop ID and name | Keep shop dimension for multi-shop projects |
| warehouse / wh_id / wms_co_id | string | Warehouse name / warehouse ID / sub-warehouse ID | Not 1:1; do not confuse them |
| type | string | After-sales type: normal return / refund-only / exchange / re-delivery / rejection / complaint / other | Branches financial posting |
| status | string | WaitConfirm / Confirmed / Cancelled | Determines whether inventory back-flush should fire |
| modified / created / as_date / confirm_date | string | Modification / creation / application / confirmation time | Incremental pull only trusts modified |
| refund / payment / buyer_apply_refund / receive_refund / buyer_receive_refund / urefund | string | Various refund and compensation amounts | Distinguish seller-compensated, buyer-compensated, and actually refunded |
| freight / shop_freight | string | Seller-borne freight / online freight refund | Often missed in cross-border reconciliation |
| co_id / owner_co_id / drp_co_id_from / drp_co_id_to / outer_drp_co_id | string | Company and distribution organization IDs | Required for multi-org customers |
Line Item (items_*) Core Fields
| Field | Type | Meaning | Hands-on Notes |
|---|---|---|---|
| items_asi_id | string | After-sales line ID | Unique identifier per line |
| items_as_id | string | Linked header as_id | Preserved after flattening |
| items_sku_id / items_shop_sku_id / items_combine_sku_id | string | SKU identifiers | Link to product master data |
| items_r_qty / items_qty / items_defective_qty | string | Return qty / after-sales qty / defective qty | Defective qty impacts the substandard inventory ledger |
| items_price / items_amount / items_shop_amount / items_total_per_unit | string | Unit price / line amount / shop amount / unit total | Common source of reconciliation gaps |
| items_properties_value / items_name / items_pic | string | Specs, product name, product image | Text often triggers emoji filtering |
| items_extend_datas | string | Extension data (JSON) | Decide whether to unpack based on business needs |
How to Configure on Qeasy Cloud
On the Qeasy Cloud Data Integration platform, configuring this API typically follows four steps:
- Adapter Selection: Choose
/open/refund/single/queryfrom the "Jushuitan · Non-Qimen" adapter; authentication and time-range encapsulation are pre-built. - Field Mapper: Map header fields 1:1; line items go through the "line-item flattening" node and are automatically prefixed with
items_before being written to the target table. - Incremental Strategy: Use the "Incremental by modified" component, persisting the last successful
modified_endinto a schedule variable so the window slides automatically without breaching the 7-day cap. - Post-Write Processing: The platform's built-in
AfterTargetGeneratehook normalizes empty values and filters emoji and non-BMP characters; the default write into MySQL usesREPLACE INTOto avoid task interruption from duplicate primary keys.
Cross-Project Best Practices
- The 7-day time window is a hard limit: Long backfill tasks must be sliced into 7-day chunks; you cannot request a whole month at once.
date_typedefines the incremental baseline: The default 0 (modified) covers most after-sales status changes; if pulling byio_date, note thatmodifiedstops changing onceConfirmed.- Line items must be flattened: Writing the
itemsJSON array unflattened breaks the schema and tanks query performance. - Status fields are financial triggers:
statustransitioning from WaitConfirm to Confirmed is the real signal to flush inventory; Cancelled must be filtered out separately. - Amount fields are granular:
refund,payment,buyer_apply_refund,buyer_receive_refund, andurefundcannot be used interchangeably; reconciliation scripts must pin down each semantic. - Multi-org dimensions are mandatory:
owner_co_id,drp_co_id_from,drp_co_id_toare almost always used in distribution and multi-org customers; pre-build indexes.
Pitfall Post-Mortems
- Time interval over 7 days errors out directly: One customer requested a 30-day window at once and got "time interval exceeds limit". The safe approach is to add a "7-day slicing" component in the Qeasy Cloud scheduler.
- Emoji and special characters break MySQL writes: Buyer nicknames and remarks containing emoji triggered utf8 errors; filtering must happen at the
AfterTargetGeneratestage. - Un-flattened
itemsgives an empty query result: Reading theitemsfield directly off the header table returns a JSON string; the business side thinks no data was pulled. Always flatten. - Cancelled orders wrongly back-flush inventory: Ignoring the
Cancelledstatus caused every after-sales record to be deducted, leading to negative stock. Adding astatus='Confirmed'filter fixes it. as_idduplicate insert fails: Occasional re-push combined withINSERTinstead ofREPLACE INTOkilled the task. Switch toREPLACE INTOand add a unique key.
When to Choose This API
This API fits: e-commerce retail that needs localized after-sales data, reconciliation with ERP/WMS, return/exchange analysis, and inventory back-flushing. Boundary notes: if you need real-time platform push, prefer Qimen or message-driven push; this API only polls by modification time and a single window cannot exceed 7 days.