Skip to main content
GET
/
admin
/
promotions
/
rule-value-options
/
{rule_type}
/
{rule_attribute_id}
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.listRuleValues("rules", "attr_123")
.then(({ values }) => {
  console.log(values)
})
{
"limit": 123,
"offset": 123,
"count": 123,
"values": [
{
"value": "reg_123",
"label": "Europe Region"
}
]
}

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
rule_attribute_id
string
required

The rule attribute's ID.

Query Parameters

offset
number

The number of items to skip when retrieving a list.

limit
number

Limit the number of items returned in the list.

order
string

The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with -.

with_deleted
boolean

Whether to include deleted records in the result.

application_method_target_type
string

The application method target type to retrieve rules for.

q
string

Apply a search query on the rule values' searchable properties.

value

Filter by a specific rule value.

fields
string

Comma-separated fields that should be included in the returned data. If a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. Without prefix it will replace the entire default fields.

Response

OK

The paginated list of rule values.

limit
number
required

The maximum number of items returned.

offset
number
required

The number of items skipped before retrieving the returned items.

count
number
required

The total number of items.

values
object[]
required

The list of rule values.