Overview
The Cart resource provides two endpoints:
- Generate Cart Preview creates a cart preview containing product and pricing information based on factors such as the customer’s IP address and language.
- Process Cart attempts to process an order using the customer’s most recent payment details. If successful, it returns the purchase details.
Generate Cart Preview
Use the Generate Cart Preview endpoint to retrieve the cart information that a customer would see for a specified IP address and language.
Common use cases include:
- Displaying product and pricing information on your website.
- Showing localized product information and prices.
- Avoiding duplicate product and pricing data in your systems.
- Generating a session URL that directs the customer to the corresponding cart.
Process Cart
Use the Process Cart endpoint to attempt to process an order automatically using an existing customer’s most recent payment details.
Common use cases include:
- Processing rebilling events for client-managed subscriptions.
- Processing in-application purchases and upgrades.
- Billing existing customers for one-time purchases.
- Charging customers for additional products or services.
If Cleverbridge cannot process the order automatically, the response can include a URL where the customer can complete the transaction.
Payment information
For PCI compliance, the Process Cart endpoint does not accept payment information directly.
Cleverbridge uses payment information securely collected during an earlier checkout. If customer or payment information is missing or invalid, or if the payment is declined, the response can include a URL where the customer can enter or update the required information.
Client-managed subscriptions
Use Process Cart when you manage the subscription lifecycle in your own platform while Cleverbridge handles payment processing.
Before using this scenario, Cleverbridge must configure your account to handle your own subscriptions, and the referenced subscription must have the status Handled by Client.
Typical flow:
- The customer purchases a subscription through Cleverbridge.
- Cleverbridge creates a subscription with the status Handled by Client.
- Your application stores the Cleverbridge subscription ID received in the paid order notification.
- When a rebilling event is due, your application calls Process Cart and includes the subscription ID.
- Cleverbridge attempts to charge the customer’s stored payment method.
In-application purchases
Use Process Cart to initiate purchases from within your application without requiring the customer to start a standard checkout flow.
Examples include:
- Game upgrades.
- Premium feature unlocks.
- Additional support hours.
- Usage-based purchases.
If Cleverbridge cannot process the purchase automatically, the response can include a URL where the customer can complete the transaction.
One-time billing
Use Process Cart to bill an existing customer using their stored payment details.
Examples include:
- Additional licenses.
- Add-on products.
- Professional services.
- Technical support packages.
Updated 2 days ago