Hierarchy

  • Cart

Properties

impersonating: boolean = false

Methods

  • Description

    enables impersonation by calling the subsequent method with the stored impersonation token

    Example

    Cart.As().List() // lists Cart using the impersonated users' token
    

    Returns Cart

  • Calculate the cart. Check out the docs for more info

    Type Parameters

    • TOrderWorksheet extends OrderWorksheet<any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, TOrderWorksheet>

    Parameters

    Returns Promise<RequiredDeep<TOrderWorksheet>>

  • Create a new cart bundle item. Adds bundle line items to the cart Check out the docs for more info

    Type Parameters

    • TLineItem extends LineItem<any, any, any, any, any, TLineItem>

    Parameters

    Returns Promise<RequiredDeep<TLineItem>>

  • Create a new cart line item. Adds a line item to the cart Check out the docs for more info

    Type Parameters

    • TLineItem extends LineItem<any, any, any, any, any, TLineItem>

    Parameters

    Returns Promise<RequiredDeep<TLineItem>>

  • Delete a cart. Empties the cart. Any promotions, payments or other items associated with the cart will also be removed. Check out the docs for more info

    Parameters

    Returns Promise<void>

  • Delete a cart bundle item. Check out the docs for more info

    Parameters

    • bundleID: string

      ID of the bundle.

    • bundleItemID: string

      ID of the bundle item.

    • requestOptions: RequestOptions = {}

    Returns Promise<void>

  • Delete a cart line item. Check out the docs for more info

    Parameters

    • lineItemID: string

      ID of the line item.

    • requestOptions: RequestOptions = {}

    Returns Promise<void>

  • Delete a cart payment. Check out the docs for more info

    Parameters

    • paymentID: string

      ID of the payment.

    • requestOptions: RequestOptions = {}

    Returns Promise<void>

  • Delete a cart payment transaction. Check out the docs for more info

    Parameters

    • paymentID: string

      ID of the payment.

    • transactionID: string

      ID of the transaction.

    • requestOptions: RequestOptions = {}

    Returns Promise<void>

  • Delete a cart promotion. Check out the docs for more info

    Parameters

    • promoCode: string

      Promo code of the cart.

    • requestOptions: RequestOptions = {}

    Returns Promise<void>

  • Estimate shipping cost. Check out the docs for more info

    Type Parameters

    • TOrderWorksheet extends OrderWorksheet<any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, TOrderWorksheet>

    Parameters

    Returns Promise<RequiredDeep<TOrderWorksheet>>

  • Get a single cart. If the ID of the Order returned is null, the cart has not yet been interacted with. Once an item is added, the Order.ID will be populated. Check out the docs for more info

    Type Parameters

    • TOrder extends Order<any, any, any, TOrder>

    Parameters

    Returns Promise<RequiredDeep<TOrder>>

  • Get a single cart line item. Check out the docs for more info

    Type Parameters

    • TLineItem extends LineItem<any, any, any, any, any, TLineItem>

    Parameters

    • lineItemID: string

      ID of the line item.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TLineItem>>

  • Get a single cart order worksheet. Check out the docs for more info

    Type Parameters

    • TOrderWorksheet extends OrderWorksheet<any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, TOrderWorksheet>

    Parameters

    Returns Promise<RequiredDeep<TOrderWorksheet>>

  • List eligible promotions. Get a list of promotions eligible for the cart. Check out the docs for more info

    Type Parameters

    Parameters

    • listOptions: {
          filters?: Filters;
          page?: number;
          pageSize?: number;
          search?: string;
          searchOn?: ("ID" | "Name" | "Description" | "Code" | "FinePrint" | "EligibleExpression" | "ValueExpression")[];
          sortBy?: ("ID" | "Name" | "ExpirationDate" | "Code" | "EligibleExpression" | "ValueExpression" | "!ID" | "!Name" | "!ExpirationDate" | "DateApplied" | "StartDate" | "CanCombine" | "AutoApply" | "Active" | "Priority" | "!Code" | "!DateApplied" | "!StartDate" | "!EligibleExpression" | "!ValueExpression" | "!CanCombine" | "!AutoApply" | "!Active" | "!Priority")[];
      } = {}
      • Optional filters?: Filters

        An object or dictionary representing key/value pairs to apply as filters. Valid keys are top-level properties of the returned model or 'xp.???'

      • Optional page?: number

        Page of results to return. Default: 1. When paginating through many items (> page 30), we recommend the "Last ID" method, as outlined in the Advanced Querying documentation.

      • Optional pageSize?: number

        Number of results to return per page. Default: 20, max: 100.

      • Optional search?: string

        Word or phrase to search for.

      • Optional searchOn?: ("ID" | "Name" | "Description" | "Code" | "FinePrint" | "EligibleExpression" | "ValueExpression")[]

        Comma-delimited list of fields to search on.

      • Optional sortBy?: ("ID" | "Name" | "ExpirationDate" | "Code" | "EligibleExpression" | "ValueExpression" | "!ID" | "!Name" | "!ExpirationDate" | "DateApplied" | "StartDate" | "CanCombine" | "AutoApply" | "Active" | "Priority" | "!Code" | "!DateApplied" | "!StartDate" | "!EligibleExpression" | "!ValueExpression" | "!CanCombine" | "!AutoApply" | "!Active" | "!Priority")[]

        Comma-delimited list of fields to sort by.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredObjectDeep<ListPage<TOrderPromotion>>>

  • Get a list of cart line items. Check out the docs for more info

    Type Parameters

    • TLineItem extends LineItem<any, any, any, any, any, TLineItem>

    Parameters

    • listOptions: {
          filters?: Filters;
          page?: number;
          pageSize?: number;
          search?: string;
          searchOn?: ("ID" | "ProductID")[];
          sortBy?: ("ID" | "ProductID" | "!ID" | "DateAdded" | "!DateAdded" | "!ProductID")[];
      } = {}
      • Optional filters?: Filters

        An object or dictionary representing key/value pairs to apply as filters. Valid keys are top-level properties of the returned model or 'xp.???'

      • Optional page?: number

        Page of results to return. Default: 1. When paginating through many items (> page 30), we recommend the "Last ID" method, as outlined in the Advanced Querying documentation.

      • Optional pageSize?: number

        Number of results to return per page. Default: 20, max: 100.

      • Optional search?: string

        Word or phrase to search for.

      • Optional searchOn?: ("ID" | "ProductID")[]

        Comma-delimited list of fields to search on.

      • Optional sortBy?: ("ID" | "ProductID" | "!ID" | "DateAdded" | "!DateAdded" | "!ProductID")[]

        Comma-delimited list of fields to sort by.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredObjectDeep<ListPage<TLineItem>>>

  • Get a list of cart payments. Check out the docs for more info

    Type Parameters

    • TPayment extends Payment<any, any, TPayment>

    Parameters

    • listOptions: {
          filters?: Filters;
          page?: number;
          pageSize?: number;
          search?: string;
          searchOn?: ("ID" | "Description")[];
          sortBy?: ("ID" | "DateCreated" | "!ID" | "!DateCreated" | "Type" | "CreditCardID" | "SpendingAccountID" | "!Type" | "!CreditCardID" | "!SpendingAccountID")[];
      } = {}
      • Optional filters?: Filters

        An object or dictionary representing key/value pairs to apply as filters. Valid keys are top-level properties of the returned model or 'xp.???'

      • Optional page?: number

        Page of results to return. Default: 1. When paginating through many items (> page 30), we recommend the "Last ID" method, as outlined in the Advanced Querying documentation.

      • Optional pageSize?: number

        Number of results to return per page. Default: 20, max: 100.

      • Optional search?: string

        Word or phrase to search for.

      • Optional searchOn?: ("ID" | "Description")[]

        Comma-delimited list of fields to search on.

      • Optional sortBy?: ("ID" | "DateCreated" | "!ID" | "!DateCreated" | "Type" | "CreditCardID" | "SpendingAccountID" | "!Type" | "!CreditCardID" | "!SpendingAccountID")[]

        Comma-delimited list of fields to sort by.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredObjectDeep<ListPage<TPayment>>>

  • Get a list of cart promotions. Check out the docs for more info

    Type Parameters

    Parameters

    • listOptions: {
          filters?: Filters;
          page?: number;
          pageSize?: number;
          search?: string;
          searchOn?: ("ID" | "Name" | "Description" | "Code" | "FinePrint" | "EligibleExpression" | "ValueExpression")[];
          sortBy?: ("ID" | "Name" | "ExpirationDate" | "Code" | "EligibleExpression" | "ValueExpression" | "!ID" | "!Name" | "!ExpirationDate" | "DateApplied" | "StartDate" | "CanCombine" | "AutoApply" | "Active" | "Priority" | "!Code" | "!DateApplied" | "!StartDate" | "!EligibleExpression" | "!ValueExpression" | "!CanCombine" | "!AutoApply" | "!Active" | "!Priority")[];
      } = {}
      • Optional filters?: Filters

        An object or dictionary representing key/value pairs to apply as filters. Valid keys are top-level properties of the returned model or 'xp.???'

      • Optional page?: number

        Page of results to return. Default: 1. When paginating through many items (> page 30), we recommend the "Last ID" method, as outlined in the Advanced Querying documentation.

      • Optional pageSize?: number

        Number of results to return per page. Default: 20, max: 100.

      • Optional search?: string

        Word or phrase to search for.

      • Optional searchOn?: ("ID" | "Name" | "Description" | "Code" | "FinePrint" | "EligibleExpression" | "ValueExpression")[]

        Comma-delimited list of fields to search on.

      • Optional sortBy?: ("ID" | "Name" | "ExpirationDate" | "Code" | "EligibleExpression" | "ValueExpression" | "!ID" | "!Name" | "!ExpirationDate" | "DateApplied" | "StartDate" | "CanCombine" | "AutoApply" | "Active" | "Priority" | "!Code" | "!DateApplied" | "!StartDate" | "!EligibleExpression" | "!ValueExpression" | "!CanCombine" | "!AutoApply" | "!Active" | "!Priority")[]

        Comma-delimited list of fields to sort by.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredObjectDeep<ListPage<TOrderPromotion>>>

  • Create or update a cart. If an object with the same ID already exists, it will be overwritten.

    The recommended way to initiate a new cart is to add a line item. If there is a specific reason an order needs to exist prior to adding a line item, this method can be used to initiate a new cart. Check out the docs for more info

    Type Parameters

    • TOrder extends Order<any, any, any, TOrder>

    Parameters

    Returns Promise<RequiredDeep<TOrder>>

  • Create or update a cart line item. Check out the docs for more info

    Type Parameters

    • TLineItem extends LineItem<any, any, any, any, any, TLineItem>

    Parameters

    • lineItemID: string

      ID of the line item.

    • lineItem: LineItem<any, any, any, any, any>

      Required fields: ProductID

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TLineItem>>

  • Set an active cart. Check out the docs for more info

    Parameters

    Returns Promise<void>

  • Set a billing address. Use only when the address is not to be saved/reused.

    To use a saved address (i.e. from the Addresses resource), PATCH the order's BillingAddressID property instead. Check out the docs for more info

    Type Parameters

    • TOrder extends Order<any, any, any, TOrder>

    Parameters

    • address: Address<any>

      Required fields: Street1, City, State, Zip, Country

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TOrder>>

  • Set a shipping address. Use only when the address is not to be saved/reused. To use a saved address (i.e. from the Addresses resource), PATCH the order's ShippingAddressID property instead. The address used will be populated on the ShippingAddress property of each LineItem. Check out the docs for more info

    Type Parameters

    • TOrder extends Order<any, any, any, TOrder>

    Parameters

    • address: Address<any>

      Required fields: Street1, City, State, Zip, Country

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TOrder>>

Generated using TypeDoc