Constructors

Properties

Methods

Constructors

Properties

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

Methods

  • Returns all Carts that match a given Query Predicate and contain either a matching customerId or anonymousId.

    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 a Cart exists that matches a given Query Predicate and contains either a matching customerId or anonymousId. Returns a 200 OK status if the Cart exists, or a ResourceNotFound error otherwise.

    Parameters

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

    Returns ApiRequest<void>

  • Creates a Cart for the Customer or anonymous user. The customerId or anonymousId field on the Cart is automatically set based on the customer:{id} or anonymous_id:{id} scope.

    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: MyCartDraft;
          headers?: { [key: string]: string | string[] };
          queryArgs?: { expand?: string | string[]; [key: string]: QueryParam };
      }

    Returns ApiRequest<Cart>