You can find more basket examples in the API browser applicationbrowserapplication .
Representation of a basket item on the platform.
A text that describes the basket item. Usually the article or product text. Will be generated automatically on basket item creation.
The number of items the customer wants to buy. Is always an int > 0. In case you want to delete a basket item use HTTP DELETE method! This attribute is mandatory for basket item creations.
The abstract element that you want to place into the basket.
The id of the abstract thing the customer bought. Allowed right now are Spreadshirt article id and product ids. Will be set automatically on basket item creation.
A link to the actual concrete element you placed into the basket. Can be either a link to a Spreadshirt article or product right now (see Retrieve Product and Retrieve Article ). This attribute is mandatory for basket item creations.
The actual type of the abstract element which makes it to a concrete one. Can be sprd:article or sprd:product for Spreadshirt articles or products right now. Type is mandatory for basket item creations.
A list of properties that further refine the abstract element.
A property value that corresponds to the property key, e.g. size:2 or appearance:1. Properties might be different depending on the element type. Spreadshirt articles and products support size and appearance only. Properties are mandatory for basket item creations.
appearance: 1 (Depends on the product type. Check the productType resource to determine the appearanceId)
list of links that belong to actions that can be executed for this basket item
concrete link of link list
link type that can be either edit or continueShopping. edit link is the link displayed in checkout for editing the basket item. continueShopping link is used in checkout as link for continue shopping button.
The possible discounts and the discount value per single item that applies.
The single basket item price without reductions through discounts, etc..
The single basket item price. Price is calculated by the API. Price contains discount reductions.
In case of mixed mode basket, a reference to the shop where the customer bought the item.
Reference to the origin of the basket. Origin can be used to tell the platform, where the basket item actually comes from, i.e. from which product or sales channel.
<basketItem xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://api.spreadshirt.net" xlink:href="https://api.spreadshirt.net/api/v1/baskets/0cd283f7-5b24-407a-9a9c-a081455e1030/items/a561dcbb-9065-4e45-ad20-aba2bd8a6afa" id="a561dcbb-9065-4e45-ad20-aba2bd8a6afa"> <!-- optional for mixed mode --> <shop id="40000" xlink:href="http://api.spreadshirt.net/v1/shops/42"> <description>Basket Item description</description> <quantity>2</quantity> <element id="456" type="sprd:article" xlink:href="https://api.spreadshirt.net/v1/shops/42/articles/456"> <properties> <property key="appearance">15</property> <property key="size">12</property> </properties> </element> <links> <link type="edit" xlink:href="http://www.yourdomain.de/article/123/edit"/> <link type="continueShopping" xlink:href="http://www.yourdomain.de"/> </links> <discounts> <discount> <discountScale id="1" xlink:href="https://api.spreadshirt.net/api/v1/shops/205909/discountScales/1"/> <currentDiscount id="10"/> <nextDiscount id="11"/> <price> <currency id="1" xlink:href="https://api.spreadshirt.net/v1/currencies/1"/> <vatIncluded>2.0</vatIncluded> <vatExcluded>0.38</vatExcluded> <vat>19.0</vat> </price> </discount> </discounts> <priceItem> <currency id="1" xlink:href="https://api.spreadshirt.net/v1/currencies/1"/> <vatIncluded>12.0</vatIncluded> <vatExcluded>9.72</vatExcluded> <vat>19.00</vat> <priceItem> <price> <currency id="1" xlink:href="https://api.spreadshirt.net/v1/currencies/1"/> <vatIncluded>10.0</vatIncluded> <vatExcluded>8.1</vatExcluded> <vat>19.00</vat> </price> </basketItem>
You can find more basket item examples in the API browser application .
Discount calculation example