Related Documents
Document Properties
KbidN28307
Last Modified23-Jun-2020
Added to KB21-Jun-2017
Public AccessEveryone
StatusOnline
Doc TypeReferences
Product
  • ICM 7.9
  • ICM 7.10

REST API - Delete item from basket by its ID


Note

Starting with 7.10 our REST API is documented using Redoc accessible at docs.intershop.com.

URI

/baskets/<basket-id>/items/<item-id>

Http Method

DELETE

Short Description

Removes the specified line item from basket

Query Parameters

none

Example Requests

/baskets/XkoKDACqjEkAAAFCHClCMC0h/items/T7YKDACqWeEAAAFCtbVCMC2X

HTTP Status Codes

303 See other

400 Bad Request
       Possible values for header ‘error-key’:

    • basket.lineitem.id_required.error
    • basket.basket_id_required.error

404 Not Found
       Possible values for header ‘error-key’:

    • basket.basket_not_found.error

Description

Removes the line item with the given ID from the basket. The result basket's summary.

Status code 404 is returned if the basket or the line item could not be found.

Cartridge

app_sf_rest

Application

B2C Web Shop, SMB Web Shop

Access Restrictions

Requires authentication with user having assigned the following permissions:

  • Purchase (APP_B2B_PURCHASE, only in B2B applications)

Product Version

7.9

Product To Version

 

Status

final

JSON

Request Data Format

Request related java object

n/a

Request Example

n/a

Response Data Format

application/json

Response related java object

com.intershop.sellside.rest.common.capi.resourceobject.basket.BasketRO

Response code is 303. Clients can perform a GET on the address contained in the Location header to get the updated cart.

Response Example

{
   "name": "basket",
   "type": "Basket",
   "id": "dFvAqAJmZ48AAAFDF1Eq3B6S",
   "department": "Sales",
   "taxationID": "0123456789",
   "invoiceToAddress":
   {
       "type": "Address",
       "id": "yWYKABvH_2MAAAFCBFUJoPk3",
       "country": "Germany",
       "city": "Potsdam",
       "postalCode": "14482",
       "street": "Berliner Str. 20",
       "phoneHome": "049364112677",
       "firstName": "Patricia",
       "lastName": "Miller",
       "title": "Mrs.",
       "addressName": "Patricia Miller, Berliner Str. 20, Potsdam",
       "countryCode": "DE"
   },
   "externalOrderReferenceID": "30000008899",
   "shippingBuckets":
   [
       {
           "name": "basketShippingBucket",
           "type": "BasketShippingBucket",
           "shippingMethod":
           {
               "name": "Standard Ground",
               "type": "BasketShippingMethod",
               "id": "STD_GROUND",
               "shippingTimeMin": 3,
               "shippingTimeMax": 7
           },
           "lineItems":
           [
               {
                   "type": "Link",
                   "title": "Asus K72 series K72F-TY011V",
                   "uri": "PrimeTech-PrimeTechSpecials-Site/b2c-web-shop/baskets/dFvAqAJmZ48AAAFDF1Eq3B6S/items/D9LAqAJmmP0AAAFDbSwq3B6V",
                   "attributes":
                   [
                       {
                           "name": "position",
                           "type": "Integer",
                           "value": 2
                       },
                       {
                           "name": "sku",
                           "type": "String",
                           "value": "4776790"
                       }
                   ]
               }
           ]
       },
       {
           "name": "basketShippingBucket",
           "type": "BasketShippingBucket",
           "shippingMethod":
           {
               "name": "Standard Freight Delivery",
               "type": "BasketShippingMethod",
               "id": "TRUCK",
               "shippingTimeMin": 5,
               "shippingTimeMax": 7
           },
           "lineItems":
           [
               {
                   "type": "Link",
                   "title": "LG 32LE3300",
                   "uri": "PrimeTech-PrimeTechSpecials-Site/b2c-web-shop/baskets/dFvAqAJmZ48AAAFDF1Eq3B6S/items/KorAqAJmfzUAAAFDlyEq3B6U",
                   "attributes":
                   [
                       {
                           "name": "position",
                           "type": "Integer",
                           "value": 1
                       },
                       {
                           "name": "sku",
                           "type": "String",
                           "value": "4555724"
                       }
                   ]
               }
           ]
       }
   ],
   "purchaseCurrency": "USD",
   "totals":
   {
       "name": "basketTotals",
       "type": "BasketTotals",
       "basketTotal":
       {
           "type": "Money",
           "value": 2603.47,
           "currencyMnemonic": "USD"
       },
       "taxTotal":
       {
           "type": "Money",
           "value": 147.37,
           "currencyMnemonic": "USD"
       },
       "dutiesAndSurchargesTotal":
       {
           "type": "Money",
           "value": 0,
           "currencyMnemonic": "USD"
       },
       "shippingTotal":
       {
           "type": "Money",
           "value": 142.78,
           "currencyMnemonic": "USD"
       },
       "itemTotal":
       {
           "type": "Money",
           "value": 2614.07,
           "currencyMnemonic": "USD"
       },
       "itemShippingRebatesTotal":
       {
           "type": "Money",
           "value": 0,
           "currencyMnemonic": "USD"
       },
       "bucketShippingRebatesTotal":
       {
           "type": "Money",
           "value": 0,
           "currencyMnemonic": "USD"
       },
       "basketShippingRebatesTotal":
       {
           "type": "Money",
           "value": -142.78,
           "currencyMnemonic": "USD"
       },
       "basketValueRebatesTotal":
       {
           "type": "Money",
           "value": -10.6,
           "currencyMnemonic": "USD"
       }
   },
   "salesTaxTotalsByTaxRate":
   [
       {
           "name": "name",
           "type": "AppliedTax",
           "amount":
           {
               "type": "Money",
               "value": 147.37,
               "currencyMnemonic": "USD"
           },
           "rate": 6
       }
   ],
   "valueRebates":
   [
       {
           "name": "appliedRebate",
           "type": "AppliedRebate",
           "description": "For orders over 200 USD, a 10 USD Order discount is guaranteed for the Promo Code "INTERSHOP".",
           "code": "INTERSHOP",
           "amount":
           {
               "type": "Money",
               "value": -10.6,
               "currencyMnemonic": "USD"
           },
           "rebateType": "OrderValueOffDiscount"
       }
   ],
   "shippingRebates":
   [
       {
           "name": "appliedRebate",
           "type": "AppliedRebate",
           "description": "For LED TVs the shipping is free.",
           "amount":
           {
               "type": "Money",
               "value": -142.78,
               "currencyMnemonic": "USD"
           },
           "rebateType": "ShippingPercentageOffDiscount"
       }
   ]
}

