Логотип Commerce Order Management

Commerce Order Management

Спільнота
PranavNagrecha
commerce-order-management

Use 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.

Огляд

ВидавецьPranavNagrecha
РепозиторійAwesomeSalesforceSkills
Назва навичкиcommerce-order-management
Зірки
26
Форки
5
Файли в пакеті
6
Посилання
  • Інструкції у форматі Markdown

    Файл SKILL.md, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

  • Файлів у комплекті: 6

    Скрипти, шаблони й довідкові матеріали, які модель може читати під час роботи. Файли доступні лише для читання й ніколи не виконуються.

  • Відкритий вихідний код

    Видавець на GitHub: PranavNagrecha. Перед установленням перегляньте вихідні файли навички.

Встановлення

Установіть навичку ШІ Commerce Order Management у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

1

Встановити в TypingMind

TypingMind встановлює навичку безпосередньо з її папки на GitHub — читає SKILL.md, збирає файли ресурсів у пакет і зберігає результат локально.

  1. Відкрийте застосунок і перейдіть до розділу «Плагіни» → «Навички».
  2. Виберіть «Встановити з GitHub».
  3. Вставте наведений нижче URL папки навички та підтвердьте встановлення.
    https://github.com/PranavNagrecha/AwesomeSalesforceSkills/tree/main/skills/admin/commerce-order-management
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Додати навичку → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
2

Встановити в іншому агенті

Будь-який агент, що підтримує формат Agent Skills, може використовувати цю навичку — скопіюйте папку до каталогу навичок цього агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/PranavNagrecha/AwesomeSalesforceSkills.git /tmp/AwesomeSalesforceSkills
mkdir -p .claude/skills
cp -r /tmp/AwesomeSalesforceSkills/skills/admin/commerce-order-management .claude/skills/commerce-order-management
Після копіювання перезапустіть Claude Code, щоб завантажити нову навичку.

Використовуйте навичку в TypingMind

Увімкніть навичку Commerce Order Management в будь-якому чаті TypingMind, і далі модель усе зробить сама. Назва й опис навички містяться в системному промпті, а щойно надходить відповідний запит, модель самостійно завантажує повні інструкції — вам не потрібно викликати навичку вручну, і до фактичного використання вона не витрачає токенів.

Модель самостійно завантажує навичку Commerce Order Management, щойно надходить відповідний запит.

Працює з будь-якою моделлю ШІ

Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для певного постачальника, тому навичка Commerce Order Management не прив’язана до моделі, для якої її створено. Установіть її один раз у TypingMind і використовуйте з GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama або локальною моделлю, яку ви запускаєте самостійно, — усе з вашими власними ключами API.

  • Завантажується лише за потреби

    Системний промпт містить лише назву й опис. Інструкції завантажуються за першого відповідного запиту, тож поки навичка не потрібна, токени на її інструкції не витрачаються.

  • Змінюйте моделі під час чату

    Оскільки навичка — це інструкції, а не код, зміна моделі не порушує її роботу: наступна модель читає той самий файл SKILL.md.

Інструкції навички

Це вміст файлу SKILL.md, який завантажує модель. Прочитайте його перед установленням — навичка містить інструкції, яких дотримуватиметься ваша модель.

Commerce Order Management

This skill activates when a practitioner needs to set up or extend Salesforce Order Management (OMS): creating OrderSummary records from activated Orders, building FulfillmentOrder routing logic, processing cancellations and returns through Connect API actions, handling async payment jobs, and subscribing to OMS platform events. It covers only OMS-licensed orgs — it does NOT cover CPQ orders or standard Salesforce Orders outside of OMS.


Before Starting

Gather this context before working on anything in this domain:

  • Confirm the org has a Salesforce Order Management or Commerce license. OMS objects (OrderSummary, FulfillmentOrder, ReturnOrder) and Connect API order management actions are unavailable without it.
  • Establish the OrderLifeCycleType for each OrderSummary before creation: MANAGED (all mutations must go through Connect API actions) or UNMANAGED (direct DML is allowed). This value is immutable after the OrderSummary record is created.
  • Verify the upstream Order is in Activated status before triggering OrderSummary creation. A Draft or non-activated Order will not produce a valid OrderSummary.
  • CPQ-generated Orders do NOT automatically create OrderSummary records and are not in scope for this skill.
  • Payment gateway and payment method setup must be confirmed before testing ensure-funds or ensure-refunds flows.

Core Concepts

Order Lifecycle in OMS

The canonical OMS object chain is:

