AdminDiscountsResource
admin/discounts.AdminDiscountsResource
Methods
addConditionResourceBatch
addConditionResourceBatch(discountId
, conditionId
, payload
, query?
, customHeaders?
): ResponsePromise
<AdminDiscountsRes
>
Parameters
discountId
stringRequiredconditionId
stringRequiredcustomHeaders
Record<string, any>RequiredDefault: `{}`
Returns
ResponsePromise
<AdminDiscountsRes
>
Description
Add a batch of items to a discount condition
addRegion
addRegion(id
, regionId
, customHeaders?
): ResponsePromise
<AdminDiscountsRes
>
Parameters
id
stringRequiredregionId
stringRequiredcustomHeaders
Record<string, any>RequiredDefault: `{}`
Returns
ResponsePromise
<AdminDiscountsRes
>
Description
Adds region to discount
create
create(payload
, customHeaders?
): ResponsePromise
<AdminDiscountsRes
>
Parameters
customHeaders
Record<string, any>RequiredDefault: `{}`
Returns
ResponsePromise
<AdminDiscountsRes
>
Description
Creates discounts
createCondition
createCondition(discountId
, payload
, query?
, customHeaders?
): ResponsePromise
<AdminDiscountsRes
>
Parameters
discountId
stringRequiredDefault: `{}`
customHeaders
Record<string, any>RequiredDefault: `{}`
Returns
ResponsePromise
<AdminDiscountsRes
>
Description
creates a discount condition
createDynamicCode
createDynamicCode(id
, payload
, customHeaders?
): ResponsePromise
<AdminDiscountsRes
>
Parameters
id
stringRequiredcustomHeaders
Record<string, any>RequiredDefault: `{}`
Returns
ResponsePromise
<AdminDiscountsRes
>
Description
Creates a dynamic discount code
delete
delete(id
, customHeaders?
): ResponsePromise
<DeleteResponse
>
Parameters
id
stringRequiredcustomHeaders
Record<string, any>RequiredDefault: `{}`
Returns
ResponsePromise
<DeleteResponse
>
Description
Deletes a discount
deleteCondition
deleteCondition(discountId
, conditionId
, customHeaders?
): ResponsePromise
<DeleteResponse
>
Parameters
discountId
stringRequiredconditionId
stringRequiredcustomHeaders
Record<string, any>RequiredDefault: `{}`
Returns
ResponsePromise
<DeleteResponse
>
Description
Removes a condition from a discount
deleteConditionResourceBatch
deleteConditionResourceBatch(discountId
, conditionId
, payload
, customHeaders?
): ResponsePromise
<AdminDiscountsRes
>
Parameters
discountId
stringRequiredconditionId
stringRequiredcustomHeaders
Record<string, any>RequiredDefault: `{}`
Returns
ResponsePromise
<AdminDiscountsRes
>
Description
Delete a batch of items from a discount condition
deleteDynamicCode
deleteDynamicCode(id
, code
, customHeaders?
): ResponsePromise
<AdminDiscountsRes
>
Parameters
id
stringRequiredcode
stringRequiredcustomHeaders
Record<string, any>RequiredDefault: `{}`
Returns
ResponsePromise
<AdminDiscountsRes
>
Description
Deletes a dynamic discount
getCondition
getCondition(discountId
, conditionId
, query?
, customHeaders?
): ResponsePromise
<AdminDiscountConditionsRes
>
Parameters
discountId
stringRequiredconditionId
stringRequiredcustomHeaders
Record<string, any>RequiredDefault: `{}`
Returns
ResponsePromise
<AdminDiscountConditionsRes
>
Description
Gets a condition from a discount
list
list(query?
, customHeaders?
): ResponsePromise
<AdminDiscountsListRes
>
Parameters
customHeaders
Record<string, any>RequiredDefault: `{}`
Returns
ResponsePromise
<AdminDiscountsListRes
>
Description
Lists discounts
removeRegion
removeRegion(id
, regionId
, customHeaders?
): ResponsePromise
<AdminDiscountsRes
>
Parameters
id
stringRequiredregionId
stringRequiredcustomHeaders
Record<string, any>RequiredDefault: `{}`
Returns
ResponsePromise
<AdminDiscountsRes
>
Description
Removes a region from a discount
retrieve
retrieve(id
, customHeaders?
): ResponsePromise
<AdminDiscountsRes
>
Parameters
id
stringRequiredcustomHeaders
Record<string, any>RequiredDefault: `{}`
Returns
ResponsePromise
<AdminDiscountsRes
>
Description
Retrieves a discount
retrieveByCode
retrieveByCode(code
, customHeaders?
): ResponsePromise
<AdminDiscountsRes
>
Parameters
code
stringRequiredcustomHeaders
Record<string, any>RequiredDefault: `{}`
Returns
ResponsePromise
<AdminDiscountsRes
>
Description
Retrieves a discount by code
update
update(id
, payload
, customHeaders?
): ResponsePromise
<AdminDiscountsRes
>
Parameters
id
stringRequiredcustomHeaders
Record<string, any>RequiredDefault: `{}`
Returns
ResponsePromise
<AdminDiscountsRes
>
Description
Updates discount
updateCondition
updateCondition(discountId
, conditionId
, payload
, query?
, customHeaders?
): ResponsePromise
<AdminDiscountsRes
>
Parameters
discountId
stringRequiredconditionId
stringRequiredDefault: `{}`
customHeaders
Record<string, any>RequiredDefault: `{}`
Returns
ResponsePromise
<AdminDiscountsRes
>
Description
Updates a discount condition