updateShippingDetails
Update the shipping details of the cart.
It uses the updateCart method to update the shipping details of the cart.
Signature
declare function updateShippingDetails(
context: CommercetoolsIntegrationContext,
cart: UpdateShippingDetailsParams,
shippingDetails: AddressInput,
customQuery?: CustomQuery
): Promise<UpdateShippingDetailsResponse>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
context | Required | CommercetoolsIntegrationContext | |
cart | Required | UpdateShippingDetailsParams | |
shippingDetails | Required | AddressInput | |
customQuery | Optional | CustomQuery |
Referenced Types
- CommercetoolsIntegrationContext
- UpdateShippingDetailsParams
- AddressInput
- CustomQuery
- UpdateShippingDetailsResponse
Examples
Setting a shipping address for the cart.
const { cart } = await sdk.commerce.updateShippingDetails(
{ id: '6931b5d2-986f-4d2b-8cba-45007a26eb5e', version: '1' },
{ firstName: 'John', lastName: 'Doe', city: 'Berlin', country: 'DE' }
);