Order (Activated)
  └── OrderSummary (OrderLifeCycleType: MANAGED | UNMANAGED)
        ├── OrderItemSummary (one per OrderItem, represents product line)
        └── OrderDeliveryGroupSummary (groups items by shipping address/method)
              └── FulfillmentOrder
                    └── FulfillmentOrderLineItem
ReturnOrder
  └── ReturnOrderLineItem

An Order must reach Status = Activated before the OMS trigger fires to create the OrderSummary. The OrderSummary represents the commercial truth of the order throughout its lifecycle and is the anchor for all downstream financial and fulfillment records.

MANAGED vs UNMANAGED OrderLifeCycleType

OrderLifeCycleType on the OrderSummary record controls whether the platform enforces Connect API usage for mutations:

  • MANAGED: All quantity and price changes to OrderItemSummary records must be made through Connect API core actions (submit-cancel, submit-return, adjust-item-submit). Direct DML (insert/update/delete) on OrderItemSummary in MANAGED mode will either fail with an exception or silently produce inconsistencies in financial summaries. Change orders are created automatically to track each adjustment.
  • UNMANAGED: Direct DML is permitted. Intended for custom or non-standard order scenarios that cannot conform to the OMS state machine.

This field is immutable after OrderSummary creation. Set it correctly during the Order-to-OrderSummary flow; it cannot be changed later.

Connect API Order Management Actions

All MANAGED-mode mutations are executed through named Connect API actions. Key actions:

ActionPurposeNotes
submit-cancelCancel one or more OrderItemSummary quantitiesProduces a ChangeOrder; eligible pre-fulfillment
submit-returnInitiate a return for fulfilled itemsCreates ReturnOrder + ReturnOrderLineItem records
adjust-item-submitAdjust item quantity or priceCan produce up to 3 separate ChangeOrders for pre/in/post-fulfillment splits
ensure-funds-asyncAuthorize or capture paymentEnqueued async job; errors surfaced via ProcessExceptionEvent
ensure-refunds-asyncIssue refund to customerEnqueued async job; errors surfaced via ProcessExceptionEvent

Platform Events for OMS

OMS publishes platform events at key lifecycle moments. Subscribe to these in Flow or Apex:

EventWhen it fires
OrderSummaryCreatedEventAfter an OrderSummary is created from an Order. Use to trigger downstream provisioning.
OrderSumStatusChangedEventWhen an OrderSummary's status changes (e.g., to Fulfilled, Cancelled).
FOStatusChangedEventWhen a FulfillmentOrder status changes (e.g., to Fulfilled, Cancelled).
ProcessExceptionEventWhen an async job (ensure-funds-async, ensure-refunds-async) encounters an error. You must subscribe to this event — payment failures are not surfaced through standard exception handling.

Common Patterns

Pattern: Standard Fulfillment Flow

When to use: An Order has been activated and items need to be routed to a fulfillment location for picking, packing, and shipping.

How it works:

  1. Order reaches Status = Activated (manually or through a Checkout flow).
  2. OMS trigger fires; OrderSummaryCreatedEvent is published.
  3. Subscribe to OrderSummaryCreatedEvent in a triggered Flow or Apex handler.
  4. In the handler, call the OMS routing engine or a custom routing Flow to create FulfillmentOrder records grouped by location and delivery group.
  5. FulfillmentOrder starts in Draft status; transition to Activated to release to the warehouse.
  6. Subscribe to FOStatusChangedEvent to react when warehouse marks items as shipped/fulfilled.
  7. Call ensure-funds-async to capture payment once fulfillment is confirmed.

Why not the alternative: Creating FulfillmentOrder records manually via DML without routing logic leads to incorrect location assignments and breaks the OMS inventory reservation model.

Pattern: Cancellation and Return Flow

When to use: A customer wants to cancel an unfulfilled item (pre-fulfillment cancel) or return a fulfilled item.

How it works:

Pre-fulfillment cancel:

  1. Call Connect API action submit-cancel with the OrderSummaryId and a list of {orderItemSummaryId, quantity} pairs.
  2. OMS validates eligible cancel quantity and creates a ChangeOrder.
  3. Call ensure-refunds-async to issue the refund. Subscribe to ProcessExceptionEvent for failures.

Post-fulfillment return:

  1. Call Connect API action submit-return with the OrderSummaryId and returned line items.
  2. OMS creates a ReturnOrder and ReturnOrderLineItem records.
  3. When the ReturnOrderLineItem is processed (item received), call ensure-refunds-async.

Why not the alternative: Manually updating OrderItemSummary quantities in MANAGED mode will either throw a DML exception or corrupt financial aggregates on the OrderSummary. Always use the Connect API actions.


Decision Guidance

