This article describes the order flow process and concepts. It can be helpful to understand the order flow regardless of whether you are planning to use a Web Storefront, a Popup Storefront, or a custom solution. (For example, using Store Builder Library or the FastSpring API.)
The order flow consists of 5 phases:
- Checkout Preparation
- Customer Checkout
- Payment Processing
- Order Fulfillment
- Order Completed
Each phase is described below.
The first step is to set up the order details. There are a variety of ways you can do this:
- Add hyperlinks from your website, email campaign, or social media to the desired product and Storefront by obtaining a link from the FastSpring App. This method involves using a Web Storefront, and no additional integration is required.
- You may require more operations (like overriding product information for a specific order or passing and capturing custom order and product attributes). In such cases, you can create a “checkout session” using the 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. You can find more information at Customer Information + Account Security.
- After creating a session, you can initiate checkout using either a Web Storefront or a Popup Storefront. If you plan to use a Popup Storefront, Store Builder Library is required to initiate a checkout of the “prepared” checkout session.
This step is where the customer determines the payment method they wish to use and provides their payment details. You can find additional details about customizing the flow for each type of Storefront:
Once the customer has submitted their payment details, FastSpring analyzes the transaction information for potential fraud or other risk factors. If an issue is discovered, the order is canceled and the order.failed webhook event fires. Valid orders continue through the charging process. If the charge is successful, the order moves to the Order Fulfillment phase of the process. If the charge is unsuccessful, the order.failed webhook event fires, and the order is canceled.
If the order contains a subscription product, a subscription instance is created. See Integrating your Tools with FastSpring Subscriptions for more information regarding subscription integration.
The fulfillment of the order does not occur until the payment has been successfully processed. At that time, FastSpring attempts to fulfill the order. If any issues occur during the fulfillment of the order, the fulfillment.failed webhook event fires. Following the fulfillment phase, the order moves to the Order Completed phase.
At this point in the process, the order is finished. The order completion page appears to the customer, all relevant email messages are sent, and the order.completed webhook event fires.
The following diagram explains each of the phases described above.
Example of an order flow with no errors during payment or fulfillment processing:
- Add the Store Builder Library to your website.
- A visitor lands on your website, where you can display localized pricing for products and maintain the cart state using the Store Builder Library.
- The visitor adds products to the cart (without leaving your website).
- The session state is maintained in the background (and will be kept for 24 hours).
- The visitor clicks “Checkout.”
- The session details are passed to a Web Storefront or a Popup Storefront.
- The customer submits their payment details.
- The order is fulfilled.
- The order is completed.