English
Trade Complaints
Complaints filed by consumers in Alipay / WeChat are synced through the channel as platform complaint tickets. The admin panel and merchant panel handle them with the same actions: view details, reply, upload evidence and report finished. Menu path: Complaints & Exceptions → Complaint Tickets (same menu on both panels; entry path
/trade/complaint).Complaints have a response deadline (typically 72 hours for Alipay). Overdue tickets are flagged and affect the merchant's rating on the channel side, so handle them first.
Supported Scope
A complaint ticket is recorded along two dimensions — channel × complaint platform: the channel decides which payment channel is used for sync and reply, and the complaint platform identifies which official source the complaint came from.
| Complaint platform | Integration forms | Supported abilities |
|---|---|---|
| Alipay | Direct (alipay) / service provider (alipay_isv) | Sync, single-ticket refetch, reply, finish, evidence upload; payer images are public URLs and displayed directly |
Direct (wechat_pay) / service provider (wechat_isv) | Sync, single-ticket refetch, reply, finish, evidence upload, payer image proxy download (temporary URLs that expire) | |
| Douyin | Platform enum placeholder | Real API not integrated; no tickets are produced |
The detail endpoint returns an abilities set for the current channel + platform, and the UI shows only the supported action buttons; calling an undeclared ability returns "unsupported ability".
Sync window and idempotency
Complaint sync always pulls the last 7 days and updates idempotently by "channel + complaint platform + channel complaint ID", so re-syncing never creates duplicate tickets; negotiation messages are also idempotent by their channel negotiation message ID.
Ticket List
Filters: platform complaint No., channel complaint ID, fund trade No., merchant (admin only), complaint platform, status, overdue flag.
Columns: platform complaint No., payment channel, complaint platform, merchant (admin only), complaint amount, issue type, status, complaint time, response deadline (red "Overdue" tag when exceeded), creation time.
| Status | Meaning |
|---|---|
Pending (pending) | The user has complained and the merchant has not replied yet |
Processing (processing) | The merchant has replied; negotiation is still open |
Finished (finished) | Reported finished to the channel (terminal state) |
The status is maintained by the platform; the raw channel status is kept in a separate "channel status" column for reference only.

Figure: Complaint ticket list showing the platform complaint No., payment channel, complaint platform, merchant, amount and status, with "Sync Now" and "Sync Records" in the toolbar
Details and Handling
The detail drawer has four blocks: Basic Info (complaint No., channel complaint ID, trade No., amount, issue type / reason / content, complainant, masked contact, status and deadline), payer images, negotiation history and reply. The admin panel additionally shows callback records (the intake ledger of WeChat complaint notifications).

Figure: Complaint details page: progress and related trade on the left; payer complaint, negotiation history and reply area on the right
Negotiation History
A timeline of user messages (user) and merchant replies (merchant); an admin-panel reply is submitted to the channel on the merchant's behalf and is also recorded locally as a merchant reply. Every reply is sent to the channel and archived.
Replying
- Enter the reply (respond within 72 hours) and optionally attach evidence images: upload them first to obtain image credentials, then submit them with the reply;
- A successful reply appends a negotiation record and moves the ticket from Pending to Processing;
- Finished tickets cannot be replied to; if the channel does not declare the reply ability, the action is rejected.

Figure: Reply area: enter the reply, upload evidence images and send; the reply is synced to the channel
Marking Finished
After a second confirmation the platform reports the ticket finished to the channel and the ticket becomes Finished; repeating the action on a finished ticket is idempotent. Negotiate with the complainant first to avoid a rushed closure that triggers a second complaint.
About Images
- WeChat: payer images are temporary channel resources; the frontend displays them through the platform proxy (
GET .../complaint/image?complaintId=&mediaId=), and an expired image prompts "Image expired. Please sync again and retry"; - Alipay: payer images are public URLs and are displayed directly, no proxy needed;
- Evidence images are submitted through the upload endpoint (file name + Base64), and the returned credential is delivered to the channel with the reply.
Sync Mechanism
Scheduled Sync
| Task | Frequency | Description |
|---|---|---|
| Complaint incremental poll | Every 30 minutes (offset 40 s) | Pulls the last 7 days of complaints for all enabled channel merchants and saves idempotently |
| Unfinished ticket refresh | Hourly (at minute 15, second 20) | Refetches pending/processing tickets via the single-ticket detail API, up to 100 per batch, covering the list's time-window blind spot |
| Overdue scan | Every 30 minutes (offset 10 s) | Marks tickets past their deadline and not finished as overdue, flags them in the list and logs each one at WARN |
Global switch: daxpay.platform.config.complaint-sync-enabled (default true). Turning it off only stops the scheduled poll; manual triggers from the admin panel are unaffected. Scheduled and manual triggers share one distributed lock (lock:complaintSync:sync); on conflict the task is marked "Skipped" rather than silently dropped.
Manual Sync (Admin Panel)
"Sync Now" on the list opens the sync dialog:

