Typescript SDK Type Docs
    Preparing search index...

    Class ByProjectKeyShippingMethodsMatchingCartLocationRequestBuilder

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    args: {
        baseUri?: string;
        executeRequest: executeRequest;
        pathArgs: { projectKey: string };
    }

    Methods

    • Retrieves the active ShippingMethods that can ship to the provided Location with a predicate that matches the provided Cart.

      Each ShippingMethod contains exactly one ShippingRate with the flag `isMatching` set to `true`. This ShippingRate is used when the ShippingMethod is [added to the Cart](ctp:api:type:CartSetShippingMethodAction).
      
      If a matching ShippingMethod has `isDefault` set to `true`, it is returned as the first item in the array.
      

      Parameters

      • methodArgs: {
            headers?: { [key: string]: string | string[] };
            queryArgs: {
                cartId: string;
                country: string;
                expand?: string | string[];
                state?: string;
                [key: string]: QueryParam;
            };
        }

      Returns ApiRequest<ShippingMethodPagedQueryResponse>

    • Checks if an active ShippingMethod that can ship to the provided Location exists for the provided Cart. Returns a 200 OK status if the ShippingMethod exists or a Not Found error otherwise.

      Parameters

      • methodArgs: {
            headers?: { [key: string]: string | string[] };
            queryArgs: {
                cartId: string;
                country: string;
                state?: string;
                [key: string]: QueryParam;
            };
        }

      Returns ApiRequest<void>