Home > @poq/sdk-sfcc > IBasketsClient
Signature:
export interface IBasketsClient
Method | Description |
---|---|
deleteBasketsByID(basketId, options) | Removes a basket. |
deleteBasketsByIDCouponsByID(basketId, couponItemId, options) | Removes a coupon from the basket. |
deleteBasketsByIDGiftCertificateItemsByID(basketId, giftCertificateItemId, options) | Deletes a gift certificate item from an existing basket. |
deleteBasketsByIDItemsByID(basketId, itemId, options) | Removes a product item from the basket. |
deleteBasketsByIDNotesByID(basketId, noteId, options) | Removes a basket note. |
deleteBasketsByIDPaymentInstrumentsByID(basketId, paymentInstrumentId, options) | Removes a payment instrument of a basket. |
deleteBasketsByIDPriceAdjustmentsByID(basketId, priceAdjustmentId, options) | Removes a custom manual price adjustment from the basket. |
deleteBasketsByIDShipmentsByID(basketId, shipmentId, options) | Removes a specified shipment and all associated product, gift certificate, shipping and price adjustment line items from a basket. You can’t remove a default shipment (id = “me”). |
getBasketsByID(basketId, options) | Gets a basket. |
getBasketsByIDApproachingDiscounts(basketId, options) | Gets the approaching discounts of a basket |
getBasketsByIDNotes(basketId, options) | Retrieves notes for a basket. |
getBasketsByIDPaymentMethods(basketId, options) | Gets applicable payment methods for an existing basket considering the open payment amount only. |
getBasketsByIDShipmentsByIDShippingMethods(basketId, shipmentId, options) | Gets the applicable shipping methods for a certain shipment of a basket. |
patchBasketsByID(basketId, body, options) | Updates a basket. Only the currency of the basket, source code, and the custom properties of the basket and of the shipping items will be considered. |
patchBasketsByIDGiftCertificateItemsByID(basketId, giftCertificateItemId, body, options) | Updates a gift certificate item of an existing basket. |
patchBasketsByIDItemsByID(basketId, itemId, body, options) | Updates an item in a basket. The following values in the request body are considered by the server: product_id: a valid product id. The purpose of this value is to exchange a variation of a variation product. shipment_id: a valid shipment id. The purpose of this value is to move a product item to another shipment. quantity: a number between 0 and 999. The purpose of this value is to change quantity of the product item. If quantity is 0, the product item is removed. option_items/option_value_id: a valid option value id. The purpose of this value is to exchange an option value for an option item of an option product. This is only possible if the product item is an option product. To change option values a collection of option items to be changed need to be provided in property option_items. Those option_items need to contain option_id and option_value_id. The provided values must be valid for the option product that this product item represents. Otherwise InvalidProductOptionItemException or InvalidProductOptionValueItemException will be thrown. custom properties c_<CUSTOM_NAME>: a value corresponding to the type defined for custom attribute <CUSTOM_NAME> of ProductLineItem. The purpose of this value is to add or change the value of a custom attribute defined for ProductLineItem. |
patchBasketsByIDPaymentInstrumentsByID(basketId, paymentInstrumentId, body, options) | Updates a payment instrument of a basket. Payment instruments are usually authorized after order creation, for example in a custom hook. The default payment authorization process executes an authorization when a payment instrument is added to an order or updated. See POST /orders/{order_no}/payment_instruments and PATCH /orders/{order_no}/payment_instruments/{payment_instrument_id} |
patchBasketsByIDPriceAdjustmentsByID(basketId, priceAdjustmentId, body, options) | Updates a custom manual price adjustment on the basket. Only the following PATH values are considered for the update: discount, item_text, reason_code and custom properties; all other attributes are ignored. The discount type of a price adjustment cannot be updated and therefore, the value of the existing type must be passed. For an adjustment of type PERCENTAGE, the ‘percentage’ attribute is mandatory. For adjustments of type AMOUNT and FIXED_PRICE, the ‘amount’ attribute is mandatory. |
patchBasketsByIDShipmentsByID(basketId, shipmentId, body, options) | Updates a shipment for a basket. The body can include updated values for the following properties: the id the shipping address the shipping method gift boolean flag gift message custom properties |
postBaskets(body, options) | Creates a new basket. The created basket is initialized with default values. Data provided in the body document will be populated into the created basket. It can be updated with further Shop API calls. Considered values from the request body are: customer information: PUT /baskets/{basket_id}/customer billing address: PUT /baskets/{basket_id}/billing_address shipments including shipping address and shipping method: POST /baskets/{basket_id}/shipments product items: POST /baskets/{basket_id}/items coupon items: POST /baskets/{basket_id}/coupons Invalid coupons are silently ignored. gift certificate items: POST /baskets/{basket_id}/gift_certificates payment method and card type: POST /baskets/{basket_id}/payment_instruments custom properties: PATCH /baskets/{basket_id} Related resource means with which resource you can specify the same data after the basket creation. Identify the basket using the basket_id property, which should be integrated into the path of an update request, for example a POST to /baskets/{basket_id}/items. The resource supports JWT or OAuth tokens for authentication: A customer must provide a JWT, which specifies exactly one customer (it may be a guest or a registered customer). In this case the resource creates a basket for this customer. An agent must provide an OAuth token. The agent can use this resource to create a basket for a new created guest customer, and can later update the customer if desired. The number of baskets which can be created per customer is limited. When a basket is created it is said to be open. It remains open until either an order is created from it using a POST to resource /orders or it is deleted using a DELETE to resource /baskets/{basket_id}. The number of open baskets allowed depends on the authentication method used: When using JWT each customer can have just one open basket When using OAuth each customer can have up to 4 open baskets (this is a quota setting which can be updated by support) Custom properties in the form c_<CUSTOM_NAME> are supported. A custom property must correspond to a custom attribute (<CUSTOM_NAME>) defined for the Basket system object, and its value must be valid for that custom attribute. Other basket properties like the channel type or source code cannot be set with this resource. |
postBasketsByIDCoupons(basketId, body, options) | Adds a coupon to an existing basket. |
postBasketsByIDGiftCertificateItems(basketId, body, options) | Adds a gift certificate item to an existing basket. |
postBasketsByIDItems(basketId, body, options) | Adds new items to a basket. The added items are associated with the specified shipment. If no shipment id is specified, the added items are associated with the default shipment. Considered values from the request body, for each item are: product_id: a valid product id. This is the id of the product to be added to the basket. If the product is already in the basket, the API either increments the quantity of the existing product line item or creates a new product line item, based on the site preference ‘Add Product Behavior’. For option products and product bundles containing variation masters, the API creates a new product line item regardless of the site preference. shipment_id: a valid shipment id (optional). This is the id of the shipment in which the product item is created. quantity: a number between 0.01 and 999. This is the quantity of the product to order. inventory_id: a valid inventory id (optional). This is the id of the inventory from which the item is allocated. bonus_discount_line_item_id: a valid bonus discount line item id (optional). This is the id of the bonus discount line item for which the added product is a selected bonus product. option_items/option_value_id: a valid option value id. This is an option value for an option item of an option product. This is only possible if the product item is an option product. To set option values, you must specify a collection of option items in the option_items property. These option items must contain option_id and option_value_id. Also, the values you specify must be valid for the option product that this product item represents. Otherwise, the server throws an InvalidProductOptionItemException or an InvalidProductOptionValueItemException. custom properties in the form c_<CUSTOM_NAME>: the custom property must correspond to a custom attribute (<CUSTOM_NAME>) defined for ProductLineItem. The value of this property must be valid for the type of custom attribute defined for ProductLineItem. |
postBasketsByIDNotes(basketId, body, options) | Adds a note to an existing basket. |
postBasketsByIDPaymentInstruments(basketId, body, options) | Adds a payment instrument to a basket. Payment instruments are usually authorized after order creation, for example in a custom hook. The default payment authorization process executes an authorization when a payment instrument is added to an order or updated. See POST /orders/{order_no}/payment_instruments and PATCH /orders/{order_no}/payment_instruments/{payment_instrument_id}. NOTE: If CREDIT_CARD is selected as the payment_method_id, it is mandatory to provide the property card_type. |
postBasketsByIDPriceAdjustments(basketId, body, options) | Adds a custom manual price adjustment to the basket. |
postBasketsByIDShipments(basketId, body, options) | Creates a new shipment for a basket. The created shipment is initialized with values provided in the body document and can be updated with further data API calls. Considered from the body are the following properties if specified: the id the shipping address the shipping method gift boolean flag gift message custom properties |
postBasketsReference(body, options) | Creates a new basket based on a basket reference. The returned basket will be a copy of the basket in the reference. The basket in the reference must be a basket of an anonymous customer and the provided customer_id in the reference must match the anonymous customer in the basket. There is a check that an authenticated customer for whom a basket is being copied doesn’t already have a basket. In case customer_id not matching a BasketNotFoundException will be returned as fault. All personal data like payment instruments and coupons will not be copied over to the new basket. When authenticated via JWT, a customer can only have one open basket and a CustomerBasketsQuotaExceededException is thrown, when the customer tries to create a second basket. Before using this endpoint to create a basket for a JWT-authenticated customer, verify that they don’t already have one. |
putBasketsByIDAgent(basketId, options) | Marks a basket as an agent basket. |
putBasketsByIDBillingAddress(basketId, useAsShipping, customerAddressId, body, options) | Sets the billing address of a basket. |
putBasketsByIDCustomer(basketId, body, options) | Sets customer information for an existing basket. |
putBasketsByIDShipmentsByIDShippingAddress(basketId, shipmentId, body, useAsBilling, customerAddressId, options) | Sets a shipping address of a specific shipment of a basket. |
putBasketsByIDShipmentsByIDShippingMethod(basketId, shipmentId, body, options) | Sets a shipping method to a specific shipment of a basket. |
putBasketsByIDStorefront(basketId, exchange, options) | Marks a basket as storefront basket. |