cart
Type: JSON
The cart attribute accepts a response object from the /carts endpoint on the Croissant Retailer API. For more details, refer to the GET /carts API Documentation.
You can use the cart attribute with Croissant Cart Atomic Components to display your customer's Guaranteed Buyback Values on previously placed orders or to allow them to opt an existing cart into Croissant.
The Croissant Cart Atomic Components automatically handle the calculation of Total Guaranteed Buyback Values and manage display logic. Therefore, if a cart has no Guaranteed Buyback Value or if the cart is already opted in to Croissant, the component will not show a $0 GBB or an opt-in input.
type Cart = {
data: CartData;
};
type CartData = {
id: string;
isOptedIn: boolean;
confirmationNumber: string;
retailerCreatedAt: string;
products: Product[];
source: string;
};
type Product = {
retailerProductId: string;
retailSalePrice: number;
retailSaleCurrency: string;
quantity: number;
buyback: Buyback;
};
type Buyback = {
value: number;
timespan: string;
currency: string;
payoutType: string;
};
Updated 5 months ago