import { BaseClient, ClientConfig, Response } from "@commerce-apps/core";
import type { CommonParameters } from "@commerce-apps/core";
import type { OperationOptions } from "retry";
import type { RequestInit } from "node-fetch";
import type { CompositeParameters, CustomRequestBody, QueryParameters, RequireParametersUnlessAllAreOptional } from "../../types";
import type { Basket, BasketPaymentInstrumentRequest, CouponItem, CustomerInfo, GiftCertificateItem, LocaleCode, OrderAddress, OrderPaymentInstrument, PaymentMethodResult, PriceAdjustment, PriceAdjustmentRequest, ProductItem, Shipment, ShippingMethod, ShippingMethodResult, TaxItems, Taxes } from '../models/index';
export type AddCouponToBasketSfdcDwDntEnum = '0' | '1';
export type AddGiftCertificateItemToBasketSfdcDwDntEnum = '0' | '1';
export type AddItemToBasketSfdcDwDntEnum = '0' | '1';
export type AddPaymentInstrumentToBasketSfdcDwDntEnum = '0' | '1';
export type CreateBasketTaxModeEnum = 'internal' | 'external';
export type CreateBasketSfdcDwDntEnum = '0' | '1';
export type CreateShipmentForBasketSfdcDwDntEnum = '0' | '1';
export type DeleteBasketSfdcDwDntEnum = '0' | '1';
export type GetBasketSfdcDwDntEnum = '0' | '1';
export type GetBasketPersonalizedEnum = 'none';
export type GetPaymentMethodsForBasketSfdcDwDntEnum = '0' | '1';
export type GetPaymentMethodsForBasketPersonalizedEnum = 'none';
export type GetPriceBooksForBasketPersonalizedEnum = 'none';
export type GetShippingMethodsForShipmentSfdcDwDntEnum = '0' | '1';
export type GetShippingMethodsForShipmentPersonalizedEnum = 'none';
export type GetTaxesFromBasketPersonalizedEnum = 'none';
export type MergeBasketProductItemMergeModeEnum = 'higher_quantity' | 'sum_quantities' | 'saved_quantity' | 'separate_item';
export type RemoveCouponFromBasketSfdcDwDntEnum = '0' | '1';
export type RemoveGiftCertificateItemFromBasketSfdcDwDntEnum = '0' | '1';
export type RemoveItemFromBasketSfdcDwDntEnum = '0' | '1';
export type RemovePaymentInstrumentFromBasketSfdcDwDntEnum = '0' | '1';
export type RemoveShipmentFromBasketSfdcDwDntEnum = '0' | '1';
export type UpdateBasketSfdcDwDntEnum = '0' | '1';
export type UpdateBillingAddressForBasketSfdcDwDntEnum = '0' | '1';
export type UpdateCustomerForBasketSfdcDwDntEnum = '0' | '1';
export type UpdateGiftCertificateItemInBasketSfdcDwDntEnum = '0' | '1';
export type UpdateItemInBasketSfdcDwDntEnum = '0' | '1';
export type UpdateItemsInBasketSfdcDwDntEnum = '0' | '1';
export type UpdatePaymentInstrumentInBasketSfdcDwDntEnum = '0' | '1';
export type UpdateShipmentForBasketSfdcDwDntEnum = '0' | '1';
export type UpdateShippingAddressForShipmentSfdcDwDntEnum = '0' | '1';
export type UpdateShippingMethodForShipmentSfdcDwDntEnum = '0' | '1';
/**
* [Shopper Baskets](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-baskets:Summary)
* ==================================
*
* *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-baskets/shopper-baskets-oas-v1-public.yaml)
# API Overview
Use the Shopper Baskets API to create a basket in the B2C Commerce system and populate it with all the data required to ready the basket for checkout.
To create a basket, start with the [Create basket](https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=createBasket) endpoint. The endpoint creates the basket in the B2C Commerce system and returns a JSON representation of the basket with a `basketId` property.
If you provide the JSON for a prepopulated basket to the [Create basket](https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets?meta=createBasket) endpoint, you can create a basket using a single API request.
You can also create a basket and gradually populate it with data using subsequent API requests that reference the same `basketId`. The gradual approach allows you to validate the input data as you go.
The Shopper Baskets API includes endpoints to populate each part of a basket separately, including:
- Billing address
- Customer information
- Line items
- Products
- Coupons
- Gift certificates
- Payment methods
- Price books
- Shipments
- Taxation (for items and the basket itself)
In addition to creating a basket, the main `/baskets` resource offers endpoints to get, transfer, merge, and delete baskets, depending on the HTTP method that you use and the parameters that you supply. These endpoints can you help you handle a variety of complex scenarios, such as when a user starts shopping as a guest and then logs in before checkout.
You can also use the main `/baskets` resource to add custom properties to your basket, prefixed with `c_` (example: `c_faxNumber`).
When your basket is fully populated, you can use its `basketId` property to create an order with the [Shopper Orders API](https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-orders?meta=Summary).
For more detail on building baskets, see [Build Baskets and Place Orders](https://developer.salesforce.com/docs/commerce/commerce-api/guide/work-with-baskets-orders.html).
## Authentication & Authorization
The client requesting the basket information must have access to the `/baskets` resource. The Shopper Baskets API requires a shopper access token from the Shopper Login and API Access Service (SLAS).
For details on how to request a shopper access token from SLAS, see the guest user flows for [public clients](https://developer.salesforce.com/docs/commerce/commerce-api/guide/slas-public-client.html#guest-user) and [private clients](https://developer.salesforce.com/docs/commerce/commerce-api/guide/slas-private-client.html#guest-user) in the SLAS guides.
You must include `sfcc.shopper-baskets-orders` or `sfcc.shopper-baskets-orders.rw` in the client ID used to generate the SLAS token. For a full list of permissions, see the [Authorization Scopes Catalog.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/auth-z-scope-catalog.html)
The following resources require an Account Manager OAuth token with a client ID:
- `/baskets/{basketId}/taxes`
- `/baskets/{basketId}/items/{itemId}/taxes`
- `/baskets/{basketId}/price-books`
## Customization
### Custom Properties
This API supports custom properties (prefixed with `c_`). For details, see [Custom Properties.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/custom-properties.html)
### Hooks
For details on working with hooks, see [Extensibility with Hooks.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/extensibility_via_hooks.html)
## Response Details
### Personalization
Responses from this API can be personalized using the [Shopper Context API.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/shopper-context-api.html) By setting context attributes such as customer group, source code, or store ID, you can retrieve personalized promotions, pricing, and shipping methods. For details on how personalization interacts with caching, see [Personalized Caching.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html#personalized-caching)
### Caching
Responses from this API are not cached. Basket data is stateful and unique to each shopper session.
### Timeouts
Shopper API requests must respond within 10 seconds, including any hook execution. If a response exceeds this threshold, an HTTP 504 status code is returned. For details, see [Timeouts and Limits.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/timeouts-limits.html)
### Error Handling
Error responses follow the [RFC 7807](https://datatracker.ietf.org/doc/html/rfc7807) problem detail format. To trace errors, include a `correlation-id` header in your request — the response returns it as `x-correlation-id`. For details, see [HTTP Status Codes and Errors.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/error-response-codes.html)
## Use Cases
### Create a Basket
Create a new basket for the shopper.
```sh
curl "https://{shortCode}.api.commercecloud.salesforce.com/checkout/shopper-baskets/v1/organizations/{organizationId}/baskets?siteId=RefArch" \
-X POST \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{}'
```
## Basket Calculation
Unless you’re using [hooks](https://developer.salesforce.com/docs/commerce/commerce-api/guide/extensibility_via_hooks.html), each modification to a basket triggers the following calculations:
1. Calculate product prices:
- Iterate through the product line items and determine the base price of each using its price model. If multiple price books apply to a product, the lowest price is used.
- Calculate product option line item prices using the product option model.
- For bonus products, check dependent adjustments in the basket to determine the price.
2. Iterate through the gift certificate line items and calculate the price of each by multiplying the base price by the quantity.
3. Recalculate for all promotions, adding and removing them as appropriate.
4. Apply product-specific shipping costs.
5. Calculate the total shipping cost.
6. Recalculate for all promotions, adding and removing them as appropriate.
7. Calculate prices for products added by the promotion engine.
8. Calculate taxes using line item tax class codes.
- For internal tax mode, use the tax tables.
- For external tax mode, use the tax rates returned by the tax API endpoints.
9. Calculate the order’s net, tax, and gross totals by adding up the line totals.
## External Taxation
The B2C Commerce API calculates taxes internally using tax tables. If you want to integrate with a third-party tax provider, or calculate tax on your own, you can use the external taxation feature to add a taxation rate and optional taxation value. When setting a taxation rate, the taxation is calculated for this specific rate. If you pass a value, this value is used as taxation value, as well, without recalculation. To use this feature, set the `taxMode` parameter to `external` when creating the basket.
When using external taxation, you must set a tax rate either in one request to the `/baskets/{basketId}/taxes` or with separate requests for each line item, using `/baskets/{basketId}/items/{lineItemId}/taxes`.
If the tax mode of a basket is set to `external`, a tax item is required for all line items even for zero-tax items to avoid oversights.
### External Taxation with Hooks Enabled
To use external tax calculation with [hooks](https://developer.salesforce.com/docs/commerce/commerce-api/guide/extensibility_via_hooks.html), use the following API methods in the [Calculate Hook](https://developer.salesforce.com/docs/commerce/commerce-api/guide/extensibility_via_hooks.html#calculate-hook):
- `dw.order.LineItemCtnr#isExternallyTaxed`: Returns true if the basket was created with `taxMode = external`
- `dw.order.TaxMgr#applyExternalTax`: Applies externally set tax rates to the given basket. Only use when `dw.order.LineItemCtnr#isExternallyTaxed` returns true.
The following example shows an implementation of external tax calculation with hooks enabled in the [Calculate Hook](https://developer.salesforce.com/docs/commerce/commerce-api/guide/extensibility_via_hooks.html#calculate-hook):
```javascript
exports.calculate = function (basket) {
if ( basket.isExternallyTaxed() )
{
TaxMgr.applyExternalTaxation( basket ); // apply the external tax calculation based on the tax rates set by the SCAPI external taxation APIs
}
else
{
// calculation with tax tables or customization
}
}
```
## Related APIs
- [Shopper Orders](https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-orders?meta=Summary) — Place an order from a completed basket.
- [Shopper Payments](https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-payments?meta=Summary) — Retrieve payment method configuration for checkout.*
*
* For instructions on how to retrieve access token for admin APIs: https://developer.salesforce.com/docs/commerce/commerce-api/guide/authorization-for-admin-apis.html
* Example with admin auth
*
* ```typescript
* import { ShopperBaskets, ClientConfig } from "commerce-sdk";
* // or
* const { ShopperBaskets, ClientConfig } = require("commerce-sdk");
*
* const clientConfig: ClientConfig = {
* parameters: {
* clientId: "XXXXXX",
* organizationId: "XXXX",
* shortCode: "XXX",
* siteId: "XX"
* }
* };
*
* token = { access_token: 'INSERT_ACCESS_TOKEN_HERE' };
*
* clientConfig.headers['authorization'] = `Bearer ${token.access_token}`;
* const shopperBasketsClient = new ShopperBaskets(clientConfig);
* ```
*
*
* API Version: 1.4.4
* Last Updated:
*
*
*/
export declare class ShopperBaskets extends BaseClient {
constructor(config: ClientConfig);
/**
* Adds a coupon to an existing basket.
*
* If you would like to get a raw Response object use the other addCouponToBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
*
* @returns A promise of type Basket.
*/
addCouponToBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
siteId: string;
organizationId: string;
basketId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: CouponItem & CustomRequestBody;
}>): Promise;
/**
* Adds a coupon to an existing basket.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Basket otherwise.
*/
addCouponToBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
siteId: string;
organizationId: string;
basketId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: CouponItem & CustomRequestBody;
}>, rawResponse?: T): Promise;
/**
* Adds a gift certificate item to an existing basket.
*
* If you would like to get a raw Response object use the other addGiftCertificateItemToBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
*
* @returns A promise of type Basket.
*/
addGiftCertificateItemToBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
siteId: string;
organizationId: string;
basketId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: GiftCertificateItem & CustomRequestBody;
}>): Promise;
/**
* Adds a gift certificate item to an existing basket.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Basket otherwise.
*/
addGiftCertificateItemToBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
siteId: string;
organizationId: string;
basketId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: GiftCertificateItem & CustomRequestBody;
}>, rawResponse?: T): Promise;
/**
* 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:
- productId: 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.
- shipmentId: 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.
- inventoryId: a valid inventory ID (optional). This is the ID of the inventory from which the item is
allocated.
- bonusDiscountLineItemId: 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.
- optionItems/optionValueId: 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 optionItems
property. These option items must contain optionId and optionValueId. 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_: the custom property must correspond to a custom
attribute () defined for ProductLineItem. The value of this property must be valid for the
type of custom attribute defined for ProductLineItem.
*
* If you would like to get a raw Response object use the other addItemToBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
*
* @returns A promise of type Basket.
*/
addItemToBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
basketId: string;
siteId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: Array;
}>): Promise;
/**
* 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:
- productId: 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.
- shipmentId: 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.
- inventoryId: a valid inventory ID (optional). This is the ID of the inventory from which the item is
allocated.
- bonusDiscountLineItemId: 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.
- optionItems/optionValueId: 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 optionItems
property. These option items must contain optionId and optionValueId. 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_: the custom property must correspond to a custom
attribute () defined for ProductLineItem. The value of this property must be valid for the
type of custom attribute defined for ProductLineItem.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Basket otherwise.
*/
addItemToBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
basketId: string;
siteId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: Array;
}>, rawResponse?: T): Promise;
/**
* Adds a payment instrument to a basket.
*
* If you would like to get a raw Response object use the other addPaymentInstrumentToBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
*
* @returns A promise of type Basket.
*/
addPaymentInstrumentToBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
basketId: string;
siteId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: BasketPaymentInstrumentRequest & CustomRequestBody;
}>): Promise;
/**
* Adds a payment instrument to a basket.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Basket otherwise.
*/
addPaymentInstrumentToBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
basketId: string;
siteId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: BasketPaymentInstrumentRequest & CustomRequestBody;
}>, rawResponse?: T): Promise;
/**
* Adds a custom manual price adjustment to the basket.
*
* If you would like to get a raw Response object use the other addPriceAdjustmentToBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
*
* @returns A promise of type Basket.
*/
addPriceAdjustmentToBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
basketId: string;
siteId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: PriceAdjustmentRequest & CustomRequestBody;
}>): Promise;
/**
* Adds a custom manual price adjustment to the basket.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Basket otherwise.
*/
addPriceAdjustmentToBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
basketId: string;
siteId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: PriceAdjustmentRequest & CustomRequestBody;
}>, rawResponse?: T): Promise;
/**
* ( DEPRECATED ) This method allows you to put an array of priceBookIds to an existing basket, which will be used for basket calculation. This endpoint is deprecated. Use [Shopper Context](https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-context?meta=Summary), hooks or `dw.catalog.PriceBookMgr#setApplicablePriceBooks()` instead.
*
* If you would like to get a raw Response object use the other addPriceBooksToBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
*
* @returns A promise of type void.
*/
addPriceBooksToBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
basketId: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: Array;
}>): Promise;
/**
* ( DEPRECATED ) This method allows you to put an array of priceBookIds to an existing basket, which will be used for basket calculation. This endpoint is deprecated. Use [Shopper Context](https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-context?meta=Summary), hooks or `dw.catalog.PriceBookMgr#setApplicablePriceBooks()` instead.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type void otherwise.
*/
addPriceBooksToBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
basketId: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: Array;
}>, rawResponse?: T): Promise;
/**
* This method allows you to apply external taxation data to an existing basket to be able to pass tax rates and optional values for all taxable line items.
This endpoint can be called only if external taxation mode was used for basket creation. See POST /baskets for more information.
*
* If you would like to get a raw Response object use the other addTaxesForBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
*
* @returns A promise of type void.
*/
addTaxesForBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
basketId: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: Taxes & CustomRequestBody;
}>): Promise;
/**
* This method allows you to apply external taxation data to an existing basket to be able to pass tax rates and optional values for all taxable line items.
This endpoint can be called only if external taxation mode was used for basket creation. See POST /baskets for more information.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type void otherwise.
*/
addTaxesForBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
basketId: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: Taxes & CustomRequestBody;
}>, rawResponse?: T): Promise;
/**
* This method allows you to apply external taxation data to an existing basket to be able to pass tax rates and optional values for a specific taxable line item. This endpoint can be called only if external taxation mode was used for basket creation. See POST /baskets for more information.
*
* If you would like to get a raw Response object use the other addTaxesForBasketItem function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.itemId - The ID of the item to be updated.
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
*
* @returns A promise of type void.
*/
addTaxesForBasketItem(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
itemId: string;
basketId: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: TaxItems & CustomRequestBody;
}>): Promise;
/**
* This method allows you to apply external taxation data to an existing basket to be able to pass tax rates and optional values for a specific taxable line item. This endpoint can be called only if external taxation mode was used for basket creation. See POST /baskets for more information.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.itemId - The ID of the item to be updated.
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type void otherwise.
*/
addTaxesForBasketItem(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
itemId: string;
basketId: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: TaxItems & CustomRequestBody;
}>, rawResponse?: T): Promise;
/**
* Creates a new basket.
The created basket is initialized with default values. Optional JSON data provided in the request body is populated into the created basket. It can be updated with other endpoints offered by the Shopper Baskets API.
Each shopper is limited to one open basket at a time. Attempting to create a second basket for the same customer will result in a 400 Bad Request error with the message: "Customer Baskets Quota Exceeded".
A basket is considered "open" upon creation and remains in this state until it is either converted into an order or explicitly deleted. For implementation best practices, see [Hybrid Storefront Best Practices for Working with Baskets](https://developer.salesforce.com/docs/commerce/commerce-api/guide/hybrid-storefront-baskets.html#hybrid-storefront-best-practices-for-working-with-baskets).
*
* If you would like to get a raw Response object use the other createBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.taxMode - Determines how taxes are calculated.
The default value is `internal` where the tax calculation is done automatically based on internal tax tables. Setting `taxMode` to `external` allows manual modification of the tax rates and values.
External tax data is mandatory for product line items, option line items, shipping line items, coupon line items, and bonus discount line item.
Gift certificate line items are optional and use zero tax rate by default, which can be overwritten. Price adjustments cannot be set because they are either calculated or inherited.
Depending on the type, the tax rate is either obtained from the related line item or computed as a prorate of the basket.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
*
* @returns A promise of type Basket.
*/
createBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
siteId: string;
organizationId: string;
taxMode?: CreateBasketTaxModeEnum;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: Basket & CustomRequestBody;
}>): Promise;
/**
* Creates a new basket.
The created basket is initialized with default values. Optional JSON data provided in the request body is populated into the created basket. It can be updated with other endpoints offered by the Shopper Baskets API.
Each shopper is limited to one open basket at a time. Attempting to create a second basket for the same customer will result in a 400 Bad Request error with the message: "Customer Baskets Quota Exceeded".
A basket is considered "open" upon creation and remains in this state until it is either converted into an order or explicitly deleted. For implementation best practices, see [Hybrid Storefront Best Practices for Working with Baskets](https://developer.salesforce.com/docs/commerce/commerce-api/guide/hybrid-storefront-baskets.html#hybrid-storefront-best-practices-for-working-with-baskets).
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.taxMode - Determines how taxes are calculated.
The default value is `internal` where the tax calculation is done automatically based on internal tax tables. Setting `taxMode` to `external` allows manual modification of the tax rates and values.
External tax data is mandatory for product line items, option line items, shipping line items, coupon line items, and bonus discount line item.
Gift certificate line items are optional and use zero tax rate by default, which can be overwritten. Price adjustments cannot be set because they are either calculated or inherited.
Depending on the type, the tax rate is either obtained from the related line item or computed as a prorate of the basket.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Basket otherwise.
*/
createBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
siteId: string;
organizationId: string;
taxMode?: CreateBasketTaxModeEnum;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: Basket & CustomRequestBody;
}>, rawResponse?: T): Promise;
/**
* 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
*
* If you would like to get a raw Response object use the other createShipmentForBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
*
* @returns A promise of type Basket.
*/
createShipmentForBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
basketId: string;
siteId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: Shipment & CustomRequestBody;
}>): Promise;
/**
* 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
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Basket otherwise.
*/
createShipmentForBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
basketId: string;
siteId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: Shipment & CustomRequestBody;
}>, rawResponse?: T): Promise;
/**
* Removes a basket.
*
* If you would like to get a raw Response object use the other deleteBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
*
* @returns A promise of type void.
*/
deleteBasket(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
siteId: string;
organizationId: string;
basketId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>): Promise;
/**
* Removes a basket.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type void otherwise.
*/
deleteBasket(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
siteId: string;
organizationId: string;
basketId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>, rawResponse?: T): Promise;
/**
* Gets a basket.
*
* If you would like to get a raw Response object use the other getBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.parameters.personalized - Controls whether personalization is applied to the response. Set to `none` to opt out of personalized response handling so the response is safe to cache at the CDN layer.
When set to `none`, the server skips applying personalization to the response.
Setting `personalized=none` is necessary but not sufficient for CDN caching: a response is only cached when the endpoint is also cacheable in the [server-side web-tier cache](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html), subject to its TTLs and invalidation. A call that is uncacheable in the web tier is not cached at the CDN either. See [CDN caching](https://developer.salesforce.com/docs/commerce/commerce-api/guide/cdn-caching.html).
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
*
* @returns A promise of type Basket.
*/
getBasket(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
siteId: string;
organizationId: string;
basketId: string;
locale?: LocaleCode;
personalized?: GetBasketPersonalizedEnum;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>): Promise;
/**
* Gets a basket.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.parameters.personalized - Controls whether personalization is applied to the response. Set to `none` to opt out of personalized response handling so the response is safe to cache at the CDN layer.
When set to `none`, the server skips applying personalization to the response.
Setting `personalized=none` is necessary but not sufficient for CDN caching: a response is only cached when the endpoint is also cacheable in the [server-side web-tier cache](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html), subject to its TTLs and invalidation. A call that is uncacheable in the web tier is not cached at the CDN either. See [CDN caching](https://developer.salesforce.com/docs/commerce/commerce-api/guide/cdn-caching.html).
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Basket otherwise.
*/
getBasket(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
siteId: string;
organizationId: string;
basketId: string;
locale?: LocaleCode;
personalized?: GetBasketPersonalizedEnum;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>, rawResponse?: T): Promise;
/**
* Gets applicable payment methods for an existing basket considering the open payment amount only.
*
* If you would like to get a raw Response object use the other getPaymentMethodsForBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.parameters.personalized - Controls whether personalization is applied to the response. Set to `none` to opt out of personalized response handling so the response is safe to cache at the CDN layer.
When set to `none`, the server skips applying personalization to the response.
Setting `personalized=none` is necessary but not sufficient for CDN caching: a response is only cached when the endpoint is also cacheable in the [server-side web-tier cache](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html), subject to its TTLs and invalidation. A call that is uncacheable in the web tier is not cached at the CDN either. See [CDN caching](https://developer.salesforce.com/docs/commerce/commerce-api/guide/cdn-caching.html).
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
*
* @returns A promise of type PaymentMethodResult.
*/
getPaymentMethodsForBasket(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
basketId: string;
siteId: string;
locale?: LocaleCode;
personalized?: GetPaymentMethodsForBasketPersonalizedEnum;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>): Promise;
/**
* Gets applicable payment methods for an existing basket considering the open payment amount only.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.parameters.personalized - Controls whether personalization is applied to the response. Set to `none` to opt out of personalized response handling so the response is safe to cache at the CDN layer.
When set to `none`, the server skips applying personalization to the response.
Setting `personalized=none` is necessary but not sufficient for CDN caching: a response is only cached when the endpoint is also cacheable in the [server-side web-tier cache](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html), subject to its TTLs and invalidation. A call that is uncacheable in the web tier is not cached at the CDN either. See [CDN caching](https://developer.salesforce.com/docs/commerce/commerce-api/guide/cdn-caching.html).
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type PaymentMethodResult otherwise.
*/
getPaymentMethodsForBasket(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
basketId: string;
siteId: string;
locale?: LocaleCode;
personalized?: GetPaymentMethodsForBasketPersonalizedEnum;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>, rawResponse?: T): Promise;
/**
* ( DEPRECATED ) Gets applicable price books for an existing basket. This endpoint is deprecated.
Use [Shopper Context](https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-context?meta=Summary),
hooks or `dw.catalog.PriceBookMgr#getApplicablePriceBooks()` instead.
*
* If you would like to get a raw Response object use the other getPriceBooksForBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.personalized - Controls whether personalization is applied to the response. Set to `none` to opt out of personalized response handling so the response is safe to cache at the CDN layer.
When set to `none`, the server skips applying personalization to the response.
Setting `personalized=none` is necessary but not sufficient for CDN caching: a response is only cached when the endpoint is also cacheable in the [server-side web-tier cache](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html), subject to its TTLs and invalidation. A call that is uncacheable in the web tier is not cached at the CDN either. See [CDN caching](https://developer.salesforce.com/docs/commerce/commerce-api/guide/cdn-caching.html).
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
*
* @returns A promise of type Array.
*/
getPriceBooksForBasket(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
basketId: string;
siteId: string;
personalized?: GetPriceBooksForBasketPersonalizedEnum;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>): Promise>;
/**
* ( DEPRECATED ) Gets applicable price books for an existing basket. This endpoint is deprecated.
Use [Shopper Context](https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-context?meta=Summary),
hooks or `dw.catalog.PriceBookMgr#getApplicablePriceBooks()` instead.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.personalized - Controls whether personalization is applied to the response. Set to `none` to opt out of personalized response handling so the response is safe to cache at the CDN layer.
When set to `none`, the server skips applying personalization to the response.
Setting `personalized=none` is necessary but not sufficient for CDN caching: a response is only cached when the endpoint is also cacheable in the [server-side web-tier cache](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html), subject to its TTLs and invalidation. A call that is uncacheable in the web tier is not cached at the CDN either. See [CDN caching](https://developer.salesforce.com/docs/commerce/commerce-api/guide/cdn-caching.html).
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Array otherwise.
*/
getPriceBooksForBasket(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
basketId: string;
siteId: string;
personalized?: GetPriceBooksForBasketPersonalizedEnum;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>, rawResponse?: T): Promise>;
/**
* Gets the applicable shipping methods for a certain shipment of a basket.
*
* If you would like to get a raw Response object use the other getShippingMethodsForShipment function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.shipmentId - The ID of the shipment to be modified.
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.parameters.personalized - Controls whether personalization is applied to the response. Set to `none` to opt out of personalized response handling so the response is safe to cache at the CDN layer.
When set to `none`, the server skips applying personalization to the response.
Setting `personalized=none` is necessary but not sufficient for CDN caching: a response is only cached when the endpoint is also cacheable in the [server-side web-tier cache](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html), subject to its TTLs and invalidation. A call that is uncacheable in the web tier is not cached at the CDN either. See [CDN caching](https://developer.salesforce.com/docs/commerce/commerce-api/guide/cdn-caching.html).
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
*
* @returns A promise of type ShippingMethodResult.
*/
getShippingMethodsForShipment(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
shipmentId: string;
basketId: string;
siteId: string;
locale?: LocaleCode;
personalized?: GetShippingMethodsForShipmentPersonalizedEnum;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>): Promise;
/**
* Gets the applicable shipping methods for a certain shipment of a basket.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.shipmentId - The ID of the shipment to be modified.
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.parameters.personalized - Controls whether personalization is applied to the response. Set to `none` to opt out of personalized response handling so the response is safe to cache at the CDN layer.
When set to `none`, the server skips applying personalization to the response.
Setting `personalized=none` is necessary but not sufficient for CDN caching: a response is only cached when the endpoint is also cacheable in the [server-side web-tier cache](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html), subject to its TTLs and invalidation. A call that is uncacheable in the web tier is not cached at the CDN either. See [CDN caching](https://developer.salesforce.com/docs/commerce/commerce-api/guide/cdn-caching.html).
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type ShippingMethodResult otherwise.
*/
getShippingMethodsForShipment(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
shipmentId: string;
basketId: string;
siteId: string;
locale?: LocaleCode;
personalized?: GetShippingMethodsForShipmentPersonalizedEnum;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>, rawResponse?: T): Promise;
/**
* This method gives you the external taxation data set by the PUT taxes API. This endpoint can be called only if external taxation mode was used for basket creation. See POST /baskets for more information.
*
* If you would like to get a raw Response object use the other getTaxesFromBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.personalized - Controls whether personalization is applied to the response. Set to `none` to opt out of personalized response handling so the response is safe to cache at the CDN layer.
When set to `none`, the server skips applying personalization to the response.
Setting `personalized=none` is necessary but not sufficient for CDN caching: a response is only cached when the endpoint is also cacheable in the [server-side web-tier cache](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html), subject to its TTLs and invalidation. A call that is uncacheable in the web tier is not cached at the CDN either. See [CDN caching](https://developer.salesforce.com/docs/commerce/commerce-api/guide/cdn-caching.html).
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
*
* @returns A promise of type Taxes.
*/
getTaxesFromBasket(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
basketId: string;
siteId: string;
personalized?: GetTaxesFromBasketPersonalizedEnum;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>): Promise;
/**
* This method gives you the external taxation data set by the PUT taxes API. This endpoint can be called only if external taxation mode was used for basket creation. See POST /baskets for more information.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.personalized - Controls whether personalization is applied to the response. Set to `none` to opt out of personalized response handling so the response is safe to cache at the CDN layer.
When set to `none`, the server skips applying personalization to the response.
Setting `personalized=none` is necessary but not sufficient for CDN caching: a response is only cached when the endpoint is also cacheable in the [server-side web-tier cache](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html), subject to its TTLs and invalidation. A call that is uncacheable in the web tier is not cached at the CDN either. See [CDN caching](https://developer.salesforce.com/docs/commerce/commerce-api/guide/cdn-caching.html).
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Taxes otherwise.
*/
getTaxesFromBasket(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
basketId: string;
siteId: string;
personalized?: GetTaxesFromBasketPersonalizedEnum;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>, rawResponse?: T): Promise;
/**
* ( DEPRECATED ) Instead of using this endpoint, we recommend using the `/baskets/actions/transfer` endpoint with the `merge=true` parameter, because the transfer endpoint offers greater customization by invoking a hook, allowing for adjustments if the default implementation does not process the merge as expected.
Merge data from the previous shopper's basket into the current shopper's active basket and delete the previous shopper's basket. This endpoint doesn't merge Personally Identifiable Information (PII). You must obtain the shopper authorization token via SLAS and you must provide the ‘guest usid‘ in both the ‘/oauth2/login‘ and ‘/oauth2/token‘ calls while fetching the registered user JWT token. After the merge, all basket amounts are recalculated and totaled, including lookups for prices, taxes, shipping, and promotions, unless hooks are enabled.
The following information is merged:
- custom attributes on the basket and on all copied records
- product items
- gift certificate items
- coupon items
- shipments
- ad-hoc price adjustments
To control the merging of products that exist in both baskets, use the `productItemMergeMode` parameter. By default, the higher of the two basket quantities is used for each product. Products in both baskets are considered to be the same when all of the following values match (if one product doesn't have a value, the other product is a match only if it also doesn't have that value):
- shipment
- productId
- option values
- wishlist reference
- inventory list id
- gift flag & message
- ad-hoc price adjustments
If any of the listed values don't match, then the item in the previous shopper's basket is copied to a new line item in the current shopper's basket. If the listed values all match, but the matching products have different values for any custom attribute, the merged line item keeps the custom attribute value from the current shopper's basket.
A success response contains the current shopper's active basket. The previous guest shopper's active basket is deleted.
If the current shopper doesn't have an active basket, and the createDestinationBasket request parameter is false, then the merge request returns a BasketMergeException (HTTP status 409). You can proceed with one of these options:
- Transfer the previous shopper's active basket to the current logged-in shopper by calling the `baskets/transfer` endpoint.
- Force the merge by calling the `baskets/merge` endpoint again, with the parameter `createDestinationBasket=true`. Forcing the merge creates a new basket for the current shopper and copies information from the previous shopper's basket into it. Because the merge doesn't copy all basket data, a forced merge is not the same as a transfer. For example, the new basket doesn't contain any Personally Identifiable Information (PII) from the previous basket.
### before merge
| Previous Shopper's Basket, SKU: Quantity, Custom Attributes | Current Shopper's Basket, SKU: Quantity, Custom Attributes |
|-------------------------------------------------------------|-------------------------------------------------------------|
| SKU_A: 5
SKU_B: 3
SKU_C: 4
c_customAttr_1: 'ABC'
c_customAttr_2: 'DEF' | SKU_A: 2
SKU_D: 6
SKU_E: 7
c_customAttr_1: 'UVW'
c_customAttr_3: 'XYZ' |
### after merge - (previous shopper's basket is deleted)
| productItemMergeMode | Current Shopper's Basket - SKU: Quantity, Custom Attributes |
|----------------------|--------------------------------------------------------------|
| sum_quantities | SKU_A: 7
SKU_B: 3
SKU_C: 4
SKU_D: 6
SKU_E: 7
c_customAttr_1: 'UVW'
c_customAttr_2: 'DEF'
c_customAttr_3: 'XYZ' |
| higher_quantity | SKU_A: 5
SKU_B: 3
SKU_C: 4
SKU_D: 6
SKU_E: 7
c_customAttr_1: 'UVW'
c_customAttr_2: 'DEF'
c_customAttr_3: 'XYZ' |
| saved_quantity | SKU_A: 2
SKU_B: 3
SKU_C: 4
SKU_D: 6
SKU_E: 7
c_customAttr_1: 'UVW'
c_customAttr_2: 'DEF'
c_customAttr_3: 'XYZ' |
| separate_item | SKU_A: 5
SKU_B: 3
SKU_C: 4
SKU_A: 2
SKU_D: 6
SKU_E: 7
c_customAttr_1: 'UVW'
c_customAttr_2: 'DEF'
c_customAttr_3: 'XYZ' |
*
* If you would like to get a raw Response object use the other mergeBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.createDestinationBasket - If the current shopper has an active basket, this parameter is ignored. If the current shopper has no active basket, this parameter controls the behavior:
- `false` (default): Return a BasketMergeException (HTTP status 409).
- `true`: Force the merge by creating a basket for the current shopper and copying information from the previous shopper's basket into it. Return success (HTTP status 200).
* @param options.parameters.productItemMergeMode - This parameter controls the quantity calculation for products that exist in both baskets.
- higher_quantity (default): Compare the product's quantities in each basket, and use the higher value.
- sum_quantities: Use the sum of the product's quantities from both baskets.
- saved_quantity: Use the product's quantity in the current shopper's active basket. Ignore the quantity from the previous shopper's basket.
- separate_item: Add a separate product item to the current shopper's basket for the quantity in the previous shopper's basket.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
*
* @returns A promise of type Basket.
*/
mergeBasket(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
siteId: string;
organizationId: string;
createDestinationBasket?: boolean;
productItemMergeMode?: MergeBasketProductItemMergeModeEnum;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>): Promise;
/**
* ( DEPRECATED ) Instead of using this endpoint, we recommend using the `/baskets/actions/transfer` endpoint with the `merge=true` parameter, because the transfer endpoint offers greater customization by invoking a hook, allowing for adjustments if the default implementation does not process the merge as expected.
Merge data from the previous shopper's basket into the current shopper's active basket and delete the previous shopper's basket. This endpoint doesn't merge Personally Identifiable Information (PII). You must obtain the shopper authorization token via SLAS and you must provide the ‘guest usid‘ in both the ‘/oauth2/login‘ and ‘/oauth2/token‘ calls while fetching the registered user JWT token. After the merge, all basket amounts are recalculated and totaled, including lookups for prices, taxes, shipping, and promotions, unless hooks are enabled.
The following information is merged:
- custom attributes on the basket and on all copied records
- product items
- gift certificate items
- coupon items
- shipments
- ad-hoc price adjustments
To control the merging of products that exist in both baskets, use the `productItemMergeMode` parameter. By default, the higher of the two basket quantities is used for each product. Products in both baskets are considered to be the same when all of the following values match (if one product doesn't have a value, the other product is a match only if it also doesn't have that value):
- shipment
- productId
- option values
- wishlist reference
- inventory list id
- gift flag & message
- ad-hoc price adjustments
If any of the listed values don't match, then the item in the previous shopper's basket is copied to a new line item in the current shopper's basket. If the listed values all match, but the matching products have different values for any custom attribute, the merged line item keeps the custom attribute value from the current shopper's basket.
A success response contains the current shopper's active basket. The previous guest shopper's active basket is deleted.
If the current shopper doesn't have an active basket, and the createDestinationBasket request parameter is false, then the merge request returns a BasketMergeException (HTTP status 409). You can proceed with one of these options:
- Transfer the previous shopper's active basket to the current logged-in shopper by calling the `baskets/transfer` endpoint.
- Force the merge by calling the `baskets/merge` endpoint again, with the parameter `createDestinationBasket=true`. Forcing the merge creates a new basket for the current shopper and copies information from the previous shopper's basket into it. Because the merge doesn't copy all basket data, a forced merge is not the same as a transfer. For example, the new basket doesn't contain any Personally Identifiable Information (PII) from the previous basket.
### before merge
| Previous Shopper's Basket, SKU: Quantity, Custom Attributes | Current Shopper's Basket, SKU: Quantity, Custom Attributes |
|-------------------------------------------------------------|-------------------------------------------------------------|
| SKU_A: 5
SKU_B: 3
SKU_C: 4
c_customAttr_1: 'ABC'
c_customAttr_2: 'DEF' | SKU_A: 2
SKU_D: 6
SKU_E: 7
c_customAttr_1: 'UVW'
c_customAttr_3: 'XYZ' |
### after merge - (previous shopper's basket is deleted)
| productItemMergeMode | Current Shopper's Basket - SKU: Quantity, Custom Attributes |
|----------------------|--------------------------------------------------------------|
| sum_quantities | SKU_A: 7
SKU_B: 3
SKU_C: 4
SKU_D: 6
SKU_E: 7
c_customAttr_1: 'UVW'
c_customAttr_2: 'DEF'
c_customAttr_3: 'XYZ' |
| higher_quantity | SKU_A: 5
SKU_B: 3
SKU_C: 4
SKU_D: 6
SKU_E: 7
c_customAttr_1: 'UVW'
c_customAttr_2: 'DEF'
c_customAttr_3: 'XYZ' |
| saved_quantity | SKU_A: 2
SKU_B: 3
SKU_C: 4
SKU_D: 6
SKU_E: 7
c_customAttr_1: 'UVW'
c_customAttr_2: 'DEF'
c_customAttr_3: 'XYZ' |
| separate_item | SKU_A: 5
SKU_B: 3
SKU_C: 4
SKU_A: 2
SKU_D: 6
SKU_E: 7
c_customAttr_1: 'UVW'
c_customAttr_2: 'DEF'
c_customAttr_3: 'XYZ' |
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.createDestinationBasket - If the current shopper has an active basket, this parameter is ignored. If the current shopper has no active basket, this parameter controls the behavior:
- `false` (default): Return a BasketMergeException (HTTP status 409).
- `true`: Force the merge by creating a basket for the current shopper and copying information from the previous shopper's basket into it. Return success (HTTP status 200).
* @param options.parameters.productItemMergeMode - This parameter controls the quantity calculation for products that exist in both baskets.
- higher_quantity (default): Compare the product's quantities in each basket, and use the higher value.
- sum_quantities: Use the sum of the product's quantities from both baskets.
- saved_quantity: Use the product's quantity in the current shopper's active basket. Ignore the quantity from the previous shopper's basket.
- separate_item: Add a separate product item to the current shopper's basket for the quantity in the previous shopper's basket.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Basket otherwise.
*/
mergeBasket(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
siteId: string;
organizationId: string;
createDestinationBasket?: boolean;
productItemMergeMode?: MergeBasketProductItemMergeModeEnum;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>, rawResponse?: T): Promise;
/**
* Removes a coupon from the basket.
*
* If you would like to get a raw Response object use the other removeCouponFromBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.couponItemId - The ID of the coupon item.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
*
* @returns A promise of type Basket.
*/
removeCouponFromBasket(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
siteId: string;
organizationId: string;
basketId: string;
couponItemId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>): Promise;
/**
* Removes a coupon from the basket.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.couponItemId - The ID of the coupon item.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Basket otherwise.
*/
removeCouponFromBasket(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
siteId: string;
organizationId: string;
basketId: string;
couponItemId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>, rawResponse?: T): Promise;
/**
* Deletes a gift certificate item from an existing basket.
*
* If you would like to get a raw Response object use the other removeGiftCertificateItemFromBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.giftCertificateItemId - the ID of the gift certificate item to be updated.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
*
* @returns A promise of type Basket.
*/
removeGiftCertificateItemFromBasket(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
siteId: string;
organizationId: string;
basketId: string;
giftCertificateItemId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>): Promise;
/**
* Deletes a gift certificate item from an existing basket.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.giftCertificateItemId - the ID of the gift certificate item to be updated.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Basket otherwise.
*/
removeGiftCertificateItemFromBasket(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
siteId: string;
organizationId: string;
basketId: string;
giftCertificateItemId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>, rawResponse?: T): Promise;
/**
* Removes a product item from the basket.
*
* If you would like to get a raw Response object use the other removeItemFromBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.itemId - The ID of the item to be updated.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
*
* @returns A promise of type Basket.
*/
removeItemFromBasket(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
itemId: string;
organizationId: string;
basketId: string;
siteId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>): Promise;
/**
* Removes a product item from the basket.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.itemId - The ID of the item to be updated.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Basket otherwise.
*/
removeItemFromBasket(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
itemId: string;
organizationId: string;
basketId: string;
siteId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>, rawResponse?: T): Promise;
/**
* Removes a payment instrument of a basket.
*
* If you would like to get a raw Response object use the other removePaymentInstrumentFromBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.paymentInstrumentId -
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
*
* @returns A promise of type Basket.
*/
removePaymentInstrumentFromBasket(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
paymentInstrumentId: string;
organizationId: string;
basketId: string;
siteId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>): Promise;
/**
* Removes a payment instrument of a basket.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.paymentInstrumentId -
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Basket otherwise.
*/
removePaymentInstrumentFromBasket(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
paymentInstrumentId: string;
organizationId: string;
basketId: string;
siteId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>, rawResponse?: T): Promise;
/**
* Removes a custom manual price adjustment from the basket.
*
* If you would like to get a raw Response object use the other removePriceAdjustmentFromBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.priceAdjustmentId -
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
*
* @returns A promise of type Basket.
*/
removePriceAdjustmentFromBasket(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
priceAdjustmentId: string;
organizationId: string;
basketId: string;
siteId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>): Promise;
/**
* Removes a custom manual price adjustment from the basket.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.priceAdjustmentId -
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Basket otherwise.
*/
removePriceAdjustmentFromBasket(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
priceAdjustmentId: string;
organizationId: string;
basketId: string;
siteId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>, rawResponse?: T): Promise;
/**
* Removes a specified shipment and all associated product, gift certificate,
shipping, and price adjustment line items from a basket.
It is not allowed to remove the default shipment.
*
* If you would like to get a raw Response object use the other removeShipmentFromBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.shipmentId - The ID of the shipment to be modified.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
*
* @returns A promise of type Basket.
*/
removeShipmentFromBasket(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
shipmentId: string;
organizationId: string;
basketId: string;
siteId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>): Promise;
/**
* Removes a specified shipment and all associated product, gift certificate,
shipping, and price adjustment line items from a basket.
It is not allowed to remove the default shipment.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.shipmentId - The ID of the shipment to be modified.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Basket otherwise.
*/
removeShipmentFromBasket(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
shipmentId: string;
organizationId: string;
basketId: string;
siteId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>, rawResponse?: T): Promise;
/**
* Transfer the previous shopper's basket to the current shopper by updating the basket's owner. No other values change. You must obtain the shopper authorization token via SLAS and you must provide the ‘guest usid‘ in both the ‘/oauth2/login‘ and ‘/oauth2/token‘ calls while fetching the registered user JWT token.
This endpoint provides different methods for handling the scenario in which both a previous guest shopper and the current registered shopper have an active basket attached, and utilizes the `merge` parameter as follows:
- `true` (recommended): Triggers a merge hook for graceful handling and prevents 409 status returns. For more information, refer to the `merge` parameter documentation.
- `false`: Either overrides the basket of the current registered shopper or returns a 409 response, and allows you to choose between the options explained below.
If you call the endpoint with `merge=false` and the current shopper has an active basket, you have two options using the `overrideExisting` parameter. Setting it to `true` deletes the registered user's basket, while setting it to `false` returns a `BasketTransferException` (HTTP status 409), after which you can choose how to proceed:
- Keep the current shopper's active basket.
- Merge the previous and current shoppers' baskets by calling the `baskets/actions/merge` endpoint.
- Force the transfer by calling the `baskets/actions/transfer` endpoint again, with the parameter `overrideExisting=true`. Forcing the transfer deletes the current shopper's active basket.
A successful response provides the transferred (and merged) current basket. However, if neither the previous nor current shopper had an active basket, a 204 (No Content) response is returned.
*
* If you would like to get a raw Response object use the other transferBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.overrideExisting - If the current shopper has no active basket, this parameter is ignored. If the current shopper has an active basket, this parameter controls the behavior:
- `false` (default): Return a BasketTransferException (HTTP status 409). The basket owner doesn't change.
- `true`: Force the transfer by deleting the current shopper's active basket and making the current shopper the owner of the previous shopper's basket. Returns the transferred basket (HTTP status 200).
* @param options.parameters.merge - This parameter controls the behavior:
- `false` (default): Transfers the basket or returns a 409 response with the appropriate message (taking `overrideExisting` in consideration).
- `true`: (recommended): Executes the dw.order.mergeBasket hook if at least one basket exists.
The hook dw.order.mergeBasket default implementation merges a source basket into the current basket. This behavior can be customized, as shown
in this [sample implementation](https://gist.github.com/sf-thomas-loesche/3446c7d71a97e559bf1caee96ae56d9f).
There are four possible use cases:
a) Guest basket and registered basket exist
The guest basket becomes the current basket for the registered shopper by updating the basket's owner (no personal data is removed). The hook
dw.order.mergeBasket is called with the source basket (former registered shopper basket) and the transferred current basket (former guest basket).
b) Guest basket exists but no registered basket exists
The guest basket becomes the current basket for the registered shopper by updating the basket's owner (no personal data is removed). The hook
dw.order.mergeBasket is called without the source basket (null passed to the hook) and the transferred current basket (former guest basket).
c) No guest basket exists but a registered basket exists
The registered basket is retained. The hook dw.order.mergeBasket is called with the retained current basket but without the source basket (null
passed to the hook).
d) Neither basket exists
The hook dw.order.mergeBasket is not called.
The API returns the current basket (after executing dw.order.mergeBasket).
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
*
* @returns A promise of type Basket.
*/
transferBasket(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
siteId: string;
organizationId: string;
overrideExisting?: boolean;
merge?: boolean;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>): Promise;
/**
* Transfer the previous shopper's basket to the current shopper by updating the basket's owner. No other values change. You must obtain the shopper authorization token via SLAS and you must provide the ‘guest usid‘ in both the ‘/oauth2/login‘ and ‘/oauth2/token‘ calls while fetching the registered user JWT token.
This endpoint provides different methods for handling the scenario in which both a previous guest shopper and the current registered shopper have an active basket attached, and utilizes the `merge` parameter as follows:
- `true` (recommended): Triggers a merge hook for graceful handling and prevents 409 status returns. For more information, refer to the `merge` parameter documentation.
- `false`: Either overrides the basket of the current registered shopper or returns a 409 response, and allows you to choose between the options explained below.
If you call the endpoint with `merge=false` and the current shopper has an active basket, you have two options using the `overrideExisting` parameter. Setting it to `true` deletes the registered user's basket, while setting it to `false` returns a `BasketTransferException` (HTTP status 409), after which you can choose how to proceed:
- Keep the current shopper's active basket.
- Merge the previous and current shoppers' baskets by calling the `baskets/actions/merge` endpoint.
- Force the transfer by calling the `baskets/actions/transfer` endpoint again, with the parameter `overrideExisting=true`. Forcing the transfer deletes the current shopper's active basket.
A successful response provides the transferred (and merged) current basket. However, if neither the previous nor current shopper had an active basket, a 204 (No Content) response is returned.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.overrideExisting - If the current shopper has no active basket, this parameter is ignored. If the current shopper has an active basket, this parameter controls the behavior:
- `false` (default): Return a BasketTransferException (HTTP status 409). The basket owner doesn't change.
- `true`: Force the transfer by deleting the current shopper's active basket and making the current shopper the owner of the previous shopper's basket. Returns the transferred basket (HTTP status 200).
* @param options.parameters.merge - This parameter controls the behavior:
- `false` (default): Transfers the basket or returns a 409 response with the appropriate message (taking `overrideExisting` in consideration).
- `true`: (recommended): Executes the dw.order.mergeBasket hook if at least one basket exists.
The hook dw.order.mergeBasket default implementation merges a source basket into the current basket. This behavior can be customized, as shown
in this [sample implementation](https://gist.github.com/sf-thomas-loesche/3446c7d71a97e559bf1caee96ae56d9f).
There are four possible use cases:
a) Guest basket and registered basket exist
The guest basket becomes the current basket for the registered shopper by updating the basket's owner (no personal data is removed). The hook
dw.order.mergeBasket is called with the source basket (former registered shopper basket) and the transferred current basket (former guest basket).
b) Guest basket exists but no registered basket exists
The guest basket becomes the current basket for the registered shopper by updating the basket's owner (no personal data is removed). The hook
dw.order.mergeBasket is called without the source basket (null passed to the hook) and the transferred current basket (former guest basket).
c) No guest basket exists but a registered basket exists
The registered basket is retained. The hook dw.order.mergeBasket is called with the retained current basket but without the source basket (null
passed to the hook).
d) Neither basket exists
The hook dw.order.mergeBasket is not called.
The API returns the current basket (after executing dw.order.mergeBasket).
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Basket otherwise.
*/
transferBasket(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
siteId: string;
organizationId: string;
overrideExisting?: boolean;
merge?: boolean;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>, rawResponse?: T): Promise;
/**
* Marks a basket as an agent basket.
*
* If you would like to get a raw Response object use the other updateAsAgentBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
*
* @returns A promise of type Basket.
*/
updateAsAgentBasket(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
siteId: string;
organizationId: string;
basketId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>): Promise;
/**
* Marks a basket as an agent basket.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Basket otherwise.
*/
updateAsAgentBasket(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
siteId: string;
organizationId: string;
basketId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>, rawResponse?: T): Promise;
/**
* Marks a basket as a storefront basket.
*
* If you would like to get a raw Response object use the other updateAsStorefrontBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.exchange - If true, an existing storefront basket is exchanged and marked as an agent basket. If false, a `CustomerBasketsQuotaExceededException` is thrown.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
*
* @returns A promise of type Basket.
*/
updateAsStorefrontBasket(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
basketId: string;
siteId: string;
exchange?: boolean;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>): Promise;
/**
* Marks a basket as a storefront basket.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.exchange - If true, an existing storefront basket is exchanged and marked as an agent basket. If false, a `CustomerBasketsQuotaExceededException` is thrown.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Basket otherwise.
*/
updateAsStorefrontBasket(options?: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
basketId: string;
siteId: string;
exchange?: boolean;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
}>, rawResponse?: T): Promise;
/**
* Updates a basket. Only the currency of the basket, source code, the custom
properties of the basket, and the shipping items will be considered.
*
* If you would like to get a raw Response object use the other updateBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.removeExternalTax - If `true` (default value), the external tax rates are removed from the basket and set to null. To add external tax rates to a basket, use the `addTaxesForBasket` or `addTaxesForBasketItem` endpoint. The removal of external tax rates depends on the update performed on the basket, for example: an update to the `currency` triggers a removal. Set this parameter to `false` to disable the removal of external tax rates/values.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
*
* @returns A promise of type Basket.
*/
updateBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
siteId: string;
organizationId: string;
basketId: string;
removeExternalTax?: boolean;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: Basket & CustomRequestBody;
}>): Promise;
/**
* Updates a basket. Only the currency of the basket, source code, the custom
properties of the basket, and the shipping items will be considered.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.removeExternalTax - If `true` (default value), the external tax rates are removed from the basket and set to null. To add external tax rates to a basket, use the `addTaxesForBasket` or `addTaxesForBasketItem` endpoint. The removal of external tax rates depends on the update performed on the basket, for example: an update to the `currency` triggers a removal. Set this parameter to `false` to disable the removal of external tax rates/values.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Basket otherwise.
*/
updateBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
siteId: string;
organizationId: string;
basketId: string;
removeExternalTax?: boolean;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: Basket & CustomRequestBody;
}>, rawResponse?: T): Promise;
/**
* Sets the billing address of a basket.
*
* If you would like to get a raw Response object use the other updateBillingAddressForBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.parameters.useAsShipping - When true, the address is also used as the shipping address.
* @param options.parameters.removeExternalTax - If `true` (default value), the external tax rates are removed from the basket and set to null. To add external tax rates to a basket, use the `addTaxesForBasket` or `addTaxesForBasketItem` endpoint. The removal of external tax rates depends on the update performed on the basket, for example: an update to the `currency` triggers a removal. Set this parameter to `false` to disable the removal of external tax rates/values.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
*
* @returns A promise of type Basket.
*/
updateBillingAddressForBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
siteId: string;
organizationId: string;
basketId: string;
locale?: LocaleCode;
useAsShipping?: boolean;
removeExternalTax?: boolean;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: OrderAddress & CustomRequestBody;
}>): Promise;
/**
* Sets the billing address of a basket.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.parameters.useAsShipping - When true, the address is also used as the shipping address.
* @param options.parameters.removeExternalTax - If `true` (default value), the external tax rates are removed from the basket and set to null. To add external tax rates to a basket, use the `addTaxesForBasket` or `addTaxesForBasketItem` endpoint. The removal of external tax rates depends on the update performed on the basket, for example: an update to the `currency` triggers a removal. Set this parameter to `false` to disable the removal of external tax rates/values.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Basket otherwise.
*/
updateBillingAddressForBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
siteId: string;
organizationId: string;
basketId: string;
locale?: LocaleCode;
useAsShipping?: boolean;
removeExternalTax?: boolean;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: OrderAddress & CustomRequestBody;
}>, rawResponse?: T): Promise;
/**
* Sets customer information for an existing basket.
*
* If you would like to get a raw Response object use the other updateCustomerForBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
*
* @returns A promise of type Basket.
*/
updateCustomerForBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
siteId: string;
organizationId: string;
basketId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: CustomerInfo & CustomRequestBody;
}>): Promise;
/**
* Sets customer information for an existing basket.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Basket otherwise.
*/
updateCustomerForBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
siteId: string;
organizationId: string;
basketId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: CustomerInfo & CustomRequestBody;
}>, rawResponse?: T): Promise;
/**
* Updates a gift certificate item of an existing basket.
*
* If you would like to get a raw Response object use the other updateGiftCertificateItemInBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.giftCertificateItemId - the ID of the gift certificate item to be updated.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
*
* @returns A promise of type Basket.
*/
updateGiftCertificateItemInBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
siteId: string;
organizationId: string;
basketId: string;
giftCertificateItemId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: GiftCertificateItem & CustomRequestBody;
}>): Promise;
/**
* Updates a gift certificate item of an existing basket.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.giftCertificateItemId - the ID of the gift certificate item to be updated.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Basket otherwise.
*/
updateGiftCertificateItemInBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
siteId: string;
organizationId: string;
basketId: string;
giftCertificateItemId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: GiftCertificateItem & CustomRequestBody;
}>, rawResponse?: T): Promise;
/**
* Possible reasons:
- no product item with given item ID was found for the basket.
- the product with the given product ID in the
request body is invalid.
- a null quantity value.
- an option with the specified option id is unknown.
- an option with the specified option value id is unknown.
- the given shipment ID is invalid.
- the customer assigned to the basket does not.
match the verified customer represented by the JWT token.
*
* If you would like to get a raw Response object use the other updateItemInBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.itemId - The ID of the item to be updated.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.removeExternalTax - If `true` (default value), the external tax rates are removed from the basket and set to null. To add external tax rates to a basket, use the `addTaxesForBasket` or `addTaxesForBasketItem` endpoint. The removal of external tax rates depends on the update performed on the basket, for example: an update to the `currency` triggers a removal. Set this parameter to `false` to disable the removal of external tax rates/values.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
*
* @returns A promise of type Basket.
*/
updateItemInBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
itemId: string;
organizationId: string;
basketId: string;
siteId: string;
removeExternalTax?: boolean;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: ProductItem & CustomRequestBody;
}>): Promise;
/**
* Possible reasons:
- no product item with given item ID was found for the basket.
- the product with the given product ID in the
request body is invalid.
- a null quantity value.
- an option with the specified option id is unknown.
- an option with the specified option value id is unknown.
- the given shipment ID is invalid.
- the customer assigned to the basket does not.
match the verified customer represented by the JWT token.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.itemId - The ID of the item to be updated.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.removeExternalTax - If `true` (default value), the external tax rates are removed from the basket and set to null. To add external tax rates to a basket, use the `addTaxesForBasket` or `addTaxesForBasketItem` endpoint. The removal of external tax rates depends on the update performed on the basket, for example: an update to the `currency` triggers a removal. Set this parameter to `false` to disable the removal of external tax rates/values.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Basket otherwise.
*/
updateItemInBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
itemId: string;
organizationId: string;
basketId: string;
siteId: string;
removeExternalTax?: boolean;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: ProductItem & CustomRequestBody;
}>, rawResponse?: T): Promise;
/**
* Updates multiple items in a basket. This behaviour matches that of updating a
single item, but the body contains an array of ProductItems to be updated that are identified by `itemId`.
The items to update can include bundled product items, although the
kind of update supported for bundled product items is limited to `productId`, `gift`, `giftMessage`
and custom properties.
The following values in the request body are considered by the server:
- `itemId` (mandatory): identifies an item to be updated.
- `productId`: a valid product ID. The purpose of this
value is to change the variation of a variation product.
- `shipmentId`: 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 the quantity of the product item. If the quantity is 0,
the product item is removed.
- `optionItems`/`optionValueId`: 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 the option items to be changed must be
provided in the property `optionItems`. Those
`optionItems` must contain `optionId`
and `optionValueId`. The provided values must be valid
for the option product that this product item represents. Otherwise,
`InvalidProductOptionItemException` or
`InvalidProductOptionValueItemException` is thrown.
- custom properties `c_`: a
value corresponding to the type defined for custom attribute
`` of the ProductLineItem. The purpose of this value is to
add or change the value of a custom attribute defined for the
ProductLineItem.
- `gift`: a boolean value that specifies whether the item is a gift.
- `giftMessage`: a message to include with the gift.
*
* If you would like to get a raw Response object use the other updateItemsInBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.removeExternalTax - If `true` (default value), the external tax rates are removed from the basket and set to null. To add external tax rates to a basket, use the `addTaxesForBasket` or `addTaxesForBasketItem` endpoint. The removal of external tax rates depends on the update performed on the basket, for example: an update to the `currency` triggers a removal. Set this parameter to `false` to disable the removal of external tax rates/values.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
*
* @returns A promise of type Basket.
*/
updateItemsInBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
basketId: string;
siteId: string;
removeExternalTax?: boolean;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: Array;
}>): Promise;
/**
* Updates multiple items in a basket. This behaviour matches that of updating a
single item, but the body contains an array of ProductItems to be updated that are identified by `itemId`.
The items to update can include bundled product items, although the
kind of update supported for bundled product items is limited to `productId`, `gift`, `giftMessage`
and custom properties.
The following values in the request body are considered by the server:
- `itemId` (mandatory): identifies an item to be updated.
- `productId`: a valid product ID. The purpose of this
value is to change the variation of a variation product.
- `shipmentId`: 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 the quantity of the product item. If the quantity is 0,
the product item is removed.
- `optionItems`/`optionValueId`: 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 the option items to be changed must be
provided in the property `optionItems`. Those
`optionItems` must contain `optionId`
and `optionValueId`. The provided values must be valid
for the option product that this product item represents. Otherwise,
`InvalidProductOptionItemException` or
`InvalidProductOptionValueItemException` is thrown.
- custom properties `c_`: a
value corresponding to the type defined for custom attribute
`` of the ProductLineItem. The purpose of this value is to
add or change the value of a custom attribute defined for the
ProductLineItem.
- `gift`: a boolean value that specifies whether the item is a gift.
- `giftMessage`: a message to include with the gift.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.removeExternalTax - If `true` (default value), the external tax rates are removed from the basket and set to null. To add external tax rates to a basket, use the `addTaxesForBasket` or `addTaxesForBasketItem` endpoint. The removal of external tax rates depends on the update performed on the basket, for example: an update to the `currency` triggers a removal. Set this parameter to `false` to disable the removal of external tax rates/values.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Basket otherwise.
*/
updateItemsInBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
basketId: string;
siteId: string;
removeExternalTax?: boolean;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: Array;
}>, rawResponse?: T): Promise;
/**
* Updates payment instrument of an existing basket.
*
* If you would like to get a raw Response object use the other updatePaymentInstrumentInBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.paymentInstrumentId -
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.removeExternalTax - If `true` (default value), the external tax rates are removed from the basket and set to null. To add external tax rates to a basket, use the `addTaxesForBasket` or `addTaxesForBasketItem` endpoint. The removal of external tax rates depends on the update performed on the basket, for example: an update to the `currency` triggers a removal. Set this parameter to `false` to disable the removal of external tax rates/values.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
*
* @returns A promise of type Basket.
*/
updatePaymentInstrumentInBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
paymentInstrumentId: string;
organizationId: string;
basketId: string;
siteId: string;
removeExternalTax?: boolean;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: OrderPaymentInstrument & CustomRequestBody;
}>): Promise;
/**
* Updates payment instrument of an existing basket.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.paymentInstrumentId -
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.removeExternalTax - If `true` (default value), the external tax rates are removed from the basket and set to null. To add external tax rates to a basket, use the `addTaxesForBasket` or `addTaxesForBasketItem` endpoint. The removal of external tax rates depends on the update performed on the basket, for example: an update to the `currency` triggers a removal. Set this parameter to `false` to disable the removal of external tax rates/values.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Basket otherwise.
*/
updatePaymentInstrumentInBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
paymentInstrumentId: string;
organizationId: string;
basketId: string;
siteId: string;
removeExternalTax?: boolean;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: OrderPaymentInstrument & CustomRequestBody;
}>, rawResponse?: T): Promise;
/**
* Updates a custom manual price adjustment on the basket. Only the following path values are considered for the update; all other attributes are ignored.
- `discount`
- `itemText`
- `reasonCode`
- `custom properties`
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.
*
* If you would like to get a raw Response object use the other updatePriceAdjustmentInBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.priceAdjustmentId -
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
*
* @returns A promise of type Basket.
*/
updatePriceAdjustmentInBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
priceAdjustmentId: string;
organizationId: string;
basketId: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: PriceAdjustment & CustomRequestBody;
}>): Promise;
/**
* Updates a custom manual price adjustment on the basket. Only the following path values are considered for the update; all other attributes are ignored.
- `discount`
- `itemText`
- `reasonCode`
- `custom properties`
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.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.priceAdjustmentId -
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Basket otherwise.
*/
updatePriceAdjustmentInBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
priceAdjustmentId: string;
organizationId: string;
basketId: string;
siteId: string;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: PriceAdjustment & CustomRequestBody;
}>, rawResponse?: T): Promise;
/**
* Updates a shipment for a basket.
The 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
*
* If you would like to get a raw Response object use the other updateShipmentForBasket function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.shipmentId - The ID of the shipment to be modified.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
*
* @returns A promise of type Basket.
*/
updateShipmentForBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
shipmentId: string;
organizationId: string;
basketId: string;
siteId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: Shipment & CustomRequestBody;
}>): Promise;
/**
* Updates a shipment for a basket.
The 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
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.shipmentId - The ID of the shipment to be modified.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Basket otherwise.
*/
updateShipmentForBasket(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
shipmentId: string;
organizationId: string;
basketId: string;
siteId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: Shipment & CustomRequestBody;
}>, rawResponse?: T): Promise;
/**
* Sets a shipping address of a specific shipment of a basket.
*
* If you would like to get a raw Response object use the other updateShippingAddressForShipment function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.shipmentId - The ID of the shipment to be modified.
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.useAsBilling - When true, the address is also used as the billing address.
* @param options.parameters.removeExternalTax - If `true` (default value), the external tax rates are removed from the basket and set to null. To add external tax rates to a basket, use the `addTaxesForBasket` or `addTaxesForBasketItem` endpoint. The removal of external tax rates depends on the update performed on the basket, for example: an update to the `currency` triggers a removal. Set this parameter to `false` to disable the removal of external tax rates/values.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
*
* @returns A promise of type Basket.
*/
updateShippingAddressForShipment(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
shipmentId: string;
basketId: string;
siteId: string;
useAsBilling?: boolean;
removeExternalTax?: boolean;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: OrderAddress & CustomRequestBody;
}>): Promise;
/**
* Sets a shipping address of a specific shipment of a basket.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.shipmentId - The ID of the shipment to be modified.
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.useAsBilling - When true, the address is also used as the billing address.
* @param options.parameters.removeExternalTax - If `true` (default value), the external tax rates are removed from the basket and set to null. To add external tax rates to a basket, use the `addTaxesForBasket` or `addTaxesForBasketItem` endpoint. The removal of external tax rates depends on the update performed on the basket, for example: an update to the `currency` triggers a removal. Set this parameter to `false` to disable the removal of external tax rates/values.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Basket otherwise.
*/
updateShippingAddressForShipment(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
shipmentId: string;
basketId: string;
siteId: string;
useAsBilling?: boolean;
removeExternalTax?: boolean;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: OrderAddress & CustomRequestBody;
}>, rawResponse?: T): Promise;
/**
* Sets a shipping method to a specific shipment of a basket.
*
* If you would like to get a raw Response object use the other updateShippingMethodForShipment function.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.shipmentId - The ID of the shipment to be modified.
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
*
* @returns A promise of type Basket.
*/
updateShippingMethodForShipment(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
shipmentId: string;
basketId: string;
siteId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: ShippingMethod & CustomRequestBody;
}>): Promise;
/**
* Sets a shipping method to a specific shipment of a basket.
*
* @param options - An object containing the options for this method.
* @param options.parameters - An object containing the parameters for this method.
* @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).
* @param options.parameters.shipmentId - The ID of the shipment to be modified.
* @param options.parameters.basketId - The ID of the basket to be modified.
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
* @param options.retrySettings - Retry options for the `node-retry` package
* @param options.fetchOptions - Fetch options for the `make-fetch-happen` package
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
* @param options.body - The data to send as the request body.
* @param rawResponse - Set to true to return entire Response object instead of DTO.
*
* @returns A promise of type Response if rawResponse is true, a promise of type Basket otherwise.
*/
updateShippingMethodForShipment(options: RequireParametersUnlessAllAreOptional<{
parameters?: CompositeParameters<{
organizationId: string;
shipmentId: string;
basketId: string;
siteId: string;
locale?: LocaleCode;
} & QueryParameters, CommonParameters>;
retrySettings?: OperationOptions;
fetchOptions?: RequestInit;
headers?: {
[key: string]: string;
};
body: ShippingMethod & CustomRequestBody;
}>, rawResponse?: T): Promise;
}