Orders API

Orders API

Custom preferences:

Go to Business Manager → Merchant Tools → Site Preferences → Custom Preferences → Extend

  1. Configure the provided Extend credentials in the following fields (refer to this section on Custom Preferences for additional info):
    1. Extend Access Token
    2. Extend Store ID
  2. Configure the following Orders API specific preferences:
    1. Extend Integration Method: set this to Orders API on Order Create (please confirm with the Extend project delivery team).

Testing:

  1. LeadToken:
    Go to PDP Choose product variation Click “Add to Cart” button Go to cart Go to checkout page Make a purchase.
    Result:
    Go to Merchant Tools Ordering Orders Choose Your Order Shipment Choose ProductLineItem Attributes

  1. Extend Contract ID:
    Go to PDP → Choose product variation → Choose an extension plan → Click “Add to Cart” button→ Go to cart → Go to checkout page → Make a purchase.
    Result:
    Go to Merchant Tools → Ordering → Orders → Choose Your Order → Shipment → Choose ExtendLineItem → Attributes

  1. Refund status:
  • Go to PDP → Choose product variation → Choose an extension plan → Click “Add to Cart” button→ Go to cart → Go to checkout page → Make a purchase.
  • Then Go to Merchant Tools → Ordering → Orders → Choose Your Order → Order Status → Choose “Cancelled” → Click “Apply” button.
  • Then Go To Administration → Operations → Jobs → “Create Refund from SFCC” → Click “Run Now” button.
    Result:
    Go to Merchant Tools → Ordering → Orders → Choose Your Order → Shipment → Choose ExtendLineItem → Attributes:

Go to Merchant Tools → Ordering → Orders → Choose Your Order → Attributes:

Refund Statuses:
refund_quoted: Refund amounts have been previewed by merchant/customer at least once, but merchant has not reported that they have refunded the customer yet.
refund_paid: Refund has been reported as paid by the merchant. Contract is canceled. Finance will credit the merchant in the next monthly invoice.
refund_denied: Customer is not eligible for a refund. Customer has consumed all entitlements associated with the contract.Get Refund via Contract ID.
ERROR: service call error.

Extend SDK Analytics

Custom preferences:

  1. Go to Business Manager → Merchant Tools → Site Preferences → Custom
    Preferences → Extend
  2. Fill the “Extend SDK” field.
    This is needed to use URL for the JS script to connect third-party script

  1. Make sure that “Yes” is selected in “Extend Analytics Switch” option.

This is needed to connect third-party script.

Tracking events

  1. Extend.trackOfferViewed:
    This method fires whenever an Extend warranty offer is rendered on the screen to a user.

  1. Extend.trackProductAddedToCart:
    This event takes the product's “productId” and the number of units the customer wishes to add to the cart. This method fired when a user adds a product to the
    cart.

  1. Extend.trackOfferAddedToCart
    This event takes product’s “productId” and the number of units, along with the warranty’s “planId”. This method fires when a customer has added an Extend warranty to the cart.

  1. Extend.trackOfferRemovedFromCart
    This event takes the “planId” of the Extend warranty, and the associated “productId” of the product the warranty would have covered. This method is used to track when a customer has removed an Extend warranty from the cart.

  1. Extend.trackOfferUpdated
    This event takes the “planId” of the Extend warranty, and the associated “productId” of the product the warranty covers, as well as an update object containing to set of updates to apply to the warranty offer. This method is used to track when a customer increments or decrements the quantity of a warranty that has already been added to the cart. If the quantity of warranty is updated to 0, the a Extend.trackOfferRemoved event is called, and further updates to this planId/productId will result in a no-op until it is re-added via Extend/trackOfferAddedToCart.

  1. Extend.trackProductRemovedFromCart
    This event takes the “productId” of the product being removed from the cart. This method is used to track when a customer removes a product from the cart that does not have a warranty offer associated with it.

  1. Extend.trackProductUpdated
    This event takes the “productId” of the product being updated, as well as an updates object containing the set of updates to apply to the product. This method is used to track when a customer increments or decrements the quantity of a product that has already been added to the cart. The product being updated must not be associated with a warranty offer.
    If the “productQuantity” passed into this method is 0, then Extend.trackProductRemoveFromCart is fired.

  1. Extend.trackCartCheckout
    This method is triggered when a customer completes a purchase.
  • After the Checkout flow is complete (at Order Confirmation page), there fires two tracking events - offer_sold, and total_cart_revenue

  • After the Checkout flow is complete (at Order Confirmation page), there fires two tracking events called - product_sold and total_cart_revenue


What’s Next
Did this page help you?