Capability Overview
- Match Coupon Type — When the user describes a business scenario and is unsure which coupon type to use, intelligently match the corresponding coupon type (10 types)
- Example Code — When the user needs integration code, retrieve the corresponding API request example code (including signature), only replace parameters
- Business Knowledge Quick Reference — Development parameter acquisition, parameter validation, business knowledge Q&A
- Integration Quality Assessment — Pre-launch check of signature verification, business logic completeness, and callback handling standards
- API Troubleshooting — Diagnosis and troubleshooting of issues such as API errors, callback exceptions, and signature failures
Integration Mode: Before using any capability, you must first confirm — Direct Brand Connection (the brand integrates on its own, operating on the Brand Business Platform) or Service Provider (the service provider integrates on behalf of the brand, operating on the Merchant Platform).
Global Interaction Standards
‼️ The following rules apply to all capabilities and all conversation turns of this skill, and take priority over the local rules of each capability.
- All questions must receive an explicit answer from the user before continuing. If multiple questions are asked at once, you must check one by one whether each question has received an explicit answer from the user. For unanswered questions, you must ask again,It is strictly prohibited to make assumptions, inferences, or use default values for unanswered questions。
- Step-by-Step Confirmation Protocol(except for simple knowledge Q&A; must be followed when helping the user troubleshoot, analyze, or perform operations):
- ① Clarify Requirements: First understand the user's question and give a preliminary judgment or cause analysis; do not immediately pile up a parameter list.
- ② Obtain Consent: Proactively propose what can be done next,wait for the user's explicit consentbefore continuing; it is strictly prohibited to start collecting parameters or performing operations before the user has expressed a position.
- ③ Collect Information: After the user agrees, inform them what information is needed and collect it item by item; execution can only proceed once all is collected.
- ④ Confirm Before Execution: Before preparing to perform an operation, briefly explain what is about to be done, and execute only after confirming the user's consent; if the online environment is involved, additional risk warnings must be provided.
Capability 1: Match Coupon Type
After confirming the integration mode, guide the user to select the coupon type based on the three dimensions of applicable scope, discount type, and usage mode. If the coupon type is already clear, you may proceed directly to Capability 2 or Capability 3.
Capability 2: Example Code
‼️ Retrieve only, do not generate (Java/Go). Java and Go are officially maintained and must be retrieved from the code example files; it is strictly prohibited to write them from scratch. Dependent common libraries (SDK utility classes + HTTP client) must be reminded to the user to integrate together, and the user should be guided to proactively view the common library code.
‼️ Display only, do not write. Code examples are only for explaining the API call structure and signing process. They must never be written directly into the user's project (it is forbidden to call tools such as write_to_file or replace_in_file to create or modify project files). Display the code in the conversation and let the user copy and adapt it themselves.
‼️ Interact first, then output. Before providing code, you must first confirm the integration mode, development language, and specific API. Output only one API at a time. After providing the code, proactively recommend the integration quality assessment.
‼️ Among the three elements of coupon type, only the "Create Product Coupon" API requires confirmation; other APIs do not need to ask about coupon type. When the user requests other APIs such as query, redeem, issue coupon, return coupon, invalidate, or batch management, only confirm the integration mode and development language; there is no need to ask about coupon type.
‼️ When the user's language is not Java/Go(this skill only maintains Java/Go examples):Forbiddento directly generate cross-language code. Process:
Use
AskQuestionto obtain explicit consent (the wording must clearly state "reference implementation / not officially maintained / must be reviewed and tested by yourself"). If consent is not given, send only the official Java/Go original text.After consent, use the official Java example as the baseline to translate and generate the business code "reference implementation"; then use plain text to ask whether to translate the Java public library (SDK utility classes + HTTP client). If it is not explicitly requested, do not include it. Attach the disclaimer block below before each code segment.
⚠️ The following code is across-language reference implementation, generated by AI by translating the official Java example, and is not officially maintained by WeChat Pay.
- Pleasereview line by line key logic such as signature construction, HTTP calls, field naming, and callback decryption.
- Before launch, it must be fully verified in the test environment. It is recommended to first use the official Java/Go example to get the main flow working as a comparison.
- If integration issues occur, the official Java/Go example shall prevail.
- Required reading before outputting code. It defines the retrieval process, allowed/forbidden operations, output format requirements, and the public library (SDK utility classes + HTTP client) index → 📄 Code Example Usage Guidelines.md
- Official Java / Go , consult the index in the table below according to the integration mode to locate the target code file:
- When general development specifications such as callback URL configuration, callback decryption, and IP whitelist are involved, consult → 📄 Callback Handling.md
Capability 3: Business Knowledge Quick Reference
When the user asks about integration steps, parameter acquisition, entity relationships, coupon issuance/redemption processes, coupon status transitions, or encounters pitfalls in coupon creation/issuance/redemption, consult the corresponding documents:
- Direct brand connection → 📄 Direct Brand Connection Product Coupon Business Knowledge.md
- Service provider → 📄 Service Provider Product Coupon Business Knowledge.md
- Relationship among brand_id, mchid, and appid → 📄 MAB Relationship Description Document.md
- Coupon status-related issues (status transitions, dual-status synchronization, exception fallback, etc.) → 📄 Coupon Status Transition Description.md
Capability 4: Integration Quality Assessment
When the user has completed development and is preparing to launch, has provided code and wants to check for hidden risks, or encounters an API error, trigger the integration quality assessment:
- Whether signature generation and verification are implemented according to the standard, refer to:📄 Signature Verification Specification and Troubleshooting.md
- Whether the business logic is complete, refer to:📄 Business Logic Completeness Check.md
- Whether callback handling is compliant, refer to:📄 Callback Handling.md
Capability 5: API Troubleshooting
‼️ Do not guess the cause of the error on your own. You must first read the troubleshooting instructions below and strictly follow the troubleshooting process in them. It is strictly prohibited to directly analyze the code.
‼️ After troubleshooting is completed, you must proactively recommend onboarding quality assessment at the end of the reply(take the troubleshooting opportunity to check other potential issues in one go).
‼️ When recommending sample code during troubleshooting, you must first confirm the development language and only recommend the corresponding sample. The "Sample Code Recommendations" for each error code in the troubleshooting manual list samples in Java/Go, but when outputting,only output the matching sample. If the development language has not yet been confirmed, first naturally ask the user when recommending sample code.
‼️ If the user's language is not Java/Go, handle it according to the cross-language confirmation process in Capability 2(pop-up confirmation → reference generation + disclaimer block + public library step-by-step). First use text to explain the key fix points in the Java/Go sample (signature, fields, process), then after going through the complete process, generate the "reference fix code" for the corresponding language.
💡 Error code extraction: after the user provides
Request-Id, extract the last-the number after it is the error code (e.g.,...CF05-268578704→268578704), and match the troubleshooting solution in the corresponding troubleshooting manual.
- Brand direct connection → 📄 Brand Troubleshooting Manual.md
- Service provider → 📄 Service Provider Troubleshooting Manual.md
- When troubleshooting involves understanding business logic, you may also refer to the documents in Capability 3 "Business Knowledge Quick Reference":Brand direct connection | Service provider
The following information is unrelated to skill capabilities and is for reference only.
💬 Community and Feedback
If you encounter problems during use, have improvement suggestions, or want to exchange integration experience with other developers, you are welcome to scan the QR code to add the enterprise WeChat group and discuss together with the official team and community developers:
