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

REST API - Modify basket sub line item


Note

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

URI

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

Http Method

PUT

Short Description

Modify the sublinetype of a specific basket item

Query Parameters

none

Example Requests

/baskets/XkoKDACqjEkAAAFCHClCMC0h/items/zCYKDACqIpAAAAFCPH9OhDGN/sublineitems/warranty

HTTP Status Codes

200 OK

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

    • basket.basket_sku_required.error
    • basket.lineitem.id_required.error
    • basket.product.sku_required.error
    • basket.product.not_found.error
    • basket.gift.message.from_required.error
    • basket.gift.message.to_required.error
    • basket.gift.message.message_required.error      
    • basket.lineitem.product.no_applicable.error
    • basket.basket_id_required.error

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

    • basket.basket_id_required.error
    • basket.lineitem.not_found.error
    • basket.lineitem.subline_type_required.error
    • basket.basket_not_found.error

Description

Modify the sublinetype of a specific basket item. Valid types are warranty, giftwrap and giftmessage. If basket or basket item, or subline type is not found then a status code 404 is returned as a result. If product sku is not provided a status code 400 is returned as a result.

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

application/json

Request related java object

com.intershop.sellside.rest.common.capi.resource.basket.BasketLineItemResource
com.intershop.sellside.rest.common.capi.resourceobject.DependentBasketLineItemRO

Request Example

Subline type: warranty

Uri: /baskets/XkoKDACqjEkAAAFCHClCMC0h/items/zCYKDACqIpAAAAFCPH9OhDGN/sublineitems/warranty

{ 
	"sku":"2YLEDTVSUP" 
}

Subline type: gift wrap

Uri: /baskets/XkoKDACqjEkAAAFCHClCMC0h/items/zCYKDACqIpAAAAFCPH9OhDGN/sublineitems/giftwrap

{ 
    "sku":"BirthdayGiftWrap"
}

Subline type: gift message

Uri: /baskets/XkoKDACqjEkAAAFCHClCMC0h/items/zCYKDACqIpAAAAFCPH9OhDGN/sublineitems/giftmessage

{ 
    "sku":"BirthdayGiftMessage", 
    "from":"Patricia",
    "to":"Charles",
    "message":"Happy Birthday!!!"
}

Response Data Format

application/json

Response related java object

com.intershop.sellside.rest.common.capi.resource.basket.BasketLineItemResource
com.intershop.component.rest.capi.resourceobject.LinkRO

Response Example

Subline type: warranty

Uri: /baskets/XkoKDACqjEkAAAFCHClCMC0h/items/zCYKDACqIpAAAAFCPH9OhDGN/sublineitems/warranty

{
    "type": "Link",
    "uri": "PrimeTech-PrimeTechSpecials-Site/-/baskets/XkoKDACqjEkAAAFCHClCMC0h/items/zCYKDACqIpAAAAFCPH9OhDGN/sublineitems/warranty",
    "title": "2-year LED TV Support"
}

Subline type: gift wrap

Uri: /baskets/XkoKDACqjEkAAAFCHClCMC0h/items/zCYKDACqIpAAAAFCPH9OhDGN/sublineitems/giftwrap

{
    "type": "Link",
    "uri": "PrimeTech-PrimeTechSpecials-Site/-/baskets/XkoKDACqjEkAAAFCHClCMC0h/items/zCYKDACqIpAAAAFCPH9OhDGN/sublineitems/giftwrap",
    "title": "Birthday Gift Wrap"
}

Subline type: gift message

Uri: /baskets/XkoKDACqjEkAAAFCHClCMC0h/items/zCYKDACqIpAAAAFCPH9OhDGN/sublineitems/giftmessage

{
    "type": "Link",
    "uri": "PrimeTech-PrimeTechSpecials-Site/-/baskets/XkoKDACqjEkAAAFCHClCMC0h/items/zCYKDACqIpAAAAFCPH9OhDGN/sublineitems/giftmessage",
    "title": "Birthday Gift Message"
}

XML

XML Request Data Format

text/xml

XML Request Java Objects

com.intershop.sellside.rest.common.capi.resource.basket.BasketLineItemResource
com.intershop.sellside.rest.common.capi.resourceobject.DependentBasketLineItemRO

XML Request Example

Subline type: warranty

Uri: /baskets/XkoKDACqjEkAAAFCHClCMC0h/items/zCYKDACqIpAAAAFCPH9OhDGN/sublineitems/warranty

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<DependentLineItem name="dependentLineItem" type="DependentLineItem">
    <sku>3YLEDTVSUP</sku>
</DependentLineItem>

Subline type: gift wrap

Uri: /baskets/XkoKDACqjEkAAAFCHClCMC0h/items/zCYKDACqIpAAAAFCPH9OhDGN/sublineitems/giftwrap

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<DependentLineItem name="dependentLineItem" type="DependentLineItem">
    <sku>BirthdayGiftWrap</sku>
</DependentLineItem>

Subline type: gift message

Uri: /baskets/XkoKDACqjEkAAAFCHClCMC0h/items/zCYKDACqIpAAAAFCPH9OhDGN/sublineitems/giftmessage

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<DependentLineItem name="dependentLineItem" type="DependentLineItem">
    <sku>BirthdayGiftMessage</sku>    
    <from>Patricia</from>
    <to>Charles</to>
    <message>Happy Birthday!!!</message>        
</DependentLineItem>

XML Response Data Format

text/xml

XML Response Java Objects

com.intershop.sellside.rest.common.capi.resource.basket.BasketLineItemResource
com.intershop.component.rest.capi.resourceobject.LinkRO

XML Response Example

Subline type: warranty

Uri: /baskets/XkoKDACqjEkAAAFCHClCMC0h/items/zCYKDACqIpAAAAFCPH9OhDGN/sublineitems/warranty

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Link type="Link">
    <title>3-year LED TV Support</title>
    <uri>PrimeTech-PrimeTechSpecials-Site/-/baskets/XkoKDACqjEkAAAFCHClCMC0h/items/zCYKDACqIpAAAAFCPH9OhDGN/sublineitems/warranty</uri>
</Link>

Subline type: gift wrap

Uri: /baskets/XkoKDACqjEkAAAFCHClCMC0h/items/zCYKDACqIpAAAAFCPH9OhDGN/sublineitems/giftwrap

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Link type="Link">
    <title>Birthday Gift Wrap</title>
    <uri>PrimeTech-PrimeTechSpecials-Site/-/baskets/XkoKDACqjEkAAAFCHClCMC0h/items/zCYKDACqIpAAAAFCPH9OhDGN/sublineitems/giftwrap</uri>
</Link>

Subline type: gift message

Uri: /baskets/XkoKDACqjEkAAAFCHClCMC0h/items/zCYKDACqIpAAAAFCPH9OhDGN/sublineitems/giftmessage

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Link type="Link">
    <title>Birthday Gift Message</title>
    <uri>PrimeTech-PrimeTechSpecials-Site/-/baskets/XkoKDACqjEkAAAFCHClCMC0h/items/zCYKDACqIpAAAAFCPH9OhDGN/sublineitems/giftmessage</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