Figure: "Sync Complaints" dialog: choose all enabled channel merchants or one channel merchant; the time window is fixed to the last 7 days
- Scope: all enabled channel merchants, or one selected channel merchant;
- Filters: merchant No., channel merchant No., payment channel, payment product (all applied together as an intersection; all empty means full scan);
- Time window: fixed to the last 7 days (the channel API pulls by time window);
- Submitting returns a task ID immediately and runs asynchronously; the list is not blocked — refresh later or check "Sync Records".
Execution Ledger
Every trigger (scheduled / manual / callback) creates one sync task, and each channel merchant gets one sync record:
| Level | Statuses |
|---|---|
| Task | Running (running) / Success (success) / Partially failed (partial) / Failed (failed) / Skipped (skipped) |
| Record | Success (success, fetched and saved) / Failed (failed, channel call or save error) / Skipped (skipped, channel has no complaint ability) |
A task record contains trigger type (scheduled / manual / callback), operator, scope, time window, start/end time, duration, merchant success/failure counts, fetched and saved counts, and failure reason. Each record supports single-merchant retry (creates a manual task for that merchant / channel / product and reruns only the last 7 days).

Figure: Sync records: each task lists success / failure / skip counts per channel merchant, with drill-down into records
Complaint Callback (WeChat)
Besides polling, WeChat supports a complaint notification callback so that new complaints and status changes arrive in real time; the callback is only an accelerator — missed deliveries are still covered by polling.
Prerequisites
- Complaint callback is supported by default and enabled per channel merchant / service provider; there is no platform-level feature switch;
- The backend API URL under System Management → System Config → Platform Config → Endpoint Config must be a public HTTPS address, otherwise registration is impossible (the page shows "Backend address not configured or not HTTPS").
Merchant-Level Toggle (WeChat Direct)
Entry: Channel Merchants → WeChat (direct) → Complaint Callback card.
- Enabling registers the callback URL
{backend URL}/unipay/callback/{mchNo}/{channelMchNo}/wechat/complaintwith WeChat; disabling unregisters it; - A WeChat merchant ID can have only one complaint callback URL; enabling overwrites the URL configured outside the platform, and disabling deletes it;
- The card shows the platform-side URL, the channel-side registered URL, registration status, last registration time and failure reason; if the URLs differ, the platform unregisters the old one and registers the new one;
- A callback resolves the merchant from the ticket and creates a callback-sourced targeted sync task for that channel merchant only; the same notification ID is deduplicated for 30 minutes.
Service-Provider-Level Toggle (WeChat Service Provider)
Entry: Channel Merchants → WeChat Service Provider → Service-Provider Complaint Callback card.
- The service-provider callback is provider-level (one URL receives pushes for all sub-merchants); the toggle is platform-level with no merchant parameter;
- URL:
{backend URL}/unipay/callback/wechat/isv/complaint; - The callback body contains only the complaint ID and action type; the platform resolves the complained merchant ID from the ticket detail to locate the sub-merchant binding, and falls back to a full service-provider sync when it cannot resolve, so events are never lost.
Alipay has no complaint callback
Alipay complaints rely solely on scheduled polling and manual sync; no callback URL needs to be configured.
Admin vs. Merchant Panel
| Capability | Admin panel | Merchant panel |
|---|---|---|
| Visible scope | Platform-wide (filterable by merchant) | Own merchant only |
| Reply / evidence upload / mark finished | Supported; replies are submitted on the merchant's behalf | Supported; replies are submitted as the merchant |
| Sync now / sync records / per-record retry | Supported | Not provided |
| Callback records (WeChat notification ledger) | Supported | Not provided |
| Complaint callback configuration | Channel merchant page (reuses channel merchant permissions) | Not provided |
The merchant panel suits delegating frontline handling to merchants; the admin panel keeps the platform-wide view for chasing overdue tickets and handling them on the merchant's behalf.
Permission Codes
| Permission code | Purpose |
|---|---|
trade:complaint:view | List, detail, negotiation history, callback records, sync task/record queries |
trade:complaint:manage | Reply, evidence upload, mark finished, sync now, per-record retry |
WeChat complaint callback configuration adds no new permission code; it reuses the channel merchant menu (channel:merchant) view/manage permissions.
API Reference
Admin Panel (/admin/complaint)
| Method | Path | Description |
|---|---|---|
| GET | /admin/complaint/page | Complaint tickets, paged |
| GET | /admin/complaint/get-by-id | Ticket detail (including abilities) |
| GET | /admin/complaint/negotiation-list | Negotiation timeline |
| GET | /admin/complaint/notify-record/list | Callback records |
| POST | /admin/complaint/reply | Reply on behalf of the merchant |
| POST | /admin/complaint/finish | Mark finished |
| POST | /admin/complaint/upload-image | Upload evidence image |
| GET | /admin/complaint/image | Proxy-download payer image |
| POST | /admin/complaint/sync-now | Trigger a manual sync (optional filters, returns task ID) |
| GET | /admin/complaint/sync-task/page | Sync tasks, paged |
| GET | /admin/complaint/sync-task/get | Sync task detail |
| GET | /admin/complaint/sync-record/list | Sync task records |
| POST | /admin/complaint/sync-record/retry | Retry one sync record |
| GET | /admin/complaint/sync-candidates | Channel merchant candidates for sync |
Merchant Panel (/mch/complaint)
| Method | Path | Description |
|---|---|---|
| GET | /mch/complaint/page | Own merchant's complaints, paged |
| GET | /mch/complaint/get-by-id | Detail (including abilities) |
| GET | /mch/complaint/negotiation-list | Negotiation timeline |
| POST | /mch/complaint/reply | Reply |
| POST | /mch/complaint/finish | Mark finished |
| POST | /mch/complaint/upload-image | Upload evidence image |
| GET | /mch/complaint/image | Proxy-download payer image |
WeChat Complaint Callback Configuration
| Method | Path | Description |
|---|---|---|
| GET / POST | /admin/wechat/complaint-notify-config/get, /toggle | WeChat direct merchant-level callback query / toggle |
| GET / POST | /admin/wechat/isv/complaint-notify-config/get, /toggle | WeChat service-provider-level callback query / toggle |
Deployment and Troubleshooting
- Response deadline: use the deadline delivered by the channel (typically 72 hours for Alipay); the overdue flag is maintained by the scheduled scan — set monitoring on the overdue WARN logs.
- New complaints not synced: first confirm the complaint sync job is not disabled, the channel merchant is enabled and the channel declares the complaint ability; check "Sync Records" for failed records of the round and retry them directly.
- Callback enabled but polling still does the work: check that the backend URL is public HTTPS, the channel-side registered URL matches the platform's, and the channel merchant toggle is still on; missed callbacks are filled in by the next poll.
- Complaint images do not open: WeChat temporary resources have expired — re-sync to refresh the URL and retry; Alipay images are public URLs, so check whether the user-side resource is still valid.
- No reply button: finished tickets cannot be replied to; the channel may also not declare the
REPLYability (check theabilitiesreturned in the detail).
Related Links
- Payment Order Management: verify the disputed trade by fund trade No.
- Callbacks and Notifications: trace the callback chain behind trade-status disputes
- Channel Merchants: where the WeChat complaint callback toggle lives
- WeChat Pay Channel: WeChat direct / service-provider integration