Skip to main content
GET
/
admin
/
promotions
/
rule-attribute-options
/
{rule_type}
JS SDK
import Switchyard from "@switchyard/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
application_method_target_type
enum<string>

The application method target type to retrieve rules for.

Available options:
items,
shipping_methods,
order

Response

OK

The list of attributes.

attributes
object[]
required

The list of attributes.