Skip to main content
Skip to main content

AdminDiscountsResource

admin/discounts.AdminDiscountsResource

Methods

addConditionResourceBatch

addConditionResourceBatch(discountId, conditionId, payload, query?, customHeaders?): ResponsePromise<AdminDiscountsRes>

Parameters

discountIdstringRequired
conditionIdstringRequired
customHeadersRecord<string, any>Required

Default: `{}`

Returns

ResponsePromise<AdminDiscountsRes>

ResponsePromiseResponsePromise<AdminDiscountsRes>Required

Description

Add a batch of items to a discount condition


addRegion

addRegion(id, regionId, customHeaders?): ResponsePromise<AdminDiscountsRes>

Parameters

idstringRequired
regionIdstringRequired
customHeadersRecord<string, any>Required

Default: `{}`

Returns

ResponsePromise<AdminDiscountsRes>

ResponsePromiseResponsePromise<AdminDiscountsRes>Required

Description

Adds region to discount


create

create(payload, customHeaders?): ResponsePromise<AdminDiscountsRes>

Parameters

payloadAdminPostDiscountsReqRequired
customHeadersRecord<string, any>Required

Default: `{}`

Returns

ResponsePromise<AdminDiscountsRes>

ResponsePromiseResponsePromise<AdminDiscountsRes>Required

Description

Creates discounts


createCondition

createCondition(discountId, payload, query?, customHeaders?): ResponsePromise<AdminDiscountsRes>

Parameters

discountIdstringRequired

Default: `{}`

customHeadersRecord<string, any>Required

Default: `{}`

Returns

ResponsePromise<AdminDiscountsRes>

ResponsePromiseResponsePromise<AdminDiscountsRes>Required

Description

creates a discount condition


createDynamicCode

createDynamicCode(id, payload, customHeaders?): ResponsePromise<AdminDiscountsRes>

Parameters

idstringRequired
customHeadersRecord<string, any>Required

Default: `{}`

Returns

ResponsePromise<AdminDiscountsRes>

ResponsePromiseResponsePromise<AdminDiscountsRes>Required

Description

Creates a dynamic discount code


delete

delete(id, customHeaders?): ResponsePromise<DeleteResponse>

Parameters

idstringRequired
customHeadersRecord<string, any>Required

Default: `{}`

Returns

ResponsePromise<DeleteResponse>

ResponsePromiseResponsePromise<DeleteResponse>Required

Description

Deletes a discount


deleteCondition

deleteCondition(discountId, conditionId, customHeaders?): ResponsePromise<DeleteResponse>

Parameters

discountIdstringRequired
conditionIdstringRequired
customHeadersRecord<string, any>Required

Default: `{}`

Returns

ResponsePromise<DeleteResponse>

ResponsePromiseResponsePromise<DeleteResponse>Required

Description

Removes a condition from a discount


deleteConditionResourceBatch

deleteConditionResourceBatch(discountId, conditionId, payload, customHeaders?): ResponsePromise<AdminDiscountsRes>

Parameters

discountIdstringRequired
conditionIdstringRequired
customHeadersRecord<string, any>Required

Default: `{}`

Returns

ResponsePromise<AdminDiscountsRes>

ResponsePromiseResponsePromise<AdminDiscountsRes>Required

Description

Delete a batch of items from a discount condition


deleteDynamicCode

deleteDynamicCode(id, code, customHeaders?): ResponsePromise<AdminDiscountsRes>

Parameters

idstringRequired
codestringRequired
customHeadersRecord<string, any>Required

Default: `{}`

Returns

ResponsePromise<AdminDiscountsRes>

ResponsePromiseResponsePromise<AdminDiscountsRes>Required

Description

Deletes a dynamic discount


getCondition

getCondition(discountId, conditionId, query?, customHeaders?): ResponsePromise<AdminDiscountConditionsRes>

Parameters

discountIdstringRequired
conditionIdstringRequired
customHeadersRecord<string, any>Required

Default: `{}`

Returns

ResponsePromise<AdminDiscountConditionsRes>

Description

Gets a condition from a discount


list

list(query?, customHeaders?): ResponsePromise<AdminDiscountsListRes>

Parameters

customHeadersRecord<string, any>Required

Default: `{}`

Returns

ResponsePromise<AdminDiscountsListRes>

ResponsePromiseResponsePromise<AdminDiscountsListRes>Required

Description

Lists discounts


removeRegion

removeRegion(id, regionId, customHeaders?): ResponsePromise<AdminDiscountsRes>

Parameters

idstringRequired
regionIdstringRequired
customHeadersRecord<string, any>Required

Default: `{}`

Returns

ResponsePromise<AdminDiscountsRes>

ResponsePromiseResponsePromise<AdminDiscountsRes>Required

Description

Removes a region from a discount


retrieve

retrieve(id, customHeaders?): ResponsePromise<AdminDiscountsRes>

Parameters

idstringRequired
customHeadersRecord<string, any>Required

Default: `{}`

Returns

ResponsePromise<AdminDiscountsRes>

ResponsePromiseResponsePromise<AdminDiscountsRes>Required

Description

Retrieves a discount


retrieveByCode

retrieveByCode(code, customHeaders?): ResponsePromise<AdminDiscountsRes>

Parameters

codestringRequired
customHeadersRecord<string, any>Required

Default: `{}`

Returns

ResponsePromise<AdminDiscountsRes>

ResponsePromiseResponsePromise<AdminDiscountsRes>Required

Description

Retrieves a discount by code


update

update(id, payload, customHeaders?): ResponsePromise<AdminDiscountsRes>

Parameters

idstringRequired
customHeadersRecord<string, any>Required

Default: `{}`

Returns

ResponsePromise<AdminDiscountsRes>

ResponsePromiseResponsePromise<AdminDiscountsRes>Required

Description

Updates discount


updateCondition

updateCondition(discountId, conditionId, payload, query?, customHeaders?): ResponsePromise<AdminDiscountsRes>

Parameters

discountIdstringRequired
conditionIdstringRequired

Default: `{}`

customHeadersRecord<string, any>Required

Default: `{}`

Returns

ResponsePromise<AdminDiscountsRes>

ResponsePromiseResponsePromise<AdminDiscountsRes>Required

Description

Updates a discount condition

Was this section helpful?