GET
/
admin
/
promotions
/
rule-attribute-options
/
{rule_type}
import Medusa from "@medusajs/js-sdk"

export const sdk = new Medusa({
  baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
  debug: import.meta.env.DEV,
  auth: {
    type: "session",
  },
})

sdk.admin.promotion.listRuleAttributes("rules", "standard")
.then(({ attributes }) => {
  console.log(attributes)
})
{
"attributes": [
{
"id": "customer_group",
"value": "customer.groups.id",
"label": "Customer Group",
"operators": [
{
"id": "in",
"value": "in",
"label": "In"
}
]
}
]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

rule_type
enum<string>
required

The rule type.

Available options:
rules,
target-rules,
buy-rules

Query Parameters

promotion_type
enum<string>

The promotion type to retrieve rules for.

Available options:
standard,
buyget
application_method_type
enum<string>

The application method type to retrieve rules for.

Available options:
fixed,
percentage

Response

200
application/json

OK

The list of attributes.