SituationRecommended ApproachReason
Standard B2C or B2B order in OMS-licensed orgUse MANAGED OrderLifeCycleTypeEnforces financial consistency; Connect API actions create auditable ChangeOrders
Custom order scenario that cannot fit OMS state machineUse UNMANAGED OrderLifeCycleTypeAllows direct DML; but loses OMS financial-summary automation
Item cancellation before fulfillment startssubmit-cancel Connect API actionUpdates TotalCancelled quantities and creates ChangeOrder automatically
Item return after fulfillmentsubmit-return Connect API action + ReturnOrderCreates ReturnOrder records; eligible for ensure-refunds-async
Price or quantity adjustment spanning fulfillment statusadjust-item-submitCan produce up to 3 ChangeOrders to split pre/in/post-fulfillment amounts
Payment authorization or captureensure-funds-asyncAsync job; subscribe to ProcessExceptionEvent for error handling
Refund issuanceensure-refunds-asyncAsync job; subscribe to ProcessExceptionEvent for error handling
CPQ-generated Order needing OMS processingOut of scope — CPQ Orders do not create OrderSummarySeparate license and data model required; evaluate integration patterns instead

Recommended Workflow

Step-by-step instructions for an AI agent or practitioner working on this task:

  1. Verify prerequisites: Confirm OMS license is provisioned, the Order is in Activated status, and OrderLifeCycleType has been decided (MANAGED is the default for OMS implementations).
  2. Establish the OrderSummary: Ensure the Order activation triggers OrderSummary creation. Confirm that OrderLifeCycleType is set correctly before creation since it cannot be changed afterward. Subscribe to OrderSummaryCreatedEvent for downstream triggering.
  3. Configure fulfillment routing: Build or configure the routing logic (OMS routing engine or custom Flow/Apex) to create FulfillmentOrder records from OrderDeliveryGroupSummary records. Validate that FulfillmentOrders reference correct locations.
  4. Implement cancellation and return paths: Use submit-cancel for pre-fulfillment cancellations and submit-return for post-fulfillment returns. Never use direct DML on OrderItemSummary in MANAGED mode.
  5. Wire up async payment jobs: Invoke ensure-funds-async after fulfillment confirmation and ensure-refunds-async after return/cancel. Subscribe to ProcessExceptionEvent to catch and handle payment job failures.
  6. Subscribe to OMS platform events: Register event-triggered Flows or Apex for FOStatusChangedEvent, OrderSumStatusChangedEvent, and ProcessExceptionEvent to keep downstream systems synchronized.
  7. Test end-to-end in sandbox: Activate a test Order, verify OrderSummary creation, run a cancellation and a return through the Connect API, confirm ChangeOrder records are created, and verify ProcessExceptionEvent handling fires correctly.

Review Checklist

Run through these before marking work in this area complete:

  • OMS license is confirmed on the org
  • OrderLifeCycleType is set to the correct value before OrderSummary creation and has been documented — it cannot be changed after creation
  • All MANAGED-mode mutations use Connect API actions (submit-cancel, submit-return, adjust-item-submit) — no direct DML on OrderItemSummary
  • ProcessExceptionEvent subscription is in place for ensure-funds-async and ensure-refunds-async failures
  • FulfillmentOrder creation and routing logic handles all OrderDeliveryGroupSummary records
  • Platform event subscriptions (OrderSummaryCreatedEvent, FOStatusChangedEvent, OrderSumStatusChangedEvent) are deployed and tested
  • CPQ orders have been confirmed as out of scope; a separate integration path is documented if CPQ feeds into OMS

Salesforce-Specific Gotchas

Non-obvious platform behaviors that cause real production problems:

  1. OrderLifeCycleType is immutable after OrderSummary creation — If MANAGED is set and later the implementation requires direct DML, there is no API to change it. The OrderSummary must be deleted and recreated, which can orphan related financial records. Plan the lifecycle type carefully before go-live.
  2. Direct DML on OrderItemSummary in MANAGED mode silently corrupts totals — Updating QuantityCanceled or TotalPrice directly via Apex DML does not raise a reliable exception in all API versions; in some cases it succeeds but leaves the OrderSummary aggregate fields (TotalAdjustedProductAmount, etc.) in an inconsistent state that cannot be repaired without support.
  3. ProcessExceptionEvent is the only error signal from async payment jobs — ensure-funds-async and ensure-refunds-async are enqueued Queueable jobs. They do not throw exceptions to the calling context, and they do not log to standard Apex debug logs by default. If no ProcessExceptionEvent subscriber exists, payment failures are invisible at runtime.
  4. adjust-item-submit produces up to 3 ChangeOrders — If an adjustment spans items that are partially pre-fulfillment, in-fulfillment, and post-fulfillment, the platform creates a separate ChangeOrder for each segment. Code that assumes a single ChangeOrder per adjustment call will miss records.
  5. CPQ Orders do not create OrderSummary records — CPQ uses its own Order object but the OMS trigger that creates OrderSummary only fires for Orders provisioned through the Commerce/OMS activation path. A CPQ Order activated in the standard Salesforce UI will not produce an OrderSummary. Do not mix these paths.

