Related Documents
Document Properties
Kbid25A183
Last Modified23-Jun-2020
Added to KB24-Sep-2013
Public AccessEveryone
StatusOnline
Doc TypeReferences

REST API - Get basket by ID (until 7.4 CI)

URI

/baskets/<basket-id>

Http Method

GET

Short Description

Returns the basket's summary.

Query Parameters

none

Example Requests

/baskets/XkoKDACqjEkAAAFCHClCMC0h

HTTP Status Codes

200 OK

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

    • basket.basket_id_required.error

403 Forbidden
Possible values for header 'error-key':

    • basket.login_required.error
    • basket.wrong_basket_id.error

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

    • basket.basket_not_found.error

Description

Gets basket's summary, containing:

  • Customer related basket information, like taxation ID, external order reference ID
  • Shipping buckets with line item references
  • Invoice-to address
  • Promotions applied to the basket
  • Payment methods applied to the basket
  • Sales and shipping taxes
  • Surcharges
  • Promotional discounts
  • Basket totals

In case of basket not found or other error, a status code 400 is returned as a result.

Cartridge

app_sf_rest

Application

B2C Web Shop, SMB Web Shop

Product Version

7.4

Product To Version

7.4.6

Status

final

JSON

Request Data Format

application/json

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 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

text/xml

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>

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
Tickets