Home > widget-integration > AddToCartResult
AddToCartResult interface
Result of add to cart operation
Provides structured response for cart operations with success/error status. Includes optional response data and error messages.
Signature:
export interface AddToCartResult
Example 1
Success result
const result: AddToCartResult = {
success: true,
response: {
id: '12345',
quantity: 2,
price: 1999
}
};
Example 2
Error result
const result: AddToCartResult = {
success: false,
error: 'Product is out of stock'
};