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

Body

application/json
name
string
required
description
string | null
code
string | null

Required for single-code coupon promotions. Ignored when multi_codes is true.

path
string | null
starts_at
string<date-time> | null
expires_at
string<date-time> | null
usage_limit
integer | null
match_policy
enum<string>
Available options:
all,
any
kind
enum<string>

coupon_code needs a code (or multi_codes); automatic applies without one.

Available options:
coupon_code,
automatic
multi_codes
boolean

Generates number_of_codes codes starting with code_prefix.

number_of_codes
integer | null
code_prefix
string | null
promotion_category_id
string | null
rules
object[]

The rules the promotion should have: entries with id update, entries without are created, and rules left out are removed.

actions
object[]

The actions the promotion should have, matched the same way as rules.

Response

promotion created with rules and actions