You are reading the documentation for v7.x and earlier, which is no longer the latest version. Switch to v8.x
replaceOrgCartDeliveryAddress
Assings an existing delivery address to the B2B cart in SAP Commerce Cloud.
This method exchanges data with the replaceOrgCartDeliveryAddress endpoint exposed by the SAP OCC API B2B Carts Controller.
This method is only for an authenticated customer as it uses vsf-sap-token cookie. In case there is no cookie, it won't work.
Signature
export declare function replaceOrgCartDeliveryAddress(
context: SapccIntegrationContext,
props: ReplaceOrgCartDeliveryAddressProps
): Promise<Cart>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
context | Required | SapccIntegrationContext | |
props | Required | ReplaceOrgCartDeliveryAddressProps | Parameter object which can be used with this method. Refer to its type definition to learn about possible properties. |
Returns
Returns a representation of a Cart.
Referenced Types
- SapccIntegrationContext
ReplaceOrgCartDeliveryAddressProps- Cart
Examples
Assigning an existing delivery address to the B2B cart (make sure you are an authenticated customer).
import { sdk } from '~/sdk';
const cart = await sdk.commerce.replaceCartAddress({ cartId: '00035084', addressId: '8796716793879' });Assigning an existing delivery address to the B2B cart and selecting response fields.
import { sdk } from '~/sdk';
const cart = await sdk.commerce.replaceCartAddress({ cartId: '00035084', addressId: '8796716793879', fields: 'code,guid,user(FULL)' });