Create basket

Creates a new Basket.

Request
query Parameters
ipAddress
required
string

The ip-address of the end user.

createdBy
required
integer <int32>

Account internal id of current user.

pricelistSeed
string

A comma separated list of internal pricelist ids to use, if any. PriceLists supplied must be valid, either from the application's public priceList or any customer or company priceLists or any valid client priceLists. For clients configured to use priceListSeed exclusively in the API only the supplied priceLists will be used. If this is not configured, the supplied priceLists will be appended to the valid priceLists. If none is supplied, the default value for the application will be used in combination with any customer or company priceLists. This applies to both configurations.

cultureCode
string

Specifies in which language to display culture specific information. If none is supplied, value is resolved from Application.

currencyId
string

Specifies in which internal currency id to display prices. If none is supplied, value is resolved from Application. Note that if price is specified on items, then it must be in the same currency.

Request Body schema:

The Basket to create. Pass in null or an empty Basket to create a new empty Basket. See Basket for what properties can be used when creating baskets.

Id
integer or null <int32>

The internal id of the basket. Used to get a specific basket. Ignored in CreateBasket.

CustomerId
integer or null <int32>

The customer internal id for a specific customer associated with this basket. This can be set in CreateBasket if the user is logged in. Otherwise use UpdateBuyer to set customer.

CompanyId
integer or null <int32>

The company internal id for a specific company associated with this basket. This can be set in CreateBasket if the user is logged in with a company. Otherwise use UpdateBuyer to set customer and company.

SalesContactId
integer or null <int32>
StatusId
integer <int32>

Internal id for the current status of the basket. See ListBasketStatuses.

CurrencyId
integer <int32>

The currency internal id of the basket. This defines the currency used when processing payments. Can be set when creating a Basket or change later with UpdateBasket. Use either CurrencyId or CurrencyCode. If not specified, the default for the Application will be used.

CurrencyCode
string

The CurrencyCode of the basket. This defines the currency used when processing payments. Can be set when creating a Basket or change later with UpdateBasket. Use either CurrencyId or CurrencyCode. If not specified, the default for the Application will be used. MaxLength: 3

Comment
string

Free text comment that will be propagated to the order. MaxLength: 250

OrderReference
string

An OrderReference which will be tagged on the order. Can be set in CreateBasket or updated in UpdateBasket. MaxLength: 50

DiscountCode
string

A comma separated list of used discount codes. To clear the value set it to null or String.Empty an call UpdateBasket. MaxLength: max

ReferId
integer or null <int32>
ReferUrl
string

MaxLength: 255

ValidTo
string or null <date-time>
IsEditable
boolean

Specifies if the basket is editable. If not, any method that changes the basket will throw Exceptions (Bad Request). It will be false when the basket is no longer a basket. That is when it's paid for or cancelled.

Array of objects <BasketItem> (BasketItem)

List of the items in the basket.

Array of objects <ExtraInfo> (ExtraInfo)

List of information types with values that may be propagated on the order.

object <Summary> (Summary)
Array of objects <Promotion> (Promotion)

Contains all Promotions valid for a Basket, whether or not they are applied. If any promotions are applied more info about them are added to the corresponding Basket.Items.

IpAddress
string

The user's IpAddress when the basket was created. The value should be fetched from the user request to the application. MaxLength: 50

AttestedBy
integer or null <int32>
TypeId
integer <int32>

The internal type id of the Basket. Can be 1 = Basket, 2 = Saved Basket, 3 = Template Basket for Subscriptions.

DoHold
boolean

DoHold specifies if the resulting order should be on hold until all items on the order can be shipped or not. Default is false. This can be set in the Checkout with UpdateBasket if the Customer does not want part deliveries.

IsBuyable
boolean

IsBuyable is a rule based property indicating if the Basket's status allows the basket to be purchased. It should be regarded as readonly.

InvoiceReference
string

An InvoiceReference which will be tagged on the order. Can be set in CreateBasket or updated in UpdateBasket. MaxLength: 50

PaymentMethodId
integer or null <int32>

The PaymentMethodId from Storm. Can be set in CreateBasket or updated in UpdatePaymentMethod.

DeliveryMethodId
integer or null <int32>

The DeliveryMethodId from Storm. Can be set in CreateBasket or updated in UpdateDeliveryMethod.

SalesAreaId
integer <int32>

The SalesArea internal id of the basket. This defines the default VAT-rate used. Can be set when creating a Basket or change later with UpdateBasket. If not specified, the default for the Application will be used.

Responses
200

Success

400

Bad Request

Key: BasketItemNotBuyable. Gets raised when the basket item is not buyable or when it is inactive.

Key: BasketItemQuantityLessThanZero. Gets raised when the basket item quantity is less than zero.

500

Internal Server Error

post/ShoppingService.svc/rest/CreateBasket
Request samples
{
  • "Id": 0,
  • "CustomerId": 0,
  • "CompanyId": 0,
  • "SalesContactId": 0,
  • "StatusId": 0,
  • "CurrencyId": 0,
  • "CurrencyCode": "string",
  • "Comment": "string",
  • "OrderReference": "string",
  • "DiscountCode": "string",
  • "ReferId": 0,
  • "ReferUrl": "string",
  • "ValidTo": "2019-08-24T14:15:22Z",
  • "IsEditable": true,
  • "Items": [
    ],
  • "Info": [
    ],
  • "Summary": {
    },
  • "AppliedPromotions": [
    ],
  • "IpAddress": "string",
  • "AttestedBy": 0,
  • "TypeId": 0,
  • "DoHold": true,
  • "IsBuyable": true,
  • "InvoiceReference": "string",
  • "PaymentMethodId": 0,
  • "DeliveryMethodId": 0,
  • "SalesAreaId": 0
}
Response samples
{
  • "Id": 0,
  • "CustomerId": 0,
  • "CompanyId": 0,
  • "SalesContactId": 0,
  • "StatusId": 0,
  • "CurrencyId": 0,
  • "CurrencyCode": "string",
  • "Comment": "string",
  • "OrderReference": "string",
  • "DiscountCode": "string",
  • "ReferId": 0,
  • "ReferUrl": "string",
  • "ValidTo": "2019-08-24T14:15:22Z",
  • "IsEditable": true,
  • "Items": [
    ],
  • "Info": [
    ],
  • "Summary": {
    },
  • "AppliedPromotions": [
    ],
  • "IpAddress": "string",
  • "AttestedBy": 0,
  • "TypeId": 0,
  • "DoHold": true,
  • "IsBuyable": true,
  • "InvoiceReference": "string",
  • "PaymentMethodId": 0,
  • "DeliveryMethodId": 0,
  • "SalesAreaId": 0
}