Cart API
The LiquidCommerce Cart API provides comprehensive cart management capabilities with real-time pricing, inventory verification, and multi-retailer support
Overview
This API provides functionality for adding items to a cart, updating quantities, applying promotional codes, and calculating totals based on product prices, shipping fees, and other applicable charges.
Key Features
Create and update shopping carts
Add, remove, or modify items in the cart
Apply promotional codes
Calculate totals including product prices, shipping fees, and platform fees
Support for multiple retailers and fulfillment methods
Authentication
Before using the API, you need to obtain an access token from the Authentication API. Include this token in the Authorization
header of all API requests:
Authorization: Bearer <YOUR_ACCESS_TOKEN>
Error Handling
The API uses standard HTTP response codes to indicate the success or failure of requests. In case of an error, the response body will contain a JSON object with more details about the error.
Rate Limiting
The Cart API is subject to rate limiting to ensure fair usage and maintain performance. If you exceed the rate limit, you'll receive a 429 (Too Many Requests) response.
Best Practices
Always include the
loc
object to ensure accurate pricing and availability.Use the
id
field to update an existing cart rather than creating a new one for each update.Handle the
events
array in the response to manage any warnings or informational messages.Regularly update the cart to reflect any changes in product availability or pricing.
Last updated