XML

XML Request Data Format

XML Request Java Objects

n/a

XML Request Example

n/a

XML Response Data Format

text/xml

XML Response Java Objects

com.intershop.sellside.rest.common.capi.resourceobject.basket.BasketRO

XML Response Example

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Basket name="basket" type="Basket">
    <department>Sales</department>
    <externalOrderReferenceID>30000008899</externalOrderReferenceID>
    <id>dFvAqAJmZ48AAAFDF1Eq3B6S</id>
    <invoiceToAddress type="Address">
        <addressName>Patricia Miller, Berliner Str. 20, Potsdam</addressName>
        <city>Potsdam</city>
        <country>Germany</country>
        <countryCode>DE</countryCode>
        <firstName>Patricia</firstName>
        <id>yWYKABvH_2MAAAFCBFUJoPk3</id>
        <lastName>Miller</lastName>
        <phoneHome>049364112677</phoneHome>
        <postalCode>14482</postalCode>
        <street>Berliner Str. 20</street>
        <title>Mrs.</title>
    </invoiceToAddress>
    <purchaseCurrency>USD</purchaseCurrency>
    <salesTaxTotalsByTaxRate>
        <AppliedTax name="name" type="AppliedTax">
            <amount type="Money">
                <currencyMnemonic>USD</currencyMnemonic>
                <value>147.37</value>
            </amount>
            <rate>6.0</rate>
        </AppliedTax>
    </salesTaxTotalsByTaxRate>
    <shippingBuckets>
        <BasketShippingBucket name="basketShippingBucket" type="BasketShippingBucket">
            <lineItems>
                <Link type="Link">
                    <attributes>
                        <ResourceAttribute name="position" type="Integer">
                            <value>2</value>
                        </ResourceAttribute>
                        <ResourceAttribute name="sku" type="String">
                            <value>4776790</value>
                        </ResourceAttribute>
                    </attributes>
                    <title>Asus K72 series K72F-TY011V</title>
                    <uri>PrimeTech-PrimeTechSpecials-Site/b2c-web-shop/baskets/dFvAqAJmZ48AAAFDF1Eq3B6S/items/D9LAqAJmmP0AAAFDbSwq3B6V</uri>
                </Link>
            </lineItems>
            <shippingMethod name="Standard Ground" type="BasketShippingMethod">
                <id>STD_GROUND</id>
                <shippingTimeMax>7</shippingTimeMax>
                <shippingTimeMin>3</shippingTimeMin>
            </shippingMethod>
        </BasketShippingBucket>
        <BasketShippingBucket name="basketShippingBucket" type="BasketShippingBucket">
            <lineItems>
                <Link type="Link">
                    <attributes>
                        <ResourceAttribute name="position" type="Integer">
                            <value>1</value>
                        </ResourceAttribute>
                        <ResourceAttribute name="sku" type="String">
                            <value>4555724</value>
                        </ResourceAttribute>
                    </attributes>
                    <title>LG 32LE3300</title>
                    <uri>PrimeTech-PrimeTechSpecials-Site/b2c-web-shop/baskets/dFvAqAJmZ48AAAFDF1Eq3B6S/items/KorAqAJmfzUAAAFDlyEq3B6U</uri>
                </Link>
            </lineItems>
            <shippingMethod name="Standard Freight Delivery" type="BasketShippingMethod">
                <id>TRUCK</id>
                <shippingTimeMax>7</shippingTimeMax>
                <shippingTimeMin>5</shippingTimeMin>
            </shippingMethod>
        </BasketShippingBucket>
    </shippingBuckets>
    <shippingRebates>
        <AppliedRebate name="appliedRebate" type="AppliedRebate">
            <rebateType>ShippingPercentageOffDiscount</rebateType>
        </AppliedRebate>
    </shippingRebates>
    <taxationID>0123456789</taxationID>
    <totals name="basketTotals" type="BasketTotals">
        <basketShippingRebatesTotal type="Money">
            <currencyMnemonic>USD</currencyMnemonic>
            <value>-142.78</value>
        </basketShippingRebatesTotal>
        <basketTotal type="Money">
            <currencyMnemonic>USD</currencyMnemonic>
            <value>2603.47</value>
        </basketTotal>
        <basketValueRebatesTotal type="Money">
            <currencyMnemonic>USD</currencyMnemonic>
            <value>-10.60</value>
        </basketValueRebatesTotal>
        <bucketShippingRebatesTotal type="Money">
            <currencyMnemonic>USD</currencyMnemonic>
            <value>0.0</value>
        </bucketShippingRebatesTotal>
        <dutiesAndSurchargesTotal type="Money">
            <currencyMnemonic>USD</currencyMnemonic>
            <value>0.0</value>
        </dutiesAndSurchargesTotal>
        <itemShippingRebatesTotal type="Money">
            <currencyMnemonic>USD</currencyMnemonic>
            <value>0.0</value>
        </itemShippingRebatesTotal>
        <itemTotal type="Money">
            <currencyMnemonic>USD</currencyMnemonic>
            <value>2614.07</value>
        </itemTotal>
        <shippingTotal type="Money">
            <currencyMnemonic>USD</currencyMnemonic>
            <value>142.78</value>
        </shippingTotal>
        <taxTotal type="Money">
            <currencyMnemonic>USD</currencyMnemonic>
            <value>147.37</value>
        </taxTotal>
    </totals>
    <valueRebates>
        <AppliedRebate name="appliedRebate" type="AppliedRebate">
            <code>INTERSHOP</code>
            <rebateType>OrderValueOffDiscount</rebateType>
        </AppliedRebate>
    </valueRebates>
</Basket>

Reference - WebShop REST APIs

Disclaimer

The information provided in the Knowledge Base may not be applicable to all systems and situations. Intershop Communications will not be liable to any party for any direct or indirect damages resulting from the use of the Customer Support section of the Intershop Corporate Web site, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.

Customer Support
Knowledge Base
Product Resources
Support Tickets