Back to course: Commerce

Commerce | Reading Module

Customer Journey Investigation Patterns

Status: Not Started | Pass threshold: 100% | Points: 95

L2 35 min impact-analysis

Best score

0%

Attempts

0

Pass rate

0%

Passed

0

Completion happens in the checkpoint panel below.

Learning Guidance

Objectives

  • Trace user and order identifiers across service boundaries.
  • Differentiate successful orders from retry/abandonment paths.
  • Use action-based queries instead of message-string hunting.

Evidence To Capture

  • User journey timeline with order outcomes.
  • Payment authorization status and decline reasons.
  • Order lifecycle transitions with event actions.

Source Artifacts

Internal source references are available for maintainers but are not exposed in deployed environments.

Field Evidence

Real incidents related to what you're learning.

Module Content

Not Started

Key Takeaways

  • Login as registered user OR continue as guest
  • Select a store (localization)
  • Order submitted to store
  • *Use @event.action:** to find all events, then filter by specific actions
  • Never search message strings like "confirm order successful" - use @event.action:order_confirmed

Overview

This document describes how to trace a customer's order journey through the Commerce platform to determine if they successfully placed an order or abandoned.


Business Context

Customers visit our brand websites (kfc.com, tacobell.com, pizzahut.com) or mobile apps and:

  1. Login as registered user OR continue as guest
  2. Select a store (localization)
  3. Add items to cart
  4. Checkout and pay
  5. Order submitted to store

Happy path: Payment approved → Order confirmed to store Unhappy path: Payment declined → Order rejected → Customer may retry or abandon


Key Identifiers

FieldDescriptionExample
@user.idCustomer UUID (registered users)9c3d487c-69fe-41b8-8b91-f24c887ec999
@customer.idSame as user.id in most contextsSame UUID
@order.idUnique order identifier6206771c-45d4-4a8a-8932-efc217113517
@session.idBrowser/app sessionBase64 encoded string

Key insight: A @user.id can have multiple @order.ids - one per order attempt.


Services in the Order Flow

ServiceRoleKey Events
idpserviceAuthenticationcustomer.logged_in, customer.send_credentials
customer-dgsCustomer dataProfile lookups, session management
go-cart-dgsCart operationsPOST /graphql for cart mutations
loyalty-dgsRewards/offersCheetah API calls (KFC), Punchh (TB/PH)
payment-dgsPayment processingauthorization complete, @metadata.status
workflowserviceOrder orchestrationconfirm order successful, submission rejected
order-dgsOrder datagetOrderById, getBaseOrderHistory
delivery-dgsDelivery infogetStoreByNumber

Quick Investigation Queries

CRITICAL: Query on structured event attributes, NOT message content strings.

Full User Journey

env:production @user.id:<UUID>

Use storage_tier: flex for historical data (beyond hot storage).

Order Lifecycle Events (PREFERRED METHOD)

@user.id:<UUID> @event.action:* service:workflowservice

This returns all order status transitions with structured attributes you can filter on.

Did Payment Succeed?

env:production @user.id:<UUID> @event.action:* service:payment-dgs

Check @metadata.status: APPROVED vs DECLINED

Was Order Confirmed?

env:production @user.id:<UUID> @event.action:order_confirmed service:workflowservice

Was Order Rejected?

env:production @user.id:<UUID> @event.action:update_order_submission_rejected service:workflowservice

Specific Order Details

env:production @order.id:<UUID>

Combined User + Order Search

env:production (@user.id:<UUID> OR @order.id:<UUID>)

Query Tips

  • *Use @event.action:** to find all events, then filter by specific actions
  • Never search message strings like "confirm order successful" - use @event.action:order_confirmed
  • Filter by @event.outcome:success to see only successful completions

Key Attributes for Payment Authorization

From payment-dgs "authorization complete" logs:

AttributeValuesMeaning
@metadata.statusAPPROVED, DECLINEDTHE key field - did payment work?
@metadata.decline_reasonDECLINED-XXX, etc.Why payment failed
@metadata.amountInteger (cents)Order total (divide by 100 for dollars)
@metadata.tender_typeBC, GC, MPBank Card, Gift Card, Mobile Pay
@metadata.tender_product_typeVS, MC, AX, DVVisa, Mastercard, Amex, Discover
@metadata.last_four9015Last 4 digits of card
@metadata.occasionCARRYOUT, DELIVERYOrder type
@store.numberH690006Store ID
@order.idUUIDLinks to order
@metadata.payment_method_idUUIDWhich saved payment method

Key Attributes for Order Status

From workflowservice logs:

AttributeValuesMeaning
@event.actionSee table belowTHE key field - what transition happened
@evt.nameSame as event.actionEvent type name
@event.outcomesuccess, info, failureDid action complete?
@order.currentStatusPENDING, CONFIRMED, etc.Status BEFORE transition
@statusCONFIRMED, COMMITTED, etc.Target status being set
@channelWEB, ANDROID, IOS, CALLCENTEROrder channel
@organizationkfc_us, tb_us, ph_usBrand + market
@order.occasionCARRYOUT, DELIVERY, DRIVE_THRUOrder type
@store.number028718Store ID
@order.inStoreOrderId977370In-store order number

Event Actions for Order Lifecycle

Event ActionTransitionDescription
order_cart_reset-Cart reset at order start
confirm_orderPENDING → CONFIRMEDOrder confirmed to store
order_confirmedPENDING → CONFIRMEDConfirmation complete
commit_orderCONFIRMED → COMMITTEDStore committed to making order
order_committedCONFIRMED → COMMITTEDCommitment complete
ready_orderCOMMITTED → READYOrder ready for pickup
order_readyCOMMITTED → READYReady complete
fulfill_orderREADY → FULFILLEDOrder picked up/delivered
order_fulfillREADY → FULFILLEDFulfillment complete
close_orderFULFILLED → CLOSEDOrder closed, payment captured
reject_order→ REJECTEDStore rejected order
cancel_order→ CANCELEDOrder canceled
fail_order→ FAILEDOrder failed (payment, transmission, etc.)
update_order_submission_rejected- → REJECTEDPayment/submission failed

Order Status Flow (Complete)

Reference: Confluence - Order Status and Timers

Happy Path

PENDING (order submitted, transmitted to brand)
   ↓
CONFIRMED (brand confirmed order)
   ↓
COMMITTED (pushed to kitchen, customer checked in)
   ↓
READY (order ready for pickup)
   ↓
FULFILLED (customer received order, sent for payment capture)
   ↓
CLOSED (payment captured - automatic transition)

Unhappy Paths

PENDING/CONFIRMED → REJECTED (store cannot prepare order)
PENDING/CONFIRMED → CANCELED (customer canceled, store closed, daypart)
PENDING/CONFIRMED/COMMITTED/READY → FAILED (payment failed, transmission timeout, delivery failed)

All Order Statuses

StatusAllowed FromDescriptionSystem Reasons
PENDING-Order submitted, transmitted to brand-
CONFIRMEDPendingBrand confirmed the order-
COMMITTEDPending, ConfirmedPushed to kitchen, customer checked in-
READYCommittedOrder ready for pickup-
FULFILLEDPending, Confirmed, Committed, ReadyOrder fulfilled, sent for payment captureAutoBump timer expired
CLOSEDFulfilledPayment captured (automatic)Payment captured, AutoBump timer expired
CANCELEDPending, ConfirmedOrder canceledCommitment Deadline Exceeded
REJECTEDPending, ConfirmedStore rejected orderAutoBump timer expired
FAILEDPending, Confirmed, Committed, ReadyInternal/external failureTransmission Timeout, Payment failed, Poll capture declined, Store Closed

Order Timers

TimerDescriptionDefault
Confirmation DeadlinePending orders must be confirmed before expiry15 mins
Commitment DeadlineConfirmed orders must be committed (based on store close/daypart)Varies
AutobumpAuto-transitions order based on brand config15 mins

Autobump Behavior (TB example):

  • If order is CONFIRMED → Autobump REJECTS (TB-specific)
  • If order is COMMITTED or READY → Autobump FULFILLS

Identifying Success vs Abandonment

SignalQueryMeaning
Successful order@event.action:order_confirmed @event.outcome:successOrder confirmed to store
Order fulfilled@event.action:order_fulfill @event.outcome:successCustomer received order
Order closed@event.action:close_order @event.outcome:successComplete happy path
Payment declined@metadata.status:DECLINED service:payment-dgsPayment failed
Order rejected@event.action:update_order_submission_rejectedOrder couldn't complete
Cart abandonedActivity in go-cart-dgs but no payment-dgs authDidn't attempt checkout
Browsing onlycustomer.logged_in but no cart/order activityWindow shopping

Example Investigations

Example 1: Customer Reports Order Didn't Go Through

Scenario: Customer reports order didn't go through (unhappy → happy path recovery)

Step 1: Search all order lifecycle events

@user.id:9c3d487c-69fe-41b8-8b91-f24c887ec999 @event.action:* service:workflowservice

Step 2: Check payment authorizations

@user.id:9c3d487c-69fe-41b8-8b91-f24c887ec999 @event.action:* service:payment-dgs

Look for @metadata.status: APPROVED vs DECLINED

Step 3: Analyze results

Time (ET)Order ID@metadata.statusReason
8:57 AM6206771c...DECLINEDDECLINED-XXX
9:00 AM9c7a1d02...APPROVED-

Conclusion: First payment declined, customer retried with different @metadata.payment_method_id and succeeded.


Example 2: Trace Complete Happy Path

Scenario: Verify customer's order was fulfilled (TB DRIVE_THRU)

Step 1: Get all workflowservice events for user

@user.id:99aa11a1-f8d9-4033-bc52-cabb2e5c42df @event.action:* service:workflowservice

Step 2: Timeline of events

Time (ET)@event.actionFrom StatusTo Status
9:00 PMconfirm_orderPENDINGCONFIRMED
9:07 PMcommit_orderCONFIRMEDCOMMITTED
9:13 PMready_orderCOMMITTEDREADY
9:14 PMfulfill_orderREADYFULFILLED
9:14 PMclose_orderFULFILLEDCLOSED

Key Attributes:

  • @organization: tb_us
  • @channel: WEB
  • @order.occasion: DRIVE_THRU
  • @store.number: 028718
  • @order.total: 2906 (= $29.06)

Conclusion: Complete happy path - order confirmed, made, picked up, and closed.


Loyalty Providers by Brand

BrandProviderAPI Domain
KFCCheetah Digitalcust1262.cheetahedp.com
Taco BellCheetah Digitalcust1333.cheetahedp.com
Pizza HutPunchh*.punchh.com

Loyalty Events (from loyalty-dgs):

  • points_earned - Customer earned loyalty points
  • points_burned - Customer redeemed points for reward

Tips

  1. *Query on @event.action:** - Never search message strings, use structured attributes
  2. Use Flex storage for historical searches - storage_tier: flex
  3. Always get extra_fields - use ["*"] to see all attributes
  4. One user can have multiple orders - each attempt gets new order.id
  5. Different payment_method_id = customer used different card
  6. Check both user.id AND order.id - combined search gives full picture
  7. Filter by @event.outcome:success - to see only successful completions
  8. Use @order.currentStatus - to see status BEFORE the transition
  9. @metadata.decline_reason - Only exists on DECLINED transactions (not on APPROVED)

Query Patterns That Work (Avoid 500 Errors)

DO - These queries work reliably:

# Order lifecycle events - one service at a time
@user.id:<UUID> @event.action:* service:workflowservice

# Payment events - one service at a time
@user.id:<UUID> @event.action:* service:payment-dgs

# Specific order's payment details
@order.id:<UUID> service:payment-dgs

# Check for closed orders
@user.id:<UUID> @event.action:close_order service:workflowservice

DON'T - These cause 500/timeout errors:

# Complex OR across different field types - BAD
@user.id:<UUID> (@event.action:close_order OR @metadata.status:APPROVED)

# Wildcard on metadata fields - BAD
@user.id:<UUID> @metadata.status:*

# Mixing multiple services in OR - BAD
@user.id:<UUID> (service:payment-dgs OR service:workflowservice)

Query Rules:

  1. One service per query - don't mix services
  2. Avoid complex OR clauses - run separate queries instead
  3. Don't wildcard metadata fields - query specific values
  4. Time window: Start now-2d, expand to now-3dnow-7d if needed
  5. Always use storage_tier: flex for historical data

Update Log

DateChange
2026-01-26Initial customer journey documentation
2026-01-26Added complete order lifecycle (PENDING→CONFIRMED→COMMITTED→READY→FULFILLED→CLOSED)
2026-01-26CRITICAL: Updated queries to use @event.action:* instead of message strings
2026-01-26Added event action reference table for workflowservice
2026-01-26Fixed TB loyalty provider (Cheetah cust1333, not Punchh)
2026-01-26Added unhappy path statuses (CANCELED, REJECTED, FAILED) from Confluence docs
2026-01-26Added Order Timers (Confirmation Deadline, Commitment Deadline, Autobump)
2026-01-26Added Autobump behavior (TB-specific: rejects if CONFIRMED, fulfills if COMMITTED/READY)
2026-01-26Added Query Patterns section - DO/DON'T patterns to avoid 500 errors
2026-01-26Note: @metadata.decline_reason only exists on DECLINED (not APPROVED)

Reading Checkpoint

Current score: 0%

Sections complete

0/0

Checkpoint confirmed

Not yet

Reflection

0 chars

Completion requires 80% section coverage, checkpoint confirmation, and a short reflection. On completion, you will move to the next module automatically.

Add 40 more characters.

Mark at least 80% of sections complete.