Output Artifacts

ArtifactDescription
OrderSummary recordImmutable-lifecycle-type record representing the commercial truth of the order; anchor for all OMS financial and fulfillment records
FulfillmentOrder + FulfillmentOrderLineItemRouting unit sent to a specific fulfillment location; transitions through Draft → Activated → Fulfilled
ChangeOrderAudit record created by submit-cancel, submit-return, or adjust-item-submit; up to 3 per adjust-item-submit call
ReturnOrder + ReturnOrderLineItemReturn authorization and line-level return records created by submit-return
Platform event subscriptionsFlow or Apex triggers on FOStatusChangedEvent, OrderSumStatusChangedEvent, OrderSummaryCreatedEvent, ProcessExceptionEvent

Related Skills

  • commerce-checkout-configuration — Covers checkout flow setup that activates Orders feeding into OMS
  • commerce-product-catalog — Product and pricing setup upstream of OMS order creation
  • flow-for-admins — Building event-triggered Flows to subscribe to OMS platform events
  • quote-to-cash-process — End-to-end Q2C; references OMS as the fulfillment leg post-order activation

Official Sources Used

Файли в пакеті

Модель читає ці файли за потреби, поки навичку завантажено. Вони доступні для читання й ніколи не виконуються.

Поширені запитання

Що робить навичка ШІ Commerce Order Management?

Use 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.

Навіщо використовувати Commerce Order Management у TypingMind?

Тому що ви встановлюєте її один раз і використовуєте з будь-якою моделлю. Commerce Order Management — це звичайний Markdown, а не код для конкретного постачальника, тому та сама навичка працює з GPT-5, Claude, Gemini, Grok або локальною моделлю. Ви можете змінити модель навіть посеред чату, і навичка продовжить працювати. TypingMind використовує ваші власні ключі API, тож ви платите безпосередньо постачальникам замість передплати за кожне місце користувача, а ваші навички й чати залишаються у вашому сховищі.

Як встановити Commerce Order Management у TypingMind?

Відкрийте в TypingMind Плагіни → Навички → Встановити з GitHub і вставте https://github.com/PranavNagrecha/AwesomeSalesforceSkills/tree/main/skills/admin/commerce-order-management. TypingMind прочитає файл SKILL.md, додасть супровідні файли та встановить навичку, яку можна вмикати окремо для кожного чату.

Які моделі ШІ можуть використовувати Commerce Order Management?

Будь-яка модель, яку ви підключите в TypingMind. Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для конкретного постачальника, тому GPT, Claude, Gemini, Grok і локальні моделі можуть завантажувати цю навичку, коли запит їй відповідає.

Зі скількома моделями ШІ можна використовувати Commerce Order Management?

Зі скількома забажаєте. У TypingMind ви можете використовувати Commerce Order Management із будь-якою моделлю, яка підтримує навички, зокрема з GPT, Claude, Gemini, Grok, DeepSeek, Mistral чи Llama. Для цього ви використовуєте власні ключі API.

Чи безкоштовна навичка ШІ Commerce Order Management?

На GitHub цю навичку публікує PranavNagrecha. Умови ліцензування дивіться в репозиторії. Ви платите лише своєму постачальнику ШІ за використані токени.

Що таке навички ШІ?

Навичка ШІ — це набір інструкцій для повторного використання, який навчає модель ШІ виконувати одне конкретне завдання. Він відповідає відкритому формату Agent Skills: файл SKILL.md із назвою та описом, а також скрипти, шаблони чи довідкові файли, які можуть знадобитися моделі. Модель читає інструкції лише тоді, коли ваш запит відповідає навичці, тому встановлена навичка нічого не коштує, доки її не використано.

Чим навички ШІ відрізняються від плагінів або серверів MCP?

Плагін або сервер MCP надає моделі нові інструменти, які вона може викликати, — код, який десь виконується й повертає результат. Натомість навичка ШІ дає моделі знання й пояснює порядок дій: як підійти до завдання, яких кроків дотримуватися та яким має бути якісний результат. Навички — це звичайний Markdown, тож їм не потрібні ні сервер, ні ключ API, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі

Створіть власний робочий простір зі ШІ вже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