PranavNagrecha/AwesomeSalesforceSkills / skills/admin/commerce-order-management
commerce-order-management
VerifiedUse this skill for Salesforce Order Management (OMS) tasks: order lifecycle, OrderSummary creation and status, FulfillmentOrder creation and routing, returns, exchanges, cancellations, and platform event subscriptions. Trigger keywords: order management, OrderSummary, FulfillmentOrder, ReturnOrder, ensure-funds, ensure-refunds, submit-cancel, submit-return, adjust-item-submit. NOT for split-order routing or Omnichannel Inventory design — use architect/order-management-architecture. NOT for loading historical orders — use data/commerce-order-history-migration.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 16.3 KB |
| references/examples.md | markdown | 8.1 KB |
| references/gotchas.md | markdown | 6.0 KB |
| references/llm-anti-patterns.md | markdown | 7.8 KB |
| references/well-architected.md | markdown | 5.2 KB |
| scripts/check_commerce_order_management.pyexecutable | script | 9.0 KB |
| templates/commerce-order-management-template.md | markdown | 3.6 KB |
templates/commerce-order-management-template.md
View on GitHub# Commerce Order Management — Work Template
Use this template when working on any OMS task: order lifecycle, fulfillment routing, cancellations, returns, payment jobs, or platform event wiring.
## Scope
**Skill:** `commerce-order-management`
**Request summary:** (fill in what the user asked for)
## Prerequisites Confirmed
Before starting, verify all of the following:
- [ ] Org has Salesforce Order Management or Commerce license provisioned
- [ ] Order is in `Activated` status (or we are configuring the activation trigger)
- [ ] `OrderLifeCycleType` decision documented: MANAGED / UNMANAGED (circle one — this is immutable after creation)
- [ ] Payment gateway configured (if ensure-funds or ensure-refunds is in scope)
- [ ] Confirmed this is NOT a CPQ order (CPQ orders do not create OrderSummary records)
## Context Gathered
Record the answers to the Before Starting questions from SKILL.md:
- OMS license status:
- OrderLifeCycleType chosen and reason:
- Upstream Order activation mechanism (Flow / Process / API / Checkout):
- Fulfillment location(s) involved:
- Payment gateway or method in use:
- Known constraints or limits:
## Task Type
Which category does this work fall into? (check one)
- [ ] OrderSummary creation / lifecycle setup
- [ ] FulfillmentOrder routing and status handling
- [ ] Cancellation (pre-fulfillment) via submit-cancel
- [ ] Return (post-fulfillment) via submit-return + ReturnOrder
- [ ] Price / quantity adjustment via adjust-item-submit
- [ ] Payment job wiring (ensure-funds-async / ensure-refunds-async)
- [ ] Platform event subscription (OrderSummaryCreatedEvent / FOStatusChangedEvent / OrderSumStatusChangedEvent / ProcessExceptionEvent)
- [ ] Debugging / investigation
## Approach
Which pattern from SKILL.md applies?
- [ ] Standard Fulfillment Flow (OrderSummaryCreatedEvent → routing → FulfillmentOrder)
- [ ] Cancellation and Return Flow (submit-cancel / submit-return)
- [ ] Custom approach — describe below:
Reason for pattern choice:
## Connect API Actions Used
List every Connect API action this implementation calls:
| Action | Purpose | Sync or Async |
|---|---|---|
| submit-cancel | Pre-fulfillment item cancellation | Synchronous |
| submit-return | Post-fulfillment return initiation | Synchronous |
| adjust-item-submit | Quantity or price adjustment | Synchronous (up to 3 ChangeOrders) |
| ensure-funds-async | Payment authorization / capture | Async — subscribe to ProcessExceptionEvent |
| ensure-refunds-async | Refund issuance | Async — subscribe to ProcessExceptionEvent |
(Delete rows not applicable to this task)
## Platform Events Subscribed
| Event | Handler (Flow / Apex) | Purpose |
|---|---|---|
| OrderSummaryCreatedEvent | | |
| FOStatusChangedEvent | | |
| OrderSumStatusChangedEvent | | |
| ProcessExceptionEvent | | Error handling for async payment jobs |
## Checklist
- [ ] OrderLifeCycleType confirmed and documented before OrderSummary creation
- [ ] No direct DML on OrderItemSummary, OrderItemAdjustmentLineSummary, or OrderItemTaxLineItemSummary in MANAGED mode
- [ ] All mutations use the correct Connect API action for the fulfillment status of the item
- [ ] ProcessExceptionEvent subscriber deployed before enabling ensure-funds-async or ensure-refunds-async
- [ ] FulfillmentOrder routing handles all OrderDeliveryGroupSummary records
- [ ] adjust-item-submit result processed as a list of ChangeOrders (up to 3), not a single record
- [ ] CPQ order scope boundary documented if CPQ is in the ecosystem
- [ ] Tested in sandbox end-to-end: Order activation → OrderSummary → FulfillmentOrder → status events
## Notes
Record any deviations from the standard pattern and why:
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |