Skip to content
Ayra Docs

Events

Everything that happens in Ayra is a typed event with a canonical name in the ay: namespace, a customer, a timestamp and a payload. Signals (facts), engine events (opportunities and decisions) and actions (things Ayra did or held) all use the same stream: it is what the customer timeline shows, what Shopify Flow triggers are built from, and what the post-beta API and webhooks will expose. The storefront bundle also dispatches a small set of DOM events so theme code can react without polling.

ay:<domain>.<event> in lower snake case. Domains match modules or the engine (order, customer, points, credit, tier, referral, segment, stage, opportunity, decision, action, review, question, wishlist, price, restock, preorder, subscription, support). Every payload carries customerId, occurredAt, source (shopify, storefront, account_hub, admin, engine, import) and eventId.

EventStatusMeans
ay:customer.createdLiveA Shopify customer record was created or first seen by Ayra
ay:customer.identifiedLiveA guest identity (email, device) was merged into a customer profile
ay:customer.loginLiveThe customer signed in to the storefront or account hub
ay:order.placedLiveOrder created in Shopify (any channel)
ay:order.paidLiveOrder financial status became paid; earn rules run here
ay:order.fulfilledLiveOrder fulfilled
ay:order.deliveredLiveDelivery confirmed by the carrier (or estimated when no tracking)
ay:order.refundedLiveFull or partial refund; reversals run here
ay:order.cancelledLiveOrder cancelled
ay:product.viewedLiveStorefront product view (web pixel)
ay:support.openedPlanned (integrations)A support issue was opened for the customer
ay:support.resolvedPlanned (integrations)The issue was resolved; Trust Recovery releases held actions after the delay
EventStatusMeans
ay:points.earnedLivePoints added by an earn rule, import or manual grant
ay:points.spentLivePoints redeemed (hub or checkout)
ay:points.expiredLivePoints expired
ay:points.expiringLiveExpiry is within the reminder window
ay:credit.issuedLiveStore credit issued to the customer’s Shopify account
ay:credit.reversedLiveStore credit clawed back after a refund or fraud check
ay:tier.changedLiveTier moved up or down
ay:referral.sharedLiveReferral link or code shared
ay:referral.clickedLiveA referral link was opened
ay:referral.orderLiveAn order was placed with a referral code (pending)
ay:referral.grantedLiveBoth rewards granted after the return window
ay:referral.reversedLiveReferral reward reversed (refund or Reward Shield)
EventStatusMeans
ay:stage.changedLiveLifecycle stage changed
ay:segment.enteredLiveCustomer entered a segment
ay:segment.exitedLiveCustomer left a segment
ay:intent.scoredPlanned (Wishlist)Intent score recomputed
ay:opportunity.createdLiveA pattern worth acting on was detected (type, priority, evidence, expiry)
ay:opportunity.convertedLiveAn order was attributed to the opportunity
ay:opportunity.expiredLiveThe opportunity expired without conversion
ay:decision.madeLiveThe engine chose a next best action (or NO_ACTION) for the customer
ay:action.sentLiveAn action was executed through a module and channel
ay:action.heldLiveJourney Guard held an action (cap, quiet hours, conflict, open issue)
ay:action.droppedLiveAn action was dropped (expired, Incentive Guard)
ay:action.respondedLiveThe customer engaged with the action (open, click, redeem)

Reviews, wishlist, back in stock, pre-order, subscriptions

Section titled “Reviews, wishlist, back in stock, pre-order, subscriptions”
EventStatusMeans
ay:review.requestedPlanned (Reviews)A review request was sent
ay:review.submittedPlanned (Reviews)A review was submitted (pending moderation)
ay:review.publishedPlanned (Reviews)A review was published; rating metafields updated
ay:question.askedPlanned (Reviews)A question was asked on a product
ay:question.answeredPlanned (Reviews)A question was answered
ay:wishlist.addedPlanned (Wishlist)Variant added to a wishlist
ay:wishlist.removedPlanned (Wishlist)Variant removed
ay:price.droppedPlanned (Wishlist)Price dropped on a wishlisted variant
ay:restock.registeredPlanned (Back in Stock)Customer registered for a restock alert
ay:restock.detectedPlanned (Back in Stock)Inventory went from zero to available
ay:restock.alertedPlanned (Back in Stock)A restock alert was sent
ay:preorder.placedPlanned (Pre-Order)A pre-order was placed
ay:preorder.fulfilledPlanned (Pre-Order)A pre-order shipped
ay:subscription.createdPlanned (Subscriptions)A subscription contract was created
ay:subscription.skippedPlanned (Subscriptions)A cycle was skipped
ay:subscription.cancel_intentPlanned (Subscriptions)Cancellation flow started; Save Engine runs
ay:subscription.savedPlanned (Subscriptions)A save offer (pause, skip, swap) was accepted
ay:subscription.cancelledPlanned (Subscriptions)Contract cancelled

The core bundle dispatches these on window for theme code. Payloads are in event.detail.

DOM eventWhendetail
ay:readyThe core bundle has loaded and read the shop settings{ modules, customer: boolean }
ay:customerThe customer was identified (or confirmed anonymous){ id, tier, stage } or null
ay:wallet.updatedWallet state fetched or changed{ total, points, storeCredit, vouchers }
ay:block.renderedA block finished hydrating{ block, element }
ay:wishlist.changedPlanned (Wishlist){ variantId, action }
window.addEventListener('ay:wallet.updated', (e) => {
  document.querySelector('[data-points]').textContent = e.detail.points;
});

Something missing or wrong on this page? Ask us and we will fix the docs.