# Insert items into a basket post purchase Adds the provided items to the already checked out basket and updates the authorization for the payment. Calling this mehtod will close the basket. Endpoint: POST /InsertItemsPostPurchase Version: 1.1 ## Query parameters: - `basketId` (integer, required) The internal id of the basket to update. - `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. ## Request fields (application/json): - `ItemsToAdd` (array) The items to add to the purchase. The items to insert must have its PartNo, Quantity and PriceListId set. ParentLineNo, Name, Comment, ReferId and ReferUrl can be used if other values than the default are wanted. All other properties will be populated from the system. - `ItemsToAdd.Id` (integer,null) Internal id of the basket item. Used to refer to this particular row in different methods. - `ItemsToAdd.LineNo` (integer) Line number of the item. Used to refer to this particular row in different methods. - `ItemsToAdd.ParentLineNo` (integer,null) If this item is part of a bundle, an attached item from promotion or such this property will refer to the associated line number. - `ItemsToAdd.ProductId` (integer) Internal product id of the product for this basket item. - `ItemsToAdd.PartNo` (string) The PartNo of this Item. Must be specified when adding items to a basket. MaxLength: 50. - `ItemsToAdd.ManufacturerPartNo` (string) Manufacturer part number. Populated by Storm. MaxLength: 50. - `ItemsToAdd.Name` (string) Name of the product. Populated by Storm. MaxLength: 255. - `ItemsToAdd.SubHeader` (string) Sub header of the product. Populated by Storm. MaxLength: 255. - `ItemsToAdd.ThumbnailImage` (string) MaxLength: 255. Obsolete! - Use ImageKey with preset - `ItemsToAdd.FlagIdSeed` (string) A comma separated list of internal flag ids. MaxLength: max. - `ItemsToAdd.Type` (integer) The internal type id of the underlying product. See ListSkuTypes under Products. - `ItemsToAdd.PriceDisplay` (number) This is the price, excluding VAT, after applying company discounts and promotions. It is what the customer is paying. - `ItemsToAdd.Price` (number,null) This is the snapshot value, excluding VAT, of PriceDisplay when the basket is bought. Should be null. Can be used to set a price from the application when updating or creating BasketItems. Then IsPriceManual must be set to true as well. - `ItemsToAdd.PriceOriginal` (number) This is the original price of the SKU, excluding VAT. - `ItemsToAdd.Cost` (number,null) CostPurchase from Storm Admin, excluding VAT. - `ItemsToAdd.VatRate` (number) A rate to multiply with price to get price inc VAT. 25% VAT equals a VatRate of 1.25. - `ItemsToAdd.Quantity` (number) The Quantity of this Item. Must be specified when adding items to a basket. - `ItemsToAdd.UOM` (string) MaxLength: 50. - `ItemsToAdd.UOMCount` (number,null) - `ItemsToAdd.Comment` (string) Free text comment for this basket item. MaxLength: 255. - `ItemsToAdd.PriceListId` (integer) The internal pricelist id of this Item. Must be specified when adding items to a basket. Use the PriceListId from Product or ProductItem. - `ItemsToAdd.ReferId` (integer,null) Used to tag a BasketItem with some external id. - `ItemsToAdd.ReferUrl` (string) Used to tag a BasketItem with an incoming URL. MaxLength: 255. - `ItemsToAdd.IsEditable` (boolean) Indicates if a basket item is editable or not. This can happen when the API splits rows in promotions. Can be checked to see if an item should be allowed for UpdateBasketItem. - `ItemsToAdd.IsDiscountable` (boolean) - `ItemsToAdd.Info` (array) List of information types and values associated with this particular basket item. - `ItemsToAdd.Info.TypeId` (integer) The internal id of type. This TypeId might be different in different tiers such as Stage and Production. Use Code if hard coding is required. - `ItemsToAdd.Info.Value` (string) The Value of the Entity. MaxLength: max. - `ItemsToAdd.Info.Code` (string) The Code of the type, if existing. Use this value when hard coding is required. MaxLength: 50. - `ItemsToAdd.OptionalItems` (array) - `ItemsToAdd.OnHandValue` (number) Obsolete! - Moved to OnHand property - `ItemsToAdd.IncomingValue` (number) Obsolete! - Moved to OnHand property - `ItemsToAdd.NextDeliveryDate` (string,null) Obsolete! - Moved to OnHand property - `ItemsToAdd.LeadtimeDayCount` (integer,null) Obsolete! - Moved to OnHand property - `ItemsToAdd.PromotionIdSeed` (string) Internal ids of promotions applied on this product. MaxLength: max. - `ItemsToAdd.ImageKey` (string,null) A unique id for the image at our image server. Url for images are formed like http://[client specific CDN]/{ImageKey}. Preset, height and width can be sent as parameters. - `ItemsToAdd.ManufacturerName` (string) Name of the manufacturer of the product. Populated by Storm. MaxLength: 100. - `ItemsToAdd.CategoryId` (integer,null) Obsolete! - Use CategoryIdSeed - `ItemsToAdd.OnHand` (object) - `ItemsToAdd.OnHand.Value` (number) The aggregated value from all warehouses and locations in the current context (Web, Supplier or Store). - `ItemsToAdd.OnHand.IncomingValue` (number) The incoming quantity on the next delivery. - `ItemsToAdd.OnHand.NextDeliveryDate` (string,null) The next delivery data from supplier to client warehouse. - `ItemsToAdd.OnHand.LeadtimeDayCount` (integer,null) The number of days it takes to ship from the supplier. - `ItemsToAdd.OnHand.LastChecked` (string,null) When onHand info was last checked. Null if never. - `ItemsToAdd.OnHand.IsActive` (boolean) Indicate if the product is stocked in a store. - `ItemsToAdd.OnHand.IsReturnable` (boolean) Indicate if the product is returnable in a store. - `ItemsToAdd.OnHand.Info` (array) List of IdValues for the OnHand data for this sku warehouse location combination. This will always be null unless fetched with any of the ProductOnHand methods. - `ItemsToAdd.OnHand.Info.Id` (integer) The internal Id of the Entity. This Id might be different in different tiers such as Stage and Production. Use Code if hard coding is required. - `ItemsToAdd.OnHand.Info.Code` (string) The Code of the Entity, if existing. Use this value when hard coding is required. MaxLength: 255. - `ItemsToAdd.OnHandSupplier` (object) - `ItemsToAdd.PriceRecommended` (number,null) The rule based price, excluding VAT, from a priceList, if specified. - `ItemsToAdd.ManufacturerId` (integer) Internal manufacturer id for the product. Populated by Storm. - `ItemsToAdd.UniqueName` (string) A unique name that can be used in Urls and to get a Product. GetProduct and GetProductByUniqueName gets the same Product. MaxLength: 500. - `ItemsToAdd.StatusId` (integer) The status of the underlying product. Lookup references in ListStatuses. - `ItemsToAdd.StockDisplayBreakPoint` (integer,null) A value that can be used for display logic regarding OnHand. - `ItemsToAdd.PriceCatalog` (number,null) The original price, excluding VAT, if specified. - `ItemsToAdd.IsBuyable` (boolean) Indicates if the item is buyable or not. Will always be false if the status is closed. An exception will be thrown if IsBuyable is false and an attempt to buy the item is made. - `ItemsToAdd.SubDescription` (string) Sub description from Storm Admin. MaxLength: max. - `ItemsToAdd.CategoryIdSeed` (string) A comma separated list of internal category ids ordered so the primary category is first. MaxLength: max. - `ItemsToAdd.RecommendedQuantity` (number,null) Indicates the default value used as quantity when buying the product. If IsRecommendedQuantityFixed is true, only multiples of this quantity should be allowed. - `ItemsToAdd.IsRecommendedQuantityFixed` (boolean) If this is set to true only multiples of RecommendedQuantity should be allowed. - `ItemsToAdd.AppliedPromotions` (array) Applied promotions for this item, if any. It will contain some info about what promotion was applied and amount applied. - `ItemsToAdd.AppliedPromotions.Id` (integer,null) The internal id of the Promotion. - `ItemsToAdd.AppliedPromotions.Name` (string) The Name of the Promotion. MaxLength: 255. - `ItemsToAdd.AppliedPromotions.DiscountCode` (string) Will contain the discountCode if the promotion has a discountCode requirement. MaxLength: max. - `ItemsToAdd.AppliedPromotions.AppliedAmount` (number,null) Applied discount amount, excluding VAT, for this Promotion on this BasketItem. - `ItemsToAdd.AppliedPromotions.AppliedAmountIncVat` (number,null) Applied discount amount, including VAT, for this Promotion on this BasketItem. - `ItemsToAdd.RequirementPromotionIdSeed` (string) A comma separated list of promotion internal ids for this item that are fulfilling the requirements. MaxLength: max. - `ItemsToAdd.IsSubscribable` (boolean) True if this item can be added to a Subscription. False otherwise. Can be used when copying BasketItems from one Basket to a TemplateBasket in a Subacription. - `ItemsToAdd.DescriptionHeader` (string) DescriptionHeader for the product as specified in Storm Admin. MaxLength: 255. - `ItemsToAdd.IsPriceManual` (boolean) Used when setting price on a BasketItem from the application. Manual prices are not discountable when applying promotions or company discounts. - `ItemsToAdd.PriceStandard` (number,null) The standard price, excluding VAT, if specified. - `ItemsToAdd.EanCode` (string) SKU EAN code. MaxLength: 50. - `ItemsToAdd.CostUnit` (number,null) CostUnit, excluding VAT, from Storm Admin. - `ItemsToAdd.PriceDisplayIncVat` (number) This is the price including VAT after applying company discounts and promotions. It is what the customer is paying. - `ItemsToAdd.PriceListLocked` (boolean,null) Set to true to exclude this item's price list from business logic when selecting cheapest price. Will be set to false if price list is unavailable. - `ItemsToAdd.PriceOriginalIncVat` (number) This is the original price of the SKU, including VAT. - `ItemsToAdd.PriceRecommendedIncVat` (number,null) The rule based price, including VAT, from a priceList, if specified. - `ItemsToAdd.PriceCatalogIncVat` (number,null) The original price, including VAT, if specified. - `ItemsToAdd.PriceStandardIncVat` (number,null) The standard price, including VAT, if specified. - `PaymentParameters` (array) Roundtrip of the parameters received in the original payment response. - `PaymentParameters.Name` (string) The Name of the Entity. MaxLength: 50. ## Response 200 fields (application/json): - `Status` (string) String response. OK if successful, otherwise may have different values depending on PSP. MaxLength: 50. - `StatusDescription` (string) Descriptive text for the status. MaxLength: 255. - `BasketId` (integer,null) Internal id of the associated basket. - `OrderNo` (string) Order number if order's been created. MaxLength: 50. - `PaymentCode` (string) Internal identifier of this specific payment attempt. MaxLength: int. - `PaymentReference` (string) External identifier of this specific payment attempt, usually from the PSP. MaxLength: 50. - `HostedPaymentPage` (string) Used when a payment should be finalized on a different platform, e.g. sending a link by SMS to customer. MaxLength: 50. - `RedirectUrl` (string) Configurated redirection URL after successful payment. MaxLength: 255. - `RedirectParameters` (array) PSP specific data returned for the payment. See PSP documentation. - `RedirectParameters.Name` (string) The Name of the Entity. MaxLength: 50. - `RedirectParameters.Value` (string) The Value of the Entity. MaxLength: max. - `IsSyncronous` (boolean,null) Indicates if the payment attempt was synchronous or not. - `PaymentServiceId` (integer,null) Internal id of the payment service used.