بنقرة واحدة
zuora-order-migration-design
Analyze customer code and produce Order API migration plan with field-accurate mappings
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Analyze customer code and produce Order API migration plan with field-accurate mappings
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Generate Credit Memos / Debit Memos migration implementation artifacts based on the plan
Produce Credit Memos / Debit Memos migration strategy, code inventory, and phases
This skill should be used when the user mentions "Zuora API", "Zuora SDK", "Zuora Billing", "Zuora Revenue", "Zuora CPQ", "Zuora Payments", "subscription billing", "invoice settlement", "zuora-mcp", "rate plan", "product rate plan charge", "order API", or discusses integration with Zuora systems. Do not activate for generic billing or subscription discussions that are not Zuora-specific.
Compose an importable Zuora Workflow JSON from a design or requirement
Design a Zuora Workflow-based solution
Generate legacy Zuora CPQ Apex, Visualforce, Component Library, zQuoteUtil, controller extension, or plugin-interface artifacts directly into a Salesforce DX repo
| name | zuora-order-migration-design |
| description | Analyze customer code and produce Order API migration plan with field-accurate mappings |
| argument-hint | ["customer code file paths or migration requirements"] |
| allowed-tools | ["Read","Write","Glob","Grep","Bash","Agent","mcp__zuora-mcp__ask_zuora","mcp__zuora-mcp__query_objects","mcp__zuora-mcp__zuora_codegen","mcp__zuora-mcp__get_account_summary"] |
Codex-only path resolution: When an instruction refers to ${CLAUDE_PLUGIN_ROOT}, treat it as the root of this installed plugin. In Codex, resolve that root as the ancestor directory containing skills/, references/, and .codex-plugin/.
You are analyzing customer integration code and producing an Order API migration plan. This migration moves subscription management from legacy Subscription/Amendment API and Subscribe Action API to the Order API, which provides a unified, action-based model.
The user's migration context: $ARGUMENTS
This could be:
Use local code reads and bundled Order/Amendment mapping references for endpoint inventory, field mappings, and migration-plan structure. Use mcp__zuora-mcp__zuora_codegen for exact Order API endpoint/model requirements, mcp__zuora-mcp__query_objects / mcp__zuora-mcp__get_account_summary for tenant state, and mcp__zuora-mcp__ask_zuora only when a specific Order API capability, limitation, or migration tradeoff remains unresolved after those sources.
If the user provides source code:
1.1 Read the provided code
1.2 Identify programming language
1.3 Detect Subscription/Amendment/Subscribe API patterns
Look for these endpoint patterns:
Python indicators:
# Subscription API
requests.post("*/v1/subscriptions")
requests.put("*/v1/subscriptions/*")
requests.put("*/v1/subscriptions/*/cancel")
requests.put("*/v1/subscriptions/*/suspend")
requests.put("*/v1/subscriptions/*/resume")
requests.put("*/v1/subscriptions/*/renew")
requests.post("*/v1/amendments")
# Subscribe Action API
requests.post("*/v1/action/subscribe")
Java indicators:
HttpPost("/v1/subscriptions")
HttpPut("/v1/subscriptions/")
new URI("*/v1/amendments")
HttpPost("/v1/action/subscribe") // Subscribe Action API
JavaScript/Node.js indicators:
fetch('*/v1/subscriptions', {method: 'POST'})
fetch('*/v1/subscriptions/*', {method: 'PUT'})
axios.post('*/v1/subscriptions')
fetch('*/v1/action/subscribe', {method: 'POST'}) // Subscribe Action API
axios.post('*/v1/action/subscribe') // Subscribe Action API
1.4 Catalog each API call
Output: Table of detected API calls with context
For each detected S/A API call, reference the verified mapping documents in ../references/:
Available Reference Mappings:
Subscription Cancel → Read ${CLAUDE_PLUGIN_ROOT}/references/amendment-rest-v1-cancel-api-mapping.md
PUT /v1/subscriptions/{key}/cancel to Order API CancelSubscription actionPOSTSubscriptionCancellationMeta, PostOrderActionCancelMetaSubscription Suspend → Read ${CLAUDE_PLUGIN_ROOT}/references/amendment-rest-v1-suspend-api-mapping.md
PUT /v1/subscriptions/{key}/suspend to Order API Suspend actionPUTSubscriptionSuspendMeta, PostOrderActionSuspendMetaSubscription Resume → Read ${CLAUDE_PLUGIN_ROOT}/references/amendment-rest-v1-resume-api-mapping.md
PUT /v1/subscriptions/{key}/resume to Order API Resume actionextendsTerm belongs in Resume action, not SuspendPUTSubscriptionResumeMeta, PostOrderActionResumeMetaSubscription Renew → Read ${CLAUDE_PLUGIN_ROOT}/references/amendment-rest-v1-renew-api-mapping.md
PUT /v1/subscriptions/{key}/renew to Order API RenewSubscription actionPOSTSubscriptionRenewalMeta, PostOrderActionRenewSubscriptionMetaSubscription Create → Read ${CLAUDE_PLUGIN_ROOT}/references/amendment-rest-v1-create-api-mapping.md
POST /v1/subscriptions to Order API CreateSubscription actionSubscription Update → Read ${CLAUDE_PLUGIN_ROOT}/references/amendment-rest-v1-update-api-mapping.md
PUT /v1/subscriptions/{key} to appropriate Order API actionsSubscribe Action → Read ${CLAUDE_PLUGIN_ROOT}/references/action-subscribe-api-mapping.md
POST /v1/action/subscribe to Order API CreateSubscription actionSubscribeMeta, PostOrderActionCreateSubscriptionMetaOutput: Mapping table showing each API call and its Order API equivalent
If tenant is connected and user wants data-driven analysis:
3.1 Query current state
mcp__zuora-mcp__query_objects to inspect:
3.2 Sample representative accounts
mcp__zuora-mcp__get_account_summary for typical accounts3.3 Call Zuora knowledge base
mcp__zuora-mcp__ask_zuora for unresolved Order API capability or best-practice questions; prefer checking the mapping references (Step 2) first when they are likely to have the answer. Skip this when local mappings already answer the issue.Output: Current state summary with statistics
Based on code analysis and tenant data:
Common edge cases:
Risk assessment:
invoice/collect → processingOptions.runBilling/collect)Output: Edge case list and risk matrix (likelihood, impact, mitigation)
Produce a comprehensive migration plan:
# Order API Migration Plan
**Generated:** {timestamp}
**Customer Code Analyzed:** {file_count} files, {line_count} lines
**Programming Language:** {language}
## Executive Summary
- **Total S/A API Calls Detected:** {count}
- **Operations:** {operation types: create, cancel, suspend, resume, renew, update, amendments}
- **Complexity:** {Low/Medium/High}
- **Estimated Effort:** {hours/days based on operation count and complexity}
### Why Migrate to Order API
- **Atomic operations**: Multiple subscription changes in one transaction
- **Future-dating**: Schedule changes in advance with precise control
- **Unified model**: Consistent action-based structure for all operations
- **Better error handling**: Transaction-level rollback
- **Enhanced flexibility**: Support for complex subscription scenarios
## Current State Assessment
### Detected API Calls
| File | Line | Current API | HTTP Method | Order API Equivalent |
|------|------|-------------|-------------|---------------------|
| customer_code.py | 45 | /v1/subscriptions/{key}/cancel | PUT | POST /v1/orders (CancelSubscription) |
| ... | ... | ... | ... | ... |
### Tenant Statistics (if available)
- Subscription count: {count}
- Active subscriptions: {count}
- Common charge models: {flat fee, per unit, tiered, etc.}
- Custom fields in use: {list}
## Field Mappings by Operation
[For each detected operation, include detailed field mapping from the reference documents]
### Example: Subscription Cancel Mapping
**Current Code (Subscription API):**
```python
# Line 45-52 in customer_code.py
response = requests.put(
f"https://rest.zuora.com/v1/subscriptions/{subscription_key}/cancel",
json={
"cancellationPolicy": "SpecificDate",
"cancellationEffectiveDate": cancel_date
}
)
Order API Equivalent:
POST /v1/ordersCancelSubscriptionorderDate, existingAccountNumbercancellationEffectiveDate → both triggerDates.triggerDate and cancelSubscription.cancellationEffectiveDateinvoiceCollect → processingOptions.runBilling and processingOptions.collect[Repeat for each operation]
orderNumber vs subscriptionId)[For each identified edge case:]
Edge Case: Suspend with resume date
Current Approach (S/A API):
Single call with resumeDate field
Order API Approach: Requires two separate actions in one order:
Suspend actionResume action with resumeSpecificDateMigration Impact: Code must be refactored to create two action objects
[Repeat for each edge case]
| Risk | Likelihood | Impact | Mitigation |
|---|---|---|---|
| Response parsing errors | High | Medium | Update all response handling code, add unit tests |
| Missing required fields | Medium | High | Thorough code review, sandbox testing |
| Integration breakage | Medium | High | Update integrations before cutover |
| ... | ... | ... | ... |
invoice/collect/invoiceCollect → processingOptions.runBilling and processingOptions.collectsubscriptions[].subscriptionNumbercontractEffectiveDate → triggerDates[{name: "ContractEffective", triggerDate: "..."}]type field in each actionRenewal terms must be pre-configured on the subscription. Order API uses existing settings.
RenewSubscription action relies on subscription's renewal term configuration
extendsTerm belongs in Resume action, not Suspend
When suspending with resume date, extendsTerm goes in the Resume action
[Add more gotchas from reference documents]
/zuora-order-migration-build [file-paths] to generate converted code${CLAUDE_PLUGIN_ROOT}/references/amendment-rest-v1-*-api-mapping.md${CLAUDE_PLUGIN_ROOT}/references/action-subscribe-api-mapping.md
**Output:** Complete migration plan document