xclade
Admin APIPromotions

List Rule Values Given a Rule Attribute

Retrieve all potential values for promotion rules and target and buy rules based on the specified rule attribute and type. For example, if you provide the ID of the `currency_code` rule attribute, and set `rule_type` to `rules`, a list of currencies are retrieved in label-value pairs.

GET
/admin/promotions/rule-value-options/{rule_type}/{rule_attribute_id}
AuthorizationBearer <token>

In: header

Path Parameters

rule_type*string

The rule type.

Value in"rules" | "target-rules" | "buy-rules"
rule_attribute_id*string

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 -.

promotion_type?string

The promotion type to retrieve rules for.

Value in"standard" | "buyget"
application_method_type?string

The application method type to retrieve rules for.

Value in"fixed" | "percentage"
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.

Response Body

application/json

application/json

text/plain

application/json

application/json

application/json

application/json

curl -X GET "https://{tenant}.api.myxclade.com/admin/promotions/rule-value-options/rules/string"
{
  "limit": 0,
  "offset": 0,
  "count": 0,
  "values": [
    {
      "value": "reg_123",
      "label": "Europe Region"
    }
  ]
}

{
  "message": "Discount must be set to dynamic",
  "type": "not_allowed"
}

"Unauthorized"
{
  "message": "Entity with id 1 was not found",
  "type": "not_found"
}
{
  "code": "unknown_error",
  "message": "The request conflicted with another request. You may retry the request with the provided Idempotency-Key.",
  "type": "QueryRunnerAlreadyReleasedError"
}
{
  "code": "invalid_request_error",
  "message": "Discount with code TEST already exists.",
  "type": "duplicate_error"
}

{
  "code": "api_error",
  "message": "An error occured while hashing password",
  "type": "database_error"
}