Typescript SDK Type Docs
    Preparing search index...

    Class ByProjectKeyInStoreKeyByStoreKeyMeCartsByIDRequestBuilder

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

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

    Methods

    • Deletes the Cart for a given id in a Store. Returns a 200 status if successful.

      A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
      
      - If no Cart exists in the Store for the given `id`.
      - If the Cart exists in the Project but does not belong to a Store, or the Cart's `store` field references a different Store.
      - If the Cart exists in the Project but does not have either a `customerId` that matches the [customer:{id}](/scopes#composable-commerce-oauth) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#composable-commerce-oauth) scope.
      

      Parameters

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

      Returns ApiRequest<Cart>

    • Returns a Cart for a given id in a Store. Returns a 200 status if the Cart exists.

      A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
      
      - If no Cart exists in the Store for the given `id`.
      - If the Cart exists but does not belong to a Store, or the Cart's `store` field references a different Store.
      - If the Cart exists but does not have either a `customerId` that matches the [customer:{id}](/scopes#composable-commerce-oauth) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#composable-commerce-oauth) scope.
      

      Parameters

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

      Returns ApiRequest<Cart>

    post

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

      Updates the Cart for a given id in a Store. Returns a 200 status if successful.

      A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
      
      - If no Cart exists in the Store for the given `id`.
      - If the Cart exists but does not belong to a Store, or the Cart's `store` field references a different Store.
      - If the Cart exists but does not have either a `customerId` that matches the [customer:{id}](/scopes#composable-commerce-oauth) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#composable-commerce-oauth) scope.
      

      Parameters

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

      Returns ApiRequest<Cart>