Related Documents
Document Properties
Kbid276S39
Last Modified23-Jun-2020
Added to KB29-Jun-2016
Public AccessEveryone
StatusOnline
Doc TypeReferences
ProductICM 7.8

REST API - Set basket line item related data (7.8)

URI

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

Http Method

PUT

Short Description

Sets line item related data

Query Parameters

none

Example Requests

/baskets/XkoKDACqjEkAAAFCHClCMC0h/items/7XwKDACqvlwAAAFCkrZCMC2X

HTTP Status Codes

200 OK

400 Bad Request
       Possible values for header 'error-key':

    • basket.basket_id_required.error
    • basket.gift.message.to_required.error
    • basket.gift.message.from_required.error
    • basket.gift.message.message_required.error
    • basket.lineitem.id_required.error
    • basket.product.sku_required.error
    • basket.product.variation.update_not_successful.error
    • basket.product.update_quantity.error
    • basket.invalid_address.error

404 Not Found
       Possible values for header 'error-key':

  • basket.basket_not_found.error
  • basket.lineitem.not_found.error
  • basket.product.not_found.error
  • basket.warranty.not_found.error

Description

Sets following line item related data:

  • Quantity
  • Product variation option
  • Ship-to address
  • Shipping method
  • Gift certificate data

If basket or basket line item is not found then a status code 404 is returned as a result.

Depending on the flag MultipleShipmentsSupported the shipping methods and addresses can be set at the line item level:

  • MultipleShipmentsSupported = true: the shipping methods and addresses can be set on line item level (not at basket level)
  • MultipleShipmentsSupported = false: the shipping methods and addresses cannot be set on line item level (only at basket level)

Cartridge

app_sf_rest

Application

B2C Web Shop, SMB Web Shop

Product Version

7.8

Product To Version

7.8
Status

final

JSON

Request Data Format

application/json

Request related java object

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

Request Example

Set item quantity

{
    "quantity": {
        "value": 3
    }
}

 

Set product variation option

 

{
    "sku":"3934150"
}

Set shipping method (only if MultipleShipmentsSupported = true => multiple shipment where shipping methods on line item level)

{
    "shippingMethod": {
        "id": "STD_2DAY"
    }
}

Set ship-to address

{
    "shipToAddress": {
        "country": "Germany",
        "city": "Potsdam",
        "postalCode": "14482",
        "addressLine1": "Berliner Str. 20",
        "phoneHome": "049364112677",
        "firstName": "Patricia",
        "lastName": "Miller",
        "title": "Mrs.",
        "countryCode": "DE"
    }
}

Existing addresses of registered customers may also be used by passing the URN:

{ 
	"shipToAddress" : { 
		"urn" : "urn:address:customer:As8BcSwoiuFEEEAd3pp1Oye:Xf7AqMgoyuMAAAEs2sx0Uei" 
	} 
}

Deprecated: For compatibility reasons the UUID of the address can also be specified:

{ 
	"shipToAddress" : { 
		"id" : "Xf7AqMgoyuMAAAEs2sx0Uei" 
	} 
}

The request body above can also be used to set a store as ship-to address in case pickup in store is enabled. For this to work, the UUID of the store has to be passed which can be retrieved via the REST API - Store locator request.

 

Response Data Format

application/json

Response related java object

com.intershop.component.rest.capi.resourceobject.LinkRO

Response Example

{
    "type": "Link",
    "title": "7XwKDACqvlwAAAFCkrZCMC2X",
    "uri": "inSPIRED-inTRONICS-Site/-/baskets/XkoKDACqjEkAAAFCHClCMC0h/items/7XwKDACqvlwAAAFCkrZCMC2X"
}

XML

XML Request Data Format

text/xml

XML Request Java Objects

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

XML Request Example

Set item quantity

<?xml version="1.0" encoding="UTF-8"?>
<BasketLineItem>
    <quantity type="Quantity">
        <value>7</value>
    </quantity>
</BasketLineItem>

Set product variation option

<?xml version="1.0" encoding="UTF-8"?>
<BasketLineItem>
    <sku>3934150</sku>
</BasketLineItem>

Set shipping method (only if MultipleShipmentsSupported = true => multiple shipment where shipping methods on line item level)

<?xml version="1.0" encoding="UTF-8"?>
<BasketLineItem>
    <shippingMethod>
        <id>STD_2DAY</id>
    </shippingMethod>
</BasketLineItem>

Set ship-to address

<?xml version="1.0" encoding="UTF-8"?>
<BasketLineItem>
    <shipToAddress type="Address">
        <addressName>Patricia Miller, Berliner Str. 20, Potsdam</addressName>
        <city>Potsdam</city>
        <country>Germany</country>
        <countryCode>DE</countryCode>
        <email>patricia@test.intershop.de</email>
        <firstName>Patricia</firstName>
        <ID>kS4KABvHkwcAAAFCdL4J6CtB</ID>
        <lastName>Miller</lastName>
        <phoneMobile>004917623412341</phoneMobile>
        <phoneBusiness>004915163412341</phoneBusiness>
        <phoneHome>049364112677</phoneHome>
        <postalCode>14482</postalCode>
        <mainDivision>BER</mainDivision>
        <addressLine1>Berliner Str.</addressLine1>
        <addressLine2>20</addressLine2>
        <addressLine3>Downtown</addressLine3>
        <title>Mrs.</title>
    </shipToAddress>
</BasketLineItem> 

XML Response Data Format

text/xml

XML Response Java Objects

com.intershop.component.rest.capi.resourceobject.LinkRO

XML Response Example

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Link type="Link">
    <title>7XwKDACqvlwAAAFCkrZCMC2X</title>
    <uri>inSPIRED-inTRONICS-Site/-/baskets/XkoKDACqjEkAAAFCHClCMC0h/items/7XwKDACqvlwAAAFCkrZCMC2X</uri>
</Link>

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