Skip to main content
PATCH
/
api
/
v3
/
admin
/
promotions
/
{id}
Spree Admin SDK
import { createAdminClient } from '@spree/admin-sdk'

const client = createAdminClient({
  baseUrl: 'https://your-store.com',
  secretKey: 'sk_xxx',
})

// Basic field update
await client.promotions.update(promotionId, {
  description: 'Updated description',
})

// One-shot: rewrite rules + actions in a single request
await client.promotions.update(promotionId, {
  name: 'Holiday Sale',
  rules: [
    // Update an existing rule by id — `preferences` overwrite the prior set
    {
      id: 'prorule_existing',
      type: 'currency',
      preferences: { currency: 'EUR' },
    },
    // Add a new rule
    {
      type: 'item_total',
      preferences: { amount_min: 50, operator_min: 'gte' },
    },
  ],
  actions: [
    // Swap calculator type on an existing action
    {
      id: 'proaction_existing',
      type: 'create_item_adjustments',
      calculator: {
        type: 'percent_on_line_item',
        preferences: { percent: 15 },
      },
    },
  ],
})

// Remove all rules/actions
await client.promotions.update(promotionId, {
  rules: [],
  actions: [],
})
{
  "id": "promo_UkLWZg9DAJ",
  "name": "Summer Sale",
  "description": null,
  "code": "summer",
  "starts_at": "2026-05-24T17:37:44.083Z",
  "expires_at": null,
  "usage_limit": null,
  "match_policy": "all",
  "path": null,
  "kind": "coupon_code",
  "multi_codes": false,
  "number_of_codes": null,
  "code_prefix": null,
  "promotion_category_id": null,
  "metadata": {},
  "created_at": "2026-05-24T17:37:44.084Z",
  "updated_at": "2026-05-24T17:37:44.366Z",
  "store_ids": [
    "store_UkLWZg9DAJ"
  ],
  "action_ids": [],
  "rule_ids": []
}

Documentation Index

Fetch the complete documentation index at: https://spreecommerce.org/docs/llms.txt

Use this file to discover all available pages before exploring further.

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

id
string
required

Body

application/json
name
string
description
string | null
code
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>
Available options:
coupon_code,
automatic
promotion_category_id
string | null
rules
object[]
actions
object[]

Response

200 - application/json

rules and actions cleared with empty arrays