To add a custom Shipping Method (independent of the ShippingMethods managed through the Shipping Methods API) to the Cart, it must have the Multiple ShippingMode.

interface CartAddCustomShippingMethodAction {
    action: "addCustomShippingMethod";
    custom?: CustomFieldsDraft;
    deliveries?: DeliveryDraft[];
    externalTaxRate?: ExternalTaxRateDraft;
    shippingAddress: _BaseAddress;
    shippingKey: string;
    shippingMethodName: string;
    shippingRate: ShippingRateDraft;
    shippingRateInput?: ShippingRateInputDraft;
    taxCategory?: TaxCategoryResourceIdentifier;
}

Properties

action: "addCustomShippingMethod"

Custom Fields for the custom Shipping Method.

deliveries?: DeliveryDraft[]

Deliveries to be shipped with the custom Shipping Method.

externalTaxRate?: ExternalTaxRateDraft

Tax Rate used to tax a shipping expense if the Cart has the External TaxMode.

shippingAddress: _BaseAddress

Determines the shipping rate and Tax Rate of the associated Line Items.

shippingKey: string

User-defined identifier for the custom Shipping Method that must be unique across the Cart with Multiple ShippingMode.

shippingMethodName: string

Name of the custom Shipping Method.

shippingRate: ShippingRateDraft

Determines the shipping price.

shippingRateInput?: ShippingRateInputDraft

Input used to select a ShippingRatePriceTier. The data type of this field depends on the shippingRateInputType.type configured in the Project:

- If `CartClassification`, it must be [ClassificationShippingRateInputDraft](ctp:api:type:ClassificationShippingRateInputDraft).
- If `CartScore`, it must be [ScoreShippingRateInputDraft](ctp:api:type:ScoreShippingRateInputDraft).
- If `CartValue`, it cannot be set.

Tax Category used to determine a shipping Tax Rate if the Cart has the Platform TaxMode.

Generated using TypeDoc