Skip to main content
POST
Spree Admin SDK

Authorizations

x-spree-api-key
string
header
required

Secret API key for admin access

Authorization
string
header
required

JWT token for admin user authentication

Headers

x-spree-api-key
string
required
Authorization
string
required

Path Parameters

delivery_method_id
string
required

Body

application/json
type
string
required

A rule kind from the delivery method rule types endpoint.

Example:

"excluded_products_rule"

active
boolean

Defaults to true on create.

preferences
object

Values for the rule kind's preference schema.

product_ids
string[]

Products an association-backed rule (excluded_products_rule) applies to. An empty list clears them.

Response

rule created

id
string
required
active
boolean
required
created_at
string
required
updated_at
string
required
type
string
required

Rule type. Built-in: item_total_rule, weight_rule, excluded_products_rule, channel_rule, volume_rule, company_rule. Extensions may register more.

preferences
object
required

Settings of a delivery method rule, shaped by its type (see x-spree-preferences-by-type). A type an extension registers is a plain object, described by the schema its /types entry carries.

product_ids
string[]
required