This article applies to Contextual Commerce. (Looking for Classic Commerce documentation?)
This section of the documentation describes the order flow process and concepts. It is important to understand the order flow whether you are implementing the order flow by customizing your storefront with the Store Builder Library or FastSpring API or FastSpring is automatically handling the session, cart, and checkout procedures. The order flow is comprised of 5 phases:
- Checkout Preparation
- Customer Checkout
- Payment Processing
- Order Fulfillment
- Order Completed
Each phase is described below.
At this step you can choose one of the following options:
- Simply link to the product in your store by obtaining a link from the Dashboard. A Web Storefront will be used in this case and no additional integration is required.
- When advanced operations are desired (like overriding product information for a specific order, passing and capturing custom order and product attributes or applying customer Information to the order) you can create a "checkout session" using Store Builder Library or by making calls to the /sessions endpoint of the FastSpring API
- Optionally you can provide known customer information as part of the session preparation. More information can be found at Customer Information, Accounts and single sign-on.
- Created sessions can be checked out using either Web Storefront or Popup Storefront. Store Builder Library is required to initiate a checkout of the "prepared" checkout session.
This is where the customer determines the payment method they wish to use and provide their payment details. Additional details about customizing the flow can be found at corresponding storefronts:
Once a customer has submitted their payment details, the order, payment, and customer information is analyzed for potential fraud or other risk factors. If an issue is discovered, the order will be canceled and the order.failed webhook will fire. Valid orders will continue through the charging process. If the charge was successful, the order will move to the Order Fulfillment phase of the process. If the charge is unsuccessful, the order.failed webhook will fire and the order will be canceled.
If the order contained a subscription product, the subscription instance will be created. See Subscription Integration for more information regarding subscription integration.
The fulfillment of the order will not occur until the payment has been successfully processed. At that time FastSpring will attempt to fulfill the order. If any issues occur during the fulfillment of the order the fulfillment.failed webhook will fire. Once the fulfillment phase has been completed, the order will move to the Order Completed phase.
At this point in the process the order is basically finished. The order completion page is displayed to the customer, all order based emails are delivered, and the order.completed webhook is fired.
The following diagram explains each of the phases described above.
Order flow example with no errors during payment or fulfillment processing:
- Place a Store Builder Library to your website.
- Visitor attends your website where you can display localized pricing for products and maintain cart state using Store Builder Library.
- Visitor places products to the cart (without leaving your website).
- Session state is being maintained on the background (and will be kept for 24 hours).
- Visitor clicks "Checkout".
- Session state is "exchanged" to the Session ID and Session ID is used to redirect the customer to a FastSpring-hosted checkout or display a FastSpring-hosted popup store.
- Customer submits their payment details.
- Order is fulfilled.
- Order is completed.