Skip to main content

Class: AdminDiscountsResource

Hierarchy

  • default

    AdminDiscountsResource

Methods

addConditionResourceBatch

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

Description

Add a batch of items to a discount condition

Parameters

NameType
discountIdstring
conditionIdstring
payloadAdminPostDiscountsDiscountConditionsConditionBatchReq
query?AdminPostDiscountsDiscountConditionsConditionBatchParams
customHeadersRecord<string, any>

Returns

ResponsePromise<AdminDiscountsRes>

Defined in

medusa-js/src/resources/admin/discounts.ts:218


addRegion

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

Description

Adds region to discount

Parameters

NameType
idstring
regionIdstring
customHeadersRecord<string, any>

Returns

ResponsePromise<AdminDiscountsRes>

Defined in

medusa-js/src/resources/admin/discounts.ts:27


create

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

Description

Creates discounts

Parameters

NameType
payloadAdminPostDiscountsReq
customHeadersRecord<string, any>

Returns

ResponsePromise<AdminDiscountsRes>

Defined in

medusa-js/src/resources/admin/discounts.ts:39


createCondition

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

Description

creates a discount condition

Parameters

NameType
discountIdstring
payloadAdminPostDiscountsDiscountConditions
queryAdminPostDiscountsDiscountConditionsParams
customHeadersRecord<string, any>

Returns

ResponsePromise<AdminDiscountsRes>

Defined in

medusa-js/src/resources/admin/discounts.ts:148


createDynamicCode

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

Description

Creates a dynamic discount code

Parameters

NameType
idstring
payloadAdminPostDiscountsDiscountDynamicCodesReq
customHeadersRecord<string, any>

Returns

ResponsePromise<AdminDiscountsRes>

Defined in

medusa-js/src/resources/admin/discounts.ts:62


delete

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

Description

Deletes a discount

Parameters

NameType
idstring
customHeadersRecord<string, any>

Returns

ResponsePromise<DeleteResponse>

Defined in

medusa-js/src/resources/admin/discounts.ts:74


deleteCondition

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

Description

Removes a condition from a discount

Parameters

NameType
discountIdstring
conditionIdstring
customHeadersRecord<string, any>

Returns

ResponsePromise<DeleteResponse>

Defined in

medusa-js/src/resources/admin/discounts.ts:187


deleteConditionResourceBatch

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

Description

Delete a batch of items from a discount condition

Parameters

NameType
discountIdstring
conditionIdstring
payloadAdminDeleteDiscountsDiscountConditionsConditionBatchReq
customHeadersRecord<string, any>

Returns

ResponsePromise<AdminDiscountsRes>

Defined in

medusa-js/src/resources/admin/discounts.ts:238


deleteDynamicCode

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

Description

Deletes a dynamic discount

Parameters

NameType
idstring
codestring
customHeadersRecord<string, any>

Returns

ResponsePromise<AdminDiscountsRes>

Defined in

medusa-js/src/resources/admin/discounts.ts:85


getCondition

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

Description

Gets a condition from a discount

Parameters

NameType
discountIdstring
conditionIdstring
query?AdminGetDiscountsDiscountConditionsConditionParams
customHeadersRecord<string, any>

Returns

ResponsePromise<AdminDiscountConditionsRes>

Defined in

medusa-js/src/resources/admin/discounts.ts:199


list

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

Description

Lists discounts

Parameters

NameType
query?AdminGetDiscountsParams
customHeadersRecord<string, any>

Returns

ResponsePromise<AdminDiscountsListRes>

Defined in

medusa-js/src/resources/admin/discounts.ts:119


removeRegion

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

Description

Removes a region from a discount

Parameters

NameType
idstring
regionIdstring
customHeadersRecord<string, any>

Returns

ResponsePromise<AdminDiscountsRes>

Defined in

medusa-js/src/resources/admin/discounts.ts:136


retrieve

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

Description

Retrieves a discount

Parameters

NameType
idstring
customHeadersRecord<string, any>

Returns

ResponsePromise<AdminDiscountsRes>

Defined in

medusa-js/src/resources/admin/discounts.ts:97


retrieveByCode

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

Description

Retrieves a discount by code

Parameters

NameType
codestring
customHeadersRecord<string, any>

Returns

ResponsePromise<AdminDiscountsRes>

Defined in

medusa-js/src/resources/admin/discounts.ts:108


update

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

Description

Updates discount

Parameters

NameType
idstring
payloadAdminPostDiscountsDiscountReq
customHeadersRecord<string, any>

Returns

ResponsePromise<AdminDiscountsRes>

Defined in

medusa-js/src/resources/admin/discounts.ts:50


updateCondition

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

Description

Updates a discount condition

Parameters

NameType
discountIdstring
conditionIdstring
payloadAdminPostDiscountsDiscountConditionsCondition
queryAdminPostDiscountsDiscountConditionsConditionParams
customHeadersRecord<string, any>

Returns

ResponsePromise<AdminDiscountsRes>

Defined in

medusa-js/src/resources/admin/discounts.ts:167

Was this page helpful?