Understand how data flows between Bolt's SFRA Cartridge, Bolt's backend, and OCAPI.
INFO
The Bolt Checkout Package integrates the data flows described below out-of-the-box. This article explains in detail how Bolt passes data between the shopper, Bolt Cartridge, Bolt backend and OCAPI.
Sequence Diagrams for Bolt’s SFRA Integration
The Bolt Checkout data flow is powered by Bolt’s integration with the Salesforce Open Commerce API (OCAPI).
Pre-Checkout: Initializing Bolt
The Bolt Cartridge provides the Basket ID to Bolt’s FetchCart API. Bolt uses an OCAPI Session Bridge to get the shopper’s basket, tokenize the cart data, and return a Bolt Order Token to the SFRA Storefront. With a valid Bolt Order Token, Bolt’s frontend JavaScript can execute the BoltCheckout.configure()
function to initialize and render the Bolt iFrame.
sequenceDiagram
Shopper->>Bolt Cartridge: Selects the Bolt Checkout Button
Bolt Cartridge->>Bolt Backend: /v1/order/fetch_cart {dwsid cookie}
Bolt Backend->>OCAPI: Requests a JWT via the /customers/auth resource
OCAPI-->>Bolt Backend: JWT
Bolt Backend->>OCAPI: Fetch the shopper's basket via the /basket/{basket_id} resource
OCAPI-->>Bolt Backend: SFCC Basket Object
Bolt Backend->>Bolt Backend: Tokenizes basket data
Bolt Backend-->>Bolt Cartridge: Bolt Order Token
Bolt Cartridge-->>Shopper: Renders Bolt Checkout modal
Checkout
The Bolt Checkout Modal is an iFrame hosted by Bolt. Once the shopper begins checkout, Bolt’s backend communicates with OCAPI to get, update, and create data within SFCC.
Below is an example of the One-Click flow when a logged-in shopper launches checkout:
sequenceDiagram
Shopper->>Bolt Checkout: Logged in shopper launches checkout
Bolt Checkout->>Bolt Backend: /v2/checkout UpdateShippingAddress
Bolt Backend->>OCAPI: GET /baskets/{basket_id}
OCAPI-->>Bolt Backend: Basket
Bolt Backend->>OCAPI: PUT /baskets/{basket_id}/customer
OCAPI-->>Bolt Backend: Basket
Bolt Backend->>OCAPI: GET /baskets/{basket_id}/shipments/me/shipment_methods
OCAPI-->>Bolt Backend: Applicable Shipping Methods
Bolt Backend-->>Bolt Checkout: Renders Shipping Options
Bolt Checkout->>Bolt Backend: /v2/checkout UpdateTax
Bolt Backend->>OCAPI: PUT /baskets/{basket_id}/shipments/me/shipment_methods
OCAPI-->>Bolt Backend: Basket
Bolt Backend-->>Bolt Checkout: Renders Tax Value
Shopper->>Bolt Checkout: One-Click Order Placement
Order Creation & Payment Authorization
Bolt uses a PreAuth Order Creation flow, meaning Bolt first updates the basket with the required attributes and creates the order in Commerce Cloud before attempting to authorize the shopper’s payment.
If merchants use SFCC to send order confirmation emails, the Bolt cartridge includes a controller which will call required B2C Script API.
After an order is created successfully Bolt will update the order asynchronously as the Bolt Transaction status is updated. See SFCC Order Status Mapping for the expected order, payment, and confirmation statuses.
sequenceDiagram
Shopper->>Bolt Checkout: Places order
Bolt Checkout->>Bolt Backend: POST /v1/consumer/credit_cards/authorize
Bolt Backend->>OCAPI: PUT /baskets/{basket_id}/billing_address
OCAPI-->>Bolt Backend: Basket
Bolt Backend->>OCAPI: GET /baskets/{basket_id}/payment_methods
OCAPI-->>Bolt Backend: Applicable Payment Methods
Bolt Backend->>OCAPI: POST /baskets/{basket_id}/payment_instruments
OCAPI-->>Bolt Backend: Basket
Bolt Backend->>OCAPI:POST /orders [Creates new order in SFCC]
OCAPI-->>Bolt Backend: Order
Bolt Backend->>Payment Processor: Authorize Payment with PSP
Payment Processor-->>Bolt Backend: Authorize Response
Bolt Backend-->>Bolt Checkout: Redirect URL
Bolt Checkout-->>Shopper: Shopper redirected to the order confirmation page
Note over Bolt Backend: Cartridge Controller used to trigger Confirmation Email
Bolt Backend->>Bolt Cartridge: /Notification-OrderConfirmEmail
Bolt Cartridge-->>Bolt Backend: Success
Note over Bolt Backend: If Bolt Fraud is used, Fraud Scoring occurs here
Bolt Backend->>OCAPI: PUT /orders/{order_id}/status