Skip to Content
Nouvelle documentation Applite - JS SDK, Dart SDK & REST API

Panier (CartApi)

Le module CartApi gère les paniers d’achat.

Accès : client.store.cart

Méthodes

create

Crée un panier.

final response = await client.store.cart.create( CreateCartParams( apiKey: 'user_api_key', customerId: 'customer_id', ), );

get

Récupère un panier.

final response = await client.store.cart.get( GetCartParams(apiKey: 'user_api_key', id: 'cart_id'), );

addItem

Ajoute un article.

final response = await client.store.cart.addItem( AddCartItemParams( apiKey: 'user_api_key', id: 'cart_id', variantId: 'variant_id', productId: 'product_id', quantity: 2, ), );

updateItem

Met à jour la quantité.

final response = await client.store.cart.updateItem( UpdateCartItemParams( apiKey: 'user_api_key', id: 'cart_id', itemId: 'item_id', quantity: 3, ), );

removeItem

Supprime un article.

final response = await client.store.cart.removeItem( RemoveCartItemParams( apiKey: 'user_api_key', id: 'cart_id', itemId: 'item_id', ), );

calculateTotals

Calcule les totaux.

final response = await client.store.cart.calculateTotals( CalculateCartTotalsParams( apiKey: 'user_api_key', id: 'cart_id', ), ); print('Total: ${response.data.total}'); print('Articles: ${response.data.itemCount}');
Last updated on