Checkout API sequencing after payment and billing entry
Key Takeaway
Finish cart changes before the buyer enters billing and payment details, because later changes can invalidate the payment and clear the billing address.
B2B Commerce checkout runs as a series of Checkout API calls. Many of those calls start background calculators that can change cart totals. Payment and billing details depend on that cart state, so calls made in the wrong order, or at the same time, can wipe out billing data, invalidate payments, or stop orders from being created. Troubleshooting these problems mostly means comparing the order and timing of the API calls against the standard checkout flow.
The standard checkout flow
Standard B2B Commerce checkout runs as a series of steps:
- Start checkout.
- Enter contact information (guest users only).
- Enter delivery information.
- Select a shipping method (if shipping is enabled).
- Process Payment captures payment authorization.
- Place Order validates and creates the order.
Process Payment submits a tokenized payment from a payment provider with POST /commerce/webstores/{webstoreId}/checkouts/{cartId}/payments. You use Process Payment with both Salesforce Payments and custom payment adapters.