To set the Cart's custom Shipping Method (independent of the ShippingMethods managed through the Shipping Methods API) the Cart must have the Single ShippingMode and a shippingAddress.

To unset a custom Shipping Method on a Cart, use the [Set ShippingMethod](ctp:api:type:CartSetShippingMethodAction) update action
without the `shippingMethod` field instead.
interface CartSetCustomShippingMethodAction {
    action: "setCustomShippingMethod";
    externalTaxRate?: ExternalTaxRateDraft;
    shippingMethodName: string;
    shippingRate: ShippingRateDraft;
    taxCategory?: TaxCategoryResourceIdentifier;
}

Properties

action: "setCustomShippingMethod"
externalTaxRate?: ExternalTaxRateDraft

External Tax Rate for the shippingRate to be set if the Cart has the External TaxMode.

shippingMethodName: string

Name of the custom Shipping Method.

shippingRate: ShippingRateDraft

Determines the shipping price.

taxCategory?: TaxCategoryResourceIdentifier

Tax Category used to determine the Tax Rate when the Cart has the Platform TaxMode.