Salesforce Commerce Checkout API
Use the Commerce Checkout APIs to streamline the commerce store checkout process, providing customers with a convenient and secure shopping experience while enabling merchants to efficiently manage orders and payments. Add checkout functionality to your B2B or B2C store. Set up payment, shipping, and tax calculation services.
The initial step in the Commerce Store Checkout process is to start checkout for users. This involves gathering information such as cart items, customer details, shipping information, and payment preferences.
When initiating a Checkout API update request, typically prompted by users adding or modifying shipping addresses during checkout, the process extends to integrations like shipping and tax services. For registered users, saved information, including shipping addresses and saved payment methods can be returned at the start of checkout. Additionally, if a shipping address is saved, shipping methods and taxes are calculated at the beginning of the checkout process. Shipping integrations are engaged to retrieve delivery methods and rates, sourced either from third-party services or Salesforce's native shipping solutions. Similarly, tax calculations are executed to ensure accurate rates depending on the shipping location. These updates are subsequently displayed in the checkout interface, presenting users with delivery options, shipping rates, and relevant taxes. You can either use a third-party tax service or Salesforce's native tax via Stripe Tax.
When users proceed to payment for a Commerce store checkout, the Checkout Payments API is triggered. This API manages payment methods, either configured by merchants or utilizing Salesforce's native payments with Stripe as the gateway. It guarantees secure payment transactions for finalized orders, presenting customers with a range of payment options supported by the commerce platform.
Tokenization of Payment for a Commerce Store Checkout involves encrypting and storing payment information to enhance transaction security. For the purpose of user authorization and transaction processing, this procedure enables the token handshake and makes it easier to communicate with other Salesforce Payment APIs.
Finally, users can place an order for a Commerce Store checkout. In this step, the order is validated, payment is processed, and an order summary is generated for both the user and the merchant. Users choose a payment method to complete their purchase, and this API validates the cart, converting it into an order and generating an order summary.
Let's consider a basic scenario for building the Commerce checkout management flow using Checkout APIs. This example covers just a few Checkout APIs and doesn't include the entire APIs functionality.
In a typical shopping journey, users add products to their cart from the Product Listing Page (PLP) or the Product Details Page (PDP). They review their cart items using a GET call on the Cart Item API.
Once they're ready, they start the checkout process with a POST request to the Webstore Checkouts API, receiving user information like contact details, shipping address, and delivery options.
For any updates to contact or shipping details, users can send a PATCH request to the Webstore Checkout API. Subsequently, the Checkout API triggers integrations for shipping and taxes, providing rates and delivery options.
After selecting a delivery method and reviewing charges, users can proceed to payment by making a POST request to the Webstore Checkout Payments API. This API triggers Salesforce's native payments with Stripe as the payment gateway. Then, make a POST request to the Webstore Payments Token API for authorization and enhanced security by encrypting payment details.
Finally, users place their order by making a POST request to the Webstore Checkout Orders API, which validates user info, processes payments, and creates order summaries for both users and merchants.
Here’s a list of Commerce Checkout resources:
Resource | Supported HTTP Methods | Description |
---|---|---|
/commerce/webstores/{webstoreId}/checkouts | POST | Start a Commerce store checkout. |
/commerce/webstores/{webstoreId}/checkouts/{activeOrCheckoutId} | DELETE, GET, PATCH | Get, delete, or update a Commerce store checkout. |
/commerce/webstores/{webstoreId}/checkouts/{activeOrCheckoutId}/payments | POST | Payment for a Commerce store checkout. |
/commerce/webstores/{webstoreId}/payments/token | POST | Tokenize a payment for a Commerce store checkout. |
/commerce/webstores/{webstoreId}/checkouts/{activeOrCheckoutId}/orders | POST | Place an order for a Commerce store checkout. |
See Also