@usethrottle/cart
Preparing search index...
CartClient
Class CartClient
Index
Constructors
constructor
Accessors
carts
discounts
events
items
shipping
shipping
Tax
tax
Lines
Methods
request
Constructors
constructor
new
CartClient
(
opts
:
CartClientOptions
)
:
CartClient
Parameters
opts
:
CartClientOptions
Returns
CartClient
Accessors
carts
get
carts
()
:
{
checkout
:
(
id
:
string
,
input
?:
CheckoutInput
)
=>
Promise
<
Order
>
;
create
:
(
input
:
CreateCartInput
)
=>
Promise
<
Cart
>
;
get
:
(
id
:
string
)
=>
Promise
<
Cart
>
;
merge
:
(
id
:
string
,
customerId
:
string
)
=>
Promise
<
Cart
>
;
update
:
(
id
:
string
,
input
:
UpdateCartInput
)
=>
Promise
<
Cart
>
;
}
Returns
{
checkout
:
(
id
:
string
,
input
?:
CheckoutInput
)
=>
Promise
<
Order
>
;
create
:
(
input
:
CreateCartInput
)
=>
Promise
<
Cart
>
;
get
:
(
id
:
string
)
=>
Promise
<
Cart
>
;
merge
:
(
id
:
string
,
customerId
:
string
)
=>
Promise
<
Cart
>
;
update
:
(
id
:
string
,
input
:
UpdateCartInput
)
=>
Promise
<
Cart
>
;
}
discounts
get
discounts
()
:
{
apply
:
(
cartId
:
string
,
code
:
string
)
=>
Promise
<
Cart
>
;
remove
:
(
cartId
:
string
)
=>
Promise
<
Cart
>
;
}
Returns
{
apply
:
(
cartId
:
string
,
code
:
string
)
=>
Promise
<
Cart
>
;
remove
:
(
cartId
:
string
)
=>
Promise
<
Cart
>
;
}
events
get
events
()
:
{
list
:
(
cartId
:
string
,
opts
?:
{
limit
?:
number
;
sinceSequence
?:
number
}
,
)
=>
Promise
<
CartEvent
[]
>
;
}
Returns
{
list
:
(
cartId
:
string
,
opts
?:
{
limit
?:
number
;
sinceSequence
?:
number
}
,
)
=>
Promise
<
CartEvent
[]
>
;
}
items
get
items
()
:
{
add
:
(
cartId
:
string
,
input
:
AddLineItemInput
)
=>
Promise
<
LineItem
>
;
remove
:
(
cartId
:
string
,
itemId
:
string
)
=>
Promise
<
void
>
;
update
:
(
cartId
:
string
,
itemId
:
string
,
input
:
UpdateLineItemInput
,
)
=>
Promise
<
LineItem
>
;
}
Returns
{
add
:
(
cartId
:
string
,
input
:
AddLineItemInput
)
=>
Promise
<
LineItem
>
;
remove
:
(
cartId
:
string
,
itemId
:
string
)
=>
Promise
<
void
>
;
update
:
(
cartId
:
string
,
itemId
:
string
,
input
:
UpdateLineItemInput
,
)
=>
Promise
<
LineItem
>
;
}
shipping
get
shipping
()
:
{
clear
:
(
cartId
:
string
)
=>
Promise
<
Cart
>
;
select
:
(
cartId
:
string
,
input
:
SelectShippingInput
)
=>
Promise
<
Cart
>
;
}
Returns
{
clear
:
(
cartId
:
string
)
=>
Promise
<
Cart
>
;
select
:
(
cartId
:
string
,
input
:
SelectShippingInput
)
=>
Promise
<
Cart
>
;
}
shipping
Tax
get
shippingTax
()
:
{
calculateCart
:
(
cartId
:
string
,
input
?:
ShippingTaxCartCalculateInput
,
)
=>
Promise
<
ShippingTaxCalculationResponse
>
;
pushExternalSnapshot
:
(
input
:
ExternalShippingTaxSnapshotInput
,
)
=>
Promise
<
ShippingTaxCalculationResponse
>
;
}
Returns
{
calculateCart
:
(
cartId
:
string
,
input
?:
ShippingTaxCartCalculateInput
,
)
=>
Promise
<
ShippingTaxCalculationResponse
>
;
pushExternalSnapshot
:
(
input
:
ExternalShippingTaxSnapshotInput
,
)
=>
Promise
<
ShippingTaxCalculationResponse
>
;
}
tax
Lines
get
taxLines
()
:
{
clear
:
(
cartId
:
string
)
=>
Promise
<
Cart
>
;
set
:
(
cartId
:
string
,
lines
:
TaxLineInput
[]
)
=>
Promise
<
Cart
>
;
}
Returns
{
clear
:
(
cartId
:
string
)
=>
Promise
<
Cart
>
;
set
:
(
cartId
:
string
,
lines
:
TaxLineInput
[]
)
=>
Promise
<
Cart
>
;
}
Methods
request
request
<
T
=
unknown
>
(
method
:
string
,
path
:
string
,
body
?:
unknown
)
:
Promise
<
T
>
Type Parameters
T
=
unknown
Parameters
method
:
string
path
:
string
Optional
body
:
unknown
Returns
Promise
<
T
>
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Accessors
carts
discounts
events
items
shipping
shipping
Tax
tax
Lines
Methods
request
@usethrottle/cart
Loading...