EN

Post-Purchase Upsells & Order Edit Lifecycle — RUTHH COD Form & Upsells

Configure Sales Booster → Post-Purchase Upsells (/app/sales-booster/post-purchase-upsells) and understand how accepted post-order offers are added to the original Shopify COD order using orderEditBegin, orderEditAddVariant, orderEditAddLineItemDiscount, and orderEditCommit.

  • Order Creation Mode in Settings → General (/app/settings/general) is set to Standard COD Order (orderCreate), NOT Save as Draft Order.
  • After-Purchase Destination is set to the In-Modal Thank You View (M15_MODAL).

1. Configure a Post-Purchase Upsell Offer in Admin

Section titled “1. Configure a Post-Purchase Upsell Offer in Admin”
  1. Navigate to Sales Booster → Post-Purchase Upsells (/app/sales-booster/post-purchase-upsells).
  2. Click Create post-purchase offer.
  3. Select the trigger eligibility (all orders or specific trigger products/collections).
  4. Choose the upsell product/variant to offer and configure its post-purchase discount (PERCENTAGE or FIXED_AMOUNT).
  5. Customize the offer headline, urgency timer/copy, and accept/decline buttons, then click Save.

2. How the Post-Purchase Order Edit Lifecycle Works

Section titled “2. How the Post-Purchase Order Edit Lifecycle Works”

When POST_PURCHASE_RUNTIME=enabled is active and a buyer submits a standard COD order:

  1. Initial Order Creation: The buyer’s primary COD order is created immediately in Shopify via orderCreate so the base sale is never put at risk even if the buyer closes their browser during the post-purchase step.
  2. Offer Presentation: Before showing the final confirmation screen inside M15_MODAL, the storefront presents the eligible Post-Purchase Upsell offer.
  3. One-Click Acceptance & Order Edit Reconciliation: If the buyer clicks Accept:
    • The server verifies the signed post-purchase token and checks that the offer has not already been redeemed (idempotency guard).
    • The server calls Shopify Admin GraphQL orderEditBegin on the newly created Shopify order.
    • It adds the upsell variant via orderEditAddVariant and applies the configured discount via orderEditAddLineItemDiscount.
    • It commits the edit via orderEditCommit and appends audit tags/notes.
  • Draft Orders Cannot Be Edited via orderEditBegin: Shopify’s Order Edit GraphQL API operates only on finalized Order objects (gid://shopify/Order/...). When a store uses Save as Draft Order (draftOrderCreate), the server automatically skips post-purchase offer presentation.
  • Unfulfilled / Editable Order State Required: If an external ERP or fulfillment automation immediately archives or locks the Shopify order within milliseconds of creation, orderEditBegin may be rejected by Shopify; in that case, the original COD order remains intact.
  • Post-purchase offer does not appear after order submission:
    1. Check whether POST_PURCHASE_RUNTIME=enabled is active for your environment.
    2. Confirm Settings → General is set to Standard COD Order and In-Modal Thank You View (M15_MODAL).
    3. Confirm the offered upsell variant is in stock and not identical to an excluded item.