REST API - Set basket line item related data (until 7.6)

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

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 method can be set at the line item level:

  • MultipleShipmentsSupported = true: the shipping methods can be set on line item level (not at basket level)
  • MultipleShipmentsSupported = false: the shipping methods 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.5

Product To Version

7.6

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": {
        "type": "Address",
        "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"
    }
}

Response Data Format

application/json

Response related java object

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

Response Example

{
    "type": "Link",
    "title": "7XwKDACqvlwAAAFCkrZCMC2X",
    "uri": "PrimeTech-PrimeTechSpecials-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>
        <mobile>004917623412341</mobile>
        <phoneBusiness>004915163412341</phoneBusiness>
        <phoneHome>049364112677</phoneHome>
        <postalCode>14482</postalCode>
        <state>BER</state>
        <street>Berliner Str.</street>
        <street2>20</street2>
        <street3>Downtown</street3>
        <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>PrimeTech-PrimeTechSpecials-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