# Remove product from cart

Use this method to remove a product that was added to the shopping cart, during the current session.

## Request parameters

<table><thead><tr><th width="142.5999755859375">Parameter</th><th>Type / Description</th></tr></thead><tbody><tr><td><code>sessionID</code></td><td><strong>Required (string)</strong><br>Session identifier, which is the output of the <strong>Login</strong> method. An exception is thrown if the values are incorrect.</td></tr><tr><td><code>productId</code></td><td><strong>Required (integer)</strong><br>Unique product identifier from the Avangate system.</td></tr><tr><td><code>priceOptions</code></td><td><strong>Optional (stringArray)</strong><br>Array of price options codes. These identifiers mark the individual options inside pricing options configuration groups. This parameter must match exactly the pricing option combination of the product added to the cart in order for the product to be removed. Partner orders can involve the same product, but ordered in multiple instances, each with different pricing options. Can be NULL.</td></tr><tr><td><code>quantity</code></td><td><strong>Optional (integer)</strong><br>Defines the number of product units added to cart that should be removed. If no quantity info is provided, the product is completely removed from cart. Can be NULL.</td></tr></tbody></table>

### Request sample

```php
<?php

require('PATH_TO_AUTH'); // Authentication example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/02Authentication
require('PATH_TO_setPartner'); // setPartner example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/06Reference/Partner/00Set_partner
require('PATH_TO_addProduct'); // addProduct example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/06Reference/08Place_an_order/00Add_product_to_cart

$productId = 'YOUR_PRODUCT_ID';
$priceOptions = array(
'Pricing_options_group_code1',
'Pricing_options_group_code2'
);
$quantity = YOUR_QUANTITY;

try {
$RemoveProduct= $client->deleteProduct ($sessionID, $productId, $priceOptions, $quantity);
} catch (SoapFault $e) {
echo "ProductDeleted: " . $e->getMessage();
exit;
}
var_dump ("ProductDeleted ", $RemoveProduct);
```

## Response parameters

<table><thead><tr><th width="129.4000244140625">Parameters</th><th>Type / Description</th></tr></thead><tbody><tr><td><strong>Result</strong></td><td><strong>Boolean</strong><br>True or false</td></tr></tbody></table>

## Errors

<table><thead><tr><th width="170.2000732421875">Error</th><th>Description</th></tr></thead><tbody><tr><td><strong>EMPTY_CART</strong></td><td>The shopping cart is empty.</td></tr><tr><td><strong>PRODUCT_ERROR</strong></td><td>There is no product with the specified settings in cart.</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.2checkout.com/channel-manager-api/channel-manager-api/api-2.1/soap-2.1/reference/place-an-order/remove-product-from-cart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
