0
# Advanced Services
1
2
Specialized services including e-commerce platform support, marketing coupons, transfer services, Pay Score, complaint management, and bill downloads.
3
4
## Capabilities
5
6
### Marketing Services
7
8
Manage marketing coupons and promotional campaigns.
9
10
```java { .api }
11
/**
12
* Get marketing favor service for coupon management
13
* @return Marketing favor service instance
14
*/
15
MarketingFavorService getMarketingFavorService();
16
17
/**
18
* Get marketing business favor service
19
* @return Business favor service instance
20
*/
21
MarketingBusiFavorService getMarketingBusiFavorService();
22
```
23
24
**Usage Example:**
25
26
```java
27
// Create coupon stock
28
MarketingFavorService favorService = wxPayService.getMarketingFavorService();
29
CreateStockRequest request = new CreateStockRequest();
30
// Configure coupon details...
31
CreateStockResult result = favorService.createStock(request);
32
```
33
34
### E-commerce Platform Services
35
36
Support for multi-merchant e-commerce platforms.
37
38
```java { .api }
39
/**
40
* Get e-commerce service for platform operations
41
* @return E-commerce service instance
42
*/
43
EcommerceService getEcommerceService();
44
```
45
46
### Transfer Services
47
48
Various transfer and payout services.
49
50
```java { .api }
51
/**
52
* Get general transfer service
53
* @return Transfer service instance
54
*/
55
TransferService getTransferService();
56
57
/**
58
* Get merchant transfer service
59
* @return Merchant transfer service instance
60
*/
61
MerchantTransferService getMerchantTransferService();
62
63
/**
64
* Get brand merchant transfer service
65
* @return Brand merchant transfer service instance
66
*/
67
BrandMerchantTransferService getBrandMerchantTransferService();
68
69
/**
70
* Get partner transfer service (for service providers)
71
* @return Partner transfer service instance
72
*/
73
PartnerTransferService getPartnerTransferService();
74
```
75
76
### Pay Score Services
77
78
Credit-based payment and scoring services.
79
80
```java { .api }
81
/**
82
* Get Pay Score service
83
* @return Pay Score service instance
84
*/
85
PayScoreService getPayScoreService();
86
87
/**
88
* Get partner Pay Score service
89
* @return Partner Pay Score service instance
90
*/
91
PartnerPayScoreService getPartnerPayScoreService();
92
93
/**
94
* Get partner Pay Score sign plan service
95
* @return Partner Pay Score sign plan service instance
96
*/
97
PartnerPayScoreSignPlanService getPartnerPayScoreSignPlanService();
98
```
99
100
### Bill Management
101
102
Download transaction and settlement reports with support for both v2 and v3 APIs.
103
104
```java { .api }
105
/**
106
* Download bill data using parameters
107
* @param billDate Bill date (YYYYMMDD format)
108
* @param billType Bill type (ALL, SUCCESS, REFUND)
109
* @param tarType Archive type (GZIP or null)
110
* @param deviceInfo Device info (optional)
111
* @return Bill data result
112
* @throws WxPayException if download fails
113
*/
114
WxPayBillResult downloadBill(String billDate, String billType, String tarType, String deviceInfo) throws WxPayException;
115
116
/**
117
* Download bill data using request object
118
* @param request Bill download request
119
* @return Bill data result
120
* @throws WxPayException if download fails
121
*/
122
WxPayBillResult downloadBill(WxPayDownloadBillRequest request) throws WxPayException;
123
124
/**
125
* Download raw bill data as string
126
* @param request Bill download request
127
* @return Raw bill data
128
* @throws WxPayException if download fails
129
*/
130
String downloadRawBill(WxPayDownloadBillRequest request) throws WxPayException;
131
132
/**
133
* Download fund flow data
134
* @param billDate Bill date (YYYYMMDD format)
135
* @param accountType Account type (Basic, Operation, Fees)
136
* @param tarType Archive type (GZIP or null)
137
* @return Fund flow result
138
* @throws WxPayException if download fails
139
*/
140
WxPayFundFlowResult downloadFundFlow(String billDate, String accountType, String tarType) throws WxPayException;
141
142
/**
143
* Download fund flow data using request object
144
* @param request Fund flow request
145
* @return Fund flow result
146
* @throws WxPayException if download fails
147
*/
148
WxPayFundFlowResult downloadFundFlow(WxPayDownloadFundFlowRequest request) throws WxPayException;
149
150
/**
151
* Apply for trade bill download (API v3)
152
* @param request Trade bill request
153
* @return Bill application result with download URL
154
* @throws WxPayException if request fails
155
*/
156
WxPayApplyBillV3Result applyTradeBill(WxPayApplyTradeBillV3Request request) throws WxPayException;
157
158
/**
159
* Apply for fund flow bill download (API v3)
160
* @param request Fund flow bill request
161
* @return Bill application result with download URL
162
* @throws WxPayException if request fails
163
*/
164
WxPayApplyBillV3Result applyFundFlowBill(WxPayApplyFundFlowBillV3Request request) throws WxPayException;
165
166
/**
167
* Download bill from URL (API v3)
168
* @param url Download URL from bill application
169
* @return Bill data stream
170
* @throws WxPayException if download fails
171
*/
172
InputStream downloadBill(String url) throws WxPayException;
173
```
174
175
**Usage Example:**
176
177
```java
178
// Download daily transaction bill
179
WxPayBillRequest billRequest = WxPayBillRequest.newBuilder()
180
.billDate("20230101")
181
.billType(WxPayConstants.BillType.ALL)
182
.build();
183
184
WxPayBillResult billResult = wxPayService.downloadBill(billRequest);
185
String billData = billResult.getBillInfo();
186
```
187
188
### Complaint Management
189
190
Handle customer complaints and disputes.
191
192
```java { .api }
193
/**
194
* Get complaints service
195
* @return Complaint service instance
196
*/
197
ComplaintService getComplaintsService();
198
```
199
200
### Media Upload Services
201
202
Upload images and other media for marketing and documentation.
203
204
```java { .api }
205
/**
206
* Get merchant media service
207
* @return Media upload service instance
208
*/
209
MerchantMediaService getMerchantMediaService();
210
211
/**
212
* Get marketing media service
213
* @return Marketing media service instance
214
*/
215
MarketingMediaService getMarketingMediaService();
216
```
217
218
### Bank Services
219
220
Bank-related operations and queries.
221
222
```java { .api }
223
/**
224
* Get bank service
225
* @return Bank service instance
226
*/
227
BankService getBankService();
228
```
229
230
### Application Services
231
232
Merchant application and onboarding services.
233
234
```java { .api }
235
/**
236
* Get sub-merchant application service
237
* @return Application service instance
238
*/
239
Applyment4SubService getApplyment4SubService();
240
241
/**
242
* Get subject confirmation service
243
* @return Subject confirmation service instance
244
*/
245
Apply4SubjectConfirmService getApply4SubjectConfirmService();
246
```
247
248
### Payroll Services
249
250
Employee payroll and wage payment services.
251
252
```java { .api }
253
/**
254
* Get payroll service for employee payments
255
* @return Payroll service instance
256
*/
257
PayrollService getPayrollService();
258
```
259
260
### Business Circle Services
261
262
Smart business circle and location-based services.
263
264
```java { .api }
265
/**
266
* Get business circle service
267
* @return Business circle service instance
268
*/
269
BusinessCircleService getBusinessCircleService();
270
```
271
272
### Face Payment Services
273
274
Support for facial recognition payments.
275
276
```java { .api }
277
/**
278
* Get face authentication info for face payment setup
279
* @param request Face auth info request
280
* @return Face authentication result
281
* @throws WxPayException if authentication fails
282
*/
283
WxPayFaceAuthInfoResult getWxPayFaceAuthInfo(WxPayFaceAuthInfoRequest request) throws WxPayException;
284
285
/**
286
* Process face payment
287
* @param request Face payment request
288
* @return Face payment result
289
* @throws WxPayException if payment fails
290
*/
291
WxPayFacepayResult facepay(WxPayFacepayRequest request) throws WxPayException;
292
```
293
294
### Coupon Management
295
296
WeChat Pay coupon distribution and management.
297
298
```java { .api }
299
/**
300
* Send coupon to user
301
* @param request Coupon send request
302
* @return Coupon send result
303
* @throws WxPayException if sending fails
304
*/
305
WxPayCouponSendResult sendCoupon(WxPayCouponSendRequest request) throws WxPayException;
306
307
/**
308
* Query coupon stock information
309
* @param request Coupon stock query request
310
* @return Coupon stock information
311
* @throws WxPayException if query fails
312
*/
313
WxPayCouponStockQueryResult queryCouponStock(WxPayCouponStockQueryRequest request) throws WxPayException;
314
315
/**
316
* Query specific coupon information
317
* @param request Coupon info query request
318
* @return Coupon detailed information
319
* @throws WxPayException if query fails
320
*/
321
WxPayCouponInfoQueryResult queryCouponInfo(WxPayCouponInfoQueryRequest request) throws WxPayException;
322
```
323
324
### Additional Utility Services
325
326
```java { .api }
327
/**
328
* Query customer comments (for service improvement)
329
* @param beginDate Start date for comment query
330
* @param endDate End date for comment query
331
* @param offset Query offset
332
* @param limit Query limit
333
* @return Comment data as JSON string
334
* @throws WxPayException if query fails
335
*/
336
String queryComment(Date beginDate, Date endDate, Integer offset, Integer limit) throws WxPayException;
337
338
/**
339
* Query comment using request object
340
* @param request Comment query request
341
* @return Comment data as JSON string
342
* @throws WxPayException if query fails
343
*/
344
String queryComment(WxPayQueryCommentRequest request) throws WxPayException;
345
346
/**
347
* Query exchange rate for foreign currency
348
* @param feeType Currency type
349
* @param date Query date
350
* @return Exchange rate result
351
* @throws WxPayException if query fails
352
*/
353
WxPayQueryExchangeRateResult queryExchangeRate(String feeType, String date) throws WxPayException;
354
355
/**
356
* Get sandbox sign key for testing
357
* @return Sandbox signature key
358
* @throws WxPayException if retrieval fails
359
*/
360
String getSandboxSignKey() throws WxPayException;
361
362
/**
363
* Report API call statistics (for monitoring)
364
* @param request Report request with call statistics
365
* @throws WxPayException if reporting fails
366
*/
367
void report(WxPayReportRequest request) throws WxPayException;
368
```
369
370
## Service Integration Patterns
371
372
### Service Access Pattern
373
374
```java
375
// Get specialized service
376
MarketingFavorService favorService = wxPayService.getMarketingFavorService();
377
378
// Use service methods
379
CreateStockRequest request = new CreateStockRequest();
380
CreateStockResult result = favorService.createStock(request);
381
```
382
383
### Multi-Service Operations
384
385
```java
386
// Combine multiple services
387
EcommerceService ecommerce = wxPayService.getEcommerceService();
388
TransferService transfer = wxPayService.getTransferService();
389
ComplaintService complaint = wxPayService.getComplaintService();
390
391
// Orchestrate complex business flows
392
// 1. Process e-commerce transaction
393
// 2. Handle transfers
394
// 3. Manage any complaints
395
```
396
397
## Bill Types and Constants
398
399
### WxPayConstants.BillType
400
401
```java { .api }
402
class BillType {
403
String ALL = "ALL"; // All transactions
404
String SUCCESS = "SUCCESS"; // Successful transactions only
405
String REFUND = "REFUND"; // Refund transactions only
406
String RECHARGE_REFUND = "RECHARGE_REFUND"; // Recharge refunds
407
}
408
```
409
410
## Advanced Features
411
412
- **Multi-tenant Architecture**: Support for platform businesses
413
- **Marketing Automation**: Automated coupon distribution and management
414
- **Financial Reporting**: Comprehensive transaction and settlement reports
415
- **Dispute Resolution**: Automated complaint handling workflows
416
- **Compliance Tools**: Regulatory reporting and audit trail support