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
Name | Type |
---|---|
discountId | string |
conditionId | string |
payload | AdminPostDiscountsDiscountConditionsConditionBatchReq |
query? | AdminPostDiscountsDiscountConditionsConditionBatchParams |
customHeaders | Record <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
Name | Type |
---|---|
id | string |
regionId | string |
customHeaders | Record <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
Name | Type |
---|---|
payload | AdminPostDiscountsReq |
customHeaders | Record <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
Name | Type |
---|---|
discountId | string |
payload | AdminPostDiscountsDiscountConditions |
query | AdminPostDiscountsDiscountConditionsParams |
customHeaders | Record <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
Name | Type |
---|---|
id | string |
payload | AdminPostDiscountsDiscountDynamicCodesReq |
customHeaders | Record <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
Name | Type |
---|---|
id | string |
customHeaders | Record <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
Name | Type |
---|---|
discountId | string |
conditionId | string |
customHeaders | Record <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
Name | Type |
---|---|
discountId | string |
conditionId | string |
payload | AdminDeleteDiscountsDiscountConditionsConditionBatchReq |
customHeaders | Record <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
Name | Type |
---|---|
id | string |
code | string |
customHeaders | Record <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
Name | Type |
---|---|
discountId | string |
conditionId | string |
query? | AdminGetDiscountsDiscountConditionsConditionParams |
customHeaders | Record <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
Name | Type |
---|---|
query? | AdminGetDiscountsParams |
customHeaders | Record <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
Name | Type |
---|---|
id | string |
regionId | string |
customHeaders | Record <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
Name | Type |
---|---|
id | string |
customHeaders | Record <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
Name | Type |
---|---|
code | string |
customHeaders | Record <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
Name | Type |
---|---|
id | string |
payload | AdminPostDiscountsDiscountReq |
customHeaders | Record <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
Name | Type |
---|---|
discountId | string |
conditionId | string |
payload | AdminPostDiscountsDiscountConditionsCondition |
query | AdminPostDiscountsDiscountConditionsConditionParams |
customHeaders | Record <string , any > |
Returns
ResponsePromise
<AdminDiscountsRes
>