Typescript SDK Type Docs
    Preparing search index...

    Class ByProjectKeyCartsRequestBuilder

    Index

    Constructors

    Properties

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

    Methods

    • Retrieves Carts in the Project.

      Parameters

      • OptionalmethodArgs: {
            headers?: { [key: string]: string | string[] };
            queryArgs?: {
                expand?: string | string[];
                limit?: number;
                offset?: number;
                sort?: string | string[];
                where?: string | string[];
                withTotal?: boolean;
                [key: string]: QueryParam;
            };
        }

      Returns ApiRequest<CartPagedQueryResponse>

    • Checks if one or more Carts exist for the provided query predicate. Returns a 200 status if any Carts match the query predicate, or a 404 status otherwise.

      Parameters

      • OptionalmethodArgs: {
            headers?: { [key: string]: string | string[] };
            queryArgs?: { where?: string | string[]; [key: string]: QueryParam };
        }

      Returns ApiRequest<void>

    post

    • post(
          methodArgs: {
              body: CartDraft;
              headers?: { [key: string]: string | string[] };
              queryArgs?: { expand?: string | string[]; [key: string]: QueryParam };
          },
      ): ApiRequest<Cart>

      Creates a Cart in the Project.

      If the referenced [ShippingMethod](ctp:api:type:ShippingMethod) in the [CartDraft](ctp:api:type:CartDraft) has a predicate that does not match, or if the Shipping Method is not active, an [InvalidOperation](ctp:api:type:InvalidOperationError) error is returned.
      
      Specific Error Codes:
      
      - [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError)
      - [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError)
      - [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError)
      - [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError)
      

      Parameters

      • methodArgs: {
            body: CartDraft;
            headers?: { [key: string]: string | string[] };
            queryArgs?: { expand?: string | string[]; [key: string]: QueryParam };
        }

      Returns ApiRequest<Cart>