Basket document (Shop API 23.2)
(supports custom properties)
Document representing a basket.
The following flashes are used to indicate the invalidity of a basket:
- InvalidProductItem - a product item (or bundled product item) refers to a product which no longer exists, is offline, or the product is no longer assigned to a site catalog.
- InvalidOptionItem - indicates that an option item refers to an option id or option value which no longer exists.
- OptionItemWithoutPrice - indicates an option item without a price.
- InvalidCouponCode (until 17.2) - indicates a coupon item became invalid, for example because its redemption limit is reached.
- ProductItemNotAvailable - indicates too little available inventory to support the item quantity.
- ProductItemWithoutPrice - indicates that the item has no price.
- CustomerEmailRequired (until 17.2) - indicates the need to specify a customer email.
- ShippingAddressRequired - indicates the need to specify a shipping address.
- BillingAddressRequired - indicates the need to specify a billing address.
- ShippingMethodRequired - indicates the need to specify a shipping method.
- ShippingMethodNotApplicable - indicates that the currently specified shipping method is not applicable for the given addresses or product items.
- PaymentMethodRequired - indicates the need to specify a payment method.
- PaymentMethodNotApplicable - the currently specified payment method is not applicable for the given addresses or product items.
- OrderTotalNotSet - the basket calculation could not be completed for some reason.
- ProductItemAdjustedPriceLessThanZero - a price adjustment reduces an item price to a value below zero and should be corrected.
Property | Type | Constraints | Description |
---|---|---|---|
adjusted_merchandize_total_tax |
Decimal | The products tax after discounts applying in purchase currency. Adjusted merchandize prices represent the sum of product prices before services such as shipping have been added, but after adjustment from promotions have been added. | |
adjusted_shipping_total_tax |
Decimal | The tax of all shipping line items of the line item container after shipping adjustments have been applied. | |
agent_basket |
boolean | Is the basket created by an agent? | |
basket_id |
String | The unique identifier for the basket. | |
billing_address |
OrderAddress | The billing address. This property is part of basket checkout information only. | |
bonus_discount_line_items |
[BonusDiscountLineItem] | The bonus discount line items of the line item container. | |
channel_type |
Enum {storefront, callcenter, marketplace, dss, store, pinterest, twitter, facebookads, subscriptions, onlinereservation, customerservicecenter, instagramcommerce, google, tiktok, snapchat, youtube, whatsapp} | The sales channel for the order.
This is a read-only attribute that can't be modified by an OCAPI call. For OCAPI, the sales channel is determined based on the client ID and token used for the OCAPI call. Usually, a customer-based authentication sets the channel to Storefront, and an agent-based authentication sets it to CallCenter. Using applications that use other client IDs for OCAPI calls, like Customer Service Center, will set different channel types. To modify the channel type in OCAPI, use a hook. * |
|
coupon_items |
[CouponItem] | The sorted array of coupon items. This array can be empty. | |
creation_date |
Date | Returns the value of attribute 'creationDate'. | |
currency |
String | The ISO 4217 mnemonic code of the currency. | |
customer_info |
CustomerInfo | The customer information for logged in customers. This property is part of basket checkout information only. | |
gift_certificate_items |
[GiftCertificateItem] | The sorted array of gift certificate line items. This array can be empty. | |
grouped_tax_items |
[GroupedTax] | Tax values that are summed and grouped based on the tax rate. The tax totals of the line items with the same tax rate will be grouped together and summed up. This will not affect calculation in any way. | |
inventory_reservation_expiry |
Date | ||
last_modified |
Date | Returns the value of attribute 'lastModified'. | |
merchandize_total_tax |
Decimal | The products total tax in purchase currency. Merchandize total prices represent the sum of product prices before services such as shipping or adjustment from promotions have been added. | |
notes |
SimpleLink | The notes for the line item container. | |
order_price_adjustments |
[PriceAdjustment] | The array of order level price adjustments. This array can be empty. | |
order_total |
Decimal | The total price of the order, including products, shipping and tax. This property is part of basket checkout information only. | |
payment_instruments |
[OrderPaymentInstrument] | The payment instruments list for the order. | |
product_items |
[ProductItem] | The sorted array of product items (up to a maximum of 50 items). This array can be empty. | |
product_sub_total |
Decimal | The total price of all product items after all product discounts. Depending on taxation policy the returned price is net or gross. | |
product_total |
Decimal | The total price of all product items after all product and order discounts. Depending on taxation policy the returned price is net or gross. | |
shipments |
[Shipment] | The array of shipments. This property is part of basket checkout information only. | |
shipping_items |
[ShippingItem] | The sorted array of shipping items. This array can be empty. | |
shipping_total |
Decimal | The total shipping price of the order after all shipping discounts. Excludes tax if taxation policy is net. Includes tax if taxation policy is gross. This property is part of basket checkout information only. | |
shipping_total_tax |
Decimal | The tax of all shipping line items of the line item container before shipping adjustments have been applied. | |
source_code |
String | Gets the source code assigned to this basket. | |
tax_rounded_at_group |
boolean | If the tax is rounded at group level then this is set to true, false if the tax is rounded at item or unit level | |
tax_total |
Decimal | The total tax amount of the order. This property is part of basket checkout information only. | |
taxation |
Enum {gross, net} | The taxation the line item container is based on. |
X
OCAPI versions 15.x and 16.x will be retired on March 31, 2021. For dates and more information, see the OCAPI versioning and deprecation policy and this Knowledge Article.