Commerce Foundation Basket CommerceDelete

This Commerce Server 2009 operation is used to delete a basket at the server level. All related commerce entities will also be deleted; however, because commerce entities such as addresses and payment accounts are copies of user profile entities, they are removed from the Commerce Server Orders System, but not from the Profiles System.

Syntax

        var deleteBasket = new CommerceDelete<CommerceEntity>("Basket");
      

Parameters

Supports only CommerceModelSearch<Basket>; however, supports only the following fields:

Fields

Description

CommerceRequest.SearchCriteria.Model.UserId

Required. Specifies the ID of the user whose baskets will be deleted.

CommerceRequest.SearchCriteria.Model.BasketType

Required. Specifies the type of basket to delete.

CommerceRequest.SearchCriteria.Model.Id

Required. Specifies the ID of the specific basket to return. if you do not specify Name. If you specify both Id and Name, the system will throw an exception.

CommerceRequest.SearchCriteria.Model.Name

Required. Specifies the name of the specific basket to return. if you do not specify Id. If you specify both Id and Name, the system will throw an exception.

Operation Sequence Components

Operation Sequence Component

Description

CommerceBasketLoader

Retrieves the Commerce Server basket or purchase order depending on the search criteria. You can retrieve the selected basket from the cache using the OrderGroupCache.GetCachedCommerceServerOrderGroups method (available when you include the Microsoft.Commerce.Providers.Utility name space).

CommerceBasketCommitter

Deletes the basket.

Return Value

This operation returns the number of items deleted.

Exceptions

Microsoft Multi-Channel Commerce Foundation can throw the following exception during this operation:

  • FaultException<GeneralOperationFault>

Remarks

Supports only CommerceModelSearch, and the required fields are UserId, BasketType, and Id or Name (but not both Id and Name, as this will throw an exception). The use of any other fields in the query is not supported.

See Also

Other Resources

Developing with the Commerce Foundation Orders System

Commerce Foundation Basket

CommerceDelete