@usethrottle/discounts
Preparing search index...
DiscountsClient
Class DiscountsClient
Index
Constructors
constructor
Methods
apply
To
Cart
create
delete
get
list
preview
remove
From
Cart
request
update
validate
Constructors
constructor
new
DiscountsClient
(
opts
:
DiscountsClientOptions
)
:
DiscountsClient
Parameters
opts
:
DiscountsClientOptions
Returns
DiscountsClient
Methods
apply
To
Cart
applyToCart
(
cartId
:
string
,
code
:
string
)
:
Promise
<
Cart
>
Parameters
cartId
:
string
code
:
string
Returns
Promise
<
Cart
>
create
create
(
input
:
CreateDiscountInput
)
:
Promise
<
Discount
>
Parameters
input
:
CreateDiscountInput
Returns
Promise
<
Discount
>
delete
delete
(
id
:
string
)
:
Promise
<
void
>
Parameters
id
:
string
Returns
Promise
<
void
>
get
get
(
id
:
string
)
:
Promise
<
Discount
>
Parameters
id
:
string
Returns
Promise
<
Discount
>
list
list
(
params
?:
DiscountListParams
)
:
Promise
<
PaginatedDiscounts
>
Parameters
params
:
DiscountListParams
= {}
Returns
Promise
<
PaginatedDiscounts
>
preview
preview
(
input
:
DiscountPreviewInput
)
:
Promise
<
DiscountPreviewResult
>
Parameters
input
:
DiscountPreviewInput
Returns
Promise
<
DiscountPreviewResult
>
remove
From
Cart
removeFromCart
(
cartId
:
string
)
:
Promise
<
Cart
>
Parameters
cartId
:
string
Returns
Promise
<
Cart
>
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
>
update
update
(
id
:
string
,
input
:
UpdateDiscountInput
)
:
Promise
<
Discount
>
Parameters
id
:
string
input
:
UpdateDiscountInput
Returns
Promise
<
Discount
>
validate
validate
(
code
:
string
,
orderTotal
:
number
,
customerId
?:
string
,
)
:
Promise
<
DiscountValidationResult
>
Parameters
code
:
string
orderTotal
:
number
Optional
customerId
:
string
Returns
Promise
<
DiscountValidationResult
>
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Methods
apply
To
Cart
create
delete
get
list
preview
remove
From
Cart
request
update
validate
@usethrottle/discounts
Loading...