Skip to navigation Skip to main content
Smart Cycle Discounts is now available on WordPress.org — Download Free
🎉 SCD is now available — Download Free
  • WordPress
    WordPress Plugins
    View all
    Smart Cycle Discounts A cycling discount mark: rotating arrows around a center badge that cycles commerce icons.

    Smart Cycle Discounts

    Automate discount campaigns with scheduling, analytics, and smart product targeting.

    5 Discount Types Recurring Campaigns
    Free Pro from $59

    TrustLens

    Customer trust intelligence for WooCommerce. Score customers, spot abuse, protect revenue.

    Trust Scores Abuse Detection
    Free Pro from $79

    New Plugin

    Coming Soon

    Something exciting is in the works. Join the waitlist to be first to know.

    Get Notified
    Notify Me
    Secure Checkout
    WordPress.org
    14-Day Refund
    Resources
    Documentation Guides & tutorials
    Discount Calculator Plan your strategy
    Support Get help
    Changelog What's new
    Get notified on new releases
  • Affiliate
  • Blog
  • DOCS
    Documentation

    Choose a plugin to explore its documentation

    Smart Cycle Discounts Automated discount campaigns for WooCommerce
    Available
    New Plugin Something exciting is in development
    Coming Soon
    New Plugin Something exciting is in development
    Coming Soon
    Docs Home FAQ Get Support
    WordPress tools that solve real problems
  • Contact Us
  • About
    Company

    Our Story

    Founded 2020

    Built by store owners, for store owners. We create WordPress tools that solve real problems.

    Learn more
    Built from Experience Real solutions we use ourselves
    Time is Precious Simple, intuitive tools
    Real Support Talk to the founders
    Legal & Contact
    Contact Us Privacy Policy Terms of Service Refund Policy
    14-Day Money-Back Guarantee No questions asked
GET STARTED

Getting Started

5
  • What is Smart Cycle Discounts?
  • Installation Guide
  • Creating Your First Campaign
  • Plugin Dashboard Overview
  • Free & Pro Features

Campaign Wizard

7
  • Campaign Wizard Overview
  • Step 1 – Basic Information
  • Step 2 – Product Selection
  • Step 3 – Discount Configuration
  • Step 4 – Campaign Scheduling
  • Step 5 – Review & Launch
  • Campaign Health Scoring

Product Selection

5
  • All Products Mode
  • Specific Products Mode
  • Random Products Mode
  • Smart Selection Mode
  • Product Search Tips

Discount Types

7
  • Percentage Discounts
  • Fixed Amount Discount
  • Buy One Get One (BOGO)
  • Tiered Volume Pricing
  • Spend Threshold Discounts
  • Bundle Discounts
  • Discount Stacking and Priority

Scheduling

5
  • Setting Campaign Dates
  • Timezone Configuration
  • Recurring Campaigns
  • Campaign Status Explained
  • Automatic Activation

Campaign Management

6
  • Campaign List
  • Editing Existing Campaigns
  • Duplicating Campaigns
  • Bulk Actions
  • Campaign Priority System
  • Campaign Overview Panel

Setting Configuration

5
  • General Settings
  • Display Settings
  • Advanced Settings
  • Tools and Diagnostics
  • License Management

Use Cases

7
  • Flash Sale Campaign
  • Seasonal Sale Campaign
  • Weekend Sale Recurring
  • BOGO Promotion
  • Volume Discount Campaign
  • Cart Threshold Promotion
  • Bundle Discount Campaign

Developer Documentation

5
  • Hooks and Filters Reference
  • Rest API Overview
  • Custom Discount Integration
  • Template Customization
  • Database Schema

Troubleshooting

6
  • Campaign Not Activating
  • Discounts Not Displaying
  • Scheduling Issues
  • Product Search Not Working
  • Performance Optimization
  • Common Error Messages

FAQ

3
  • General
  • Compatibility
  • Pricing & Licensing

Notifications

5
  • Email Provider Setup
  • Email Notifications Setup
  • Basic Notifications
  • Proactive Alerts
  • Low Stock Alerts
View Categories
  • Home
  • Docs
  • Smart Cycle Discounts
  • Developer Documentation
  • Rest API Overview

Rest API Overview

4 min read

Smart Cycle Discounts Pro provides a REST API for programmatic access to campaigns, analytics, and settings. This allows integration with external systems, mobile apps, and automation workflows. REST API access requires Smart Cycle Discounts Pro.


API Overview #

Base URL #

https://yoursite.com/wp-json/scd/v1/

Authentication #

The API uses WooCommerce REST API authentication:

  • Consumer Key: Generate in WooCommerce → Settings → Advanced → REST API
  • Consumer Secret: Provided when creating API keys
  • Permissions: Read/Write access required

Authentication Methods #

Method Use Case
HTTP Basic Auth Server-to-server requests (HTTPS required)
Query String Simple integrations (less secure)
OAuth 1.0a Third-party apps

Example Authentication #

# HTTP Basic Auth
curl -X GET "https://yoursite.com/wp-json/scd/v1/campaigns" \
  -u "ck_your_consumer_key:cs_your_consumer_secret"

# Query String Auth
curl -X GET "https://yoursite.com/wp-json/scd/v1/campaigns?consumer_key=ck_xxx&consumer_secret=cs_xxx"

Endpoints #

Campaigns #

List Campaigns #

GET /wp-json/scd/v1/campaigns

Parameters:

Parameter Type Description
status string Filter by status (active, scheduled, paused, expired, draft)
per_page integer Results per page (default: 10, max: 100)
page integer Page number
orderby string Order by field (id, name, created_at)
order string Sort order (asc, desc)

Response:

{
  "campaigns": [
    {
      "id": 123,
      "name": "Summer Sale",
      "status": "active",
      "priority": 3,
      "discount_type": "percentage",
      "discount_value": 25,
      "start_date": "2025-06-01T00:00:00",
      "end_date": "2025-06-30T23:59:59",
      "products_count": 45,
      "created_at": "2025-05-15T10:30:00",
      "updated_at": "2025-05-20T14:15:00"
    },
    ...
  ],
  "total": 15,
  "total_pages": 2
}

Get Single Campaign #

GET /wp-json/scd/v1/campaigns/{id}

Response:

{
  "id": 123,
  "name": "Summer Sale",
  "status": "active",
  "priority": 3,
  "discount_type": "percentage",
  "discount_value": 25,
  "product_selection": {
    "type": "conditions",
    "conditions": [
      {
        "field": "category",
        "operator": "equals",
        "value": "summer-collection"
      }
    ]
  },
  "schedule": {
    "start_date": "2025-06-01T00:00:00",
    "end_date": "2025-06-30T23:59:59",
    "recurring": false
  },
  "products": [1, 2, 3, 4, 5],
  "analytics": {
    "revenue": 12500.00,
    "conversions": 230,
    "discount_given": 4166.67
  }
}

Create Campaign #

POST /wp-json/scd/v1/campaigns

Request Body:

{
  "name": "New Campaign",
  "priority": 3,
  "discount_type": "percentage",
  "discount_value": 20,
  "product_selection": {
    "type": "all",
    "exclusions": {
      "categories": [15, 22]
    }
  },
  "schedule": {
    "start_date": "2025-07-01T00:00:00",
    "end_date": "2025-07-31T23:59:59"
  },
  "status": "scheduled"
}

Response:

{
  "id": 124,
  "name": "New Campaign",
  "status": "scheduled",
  ...
}

Update Campaign #

PUT /wp-json/scd/v1/campaigns/{id}

Request Body: Same structure as create, with only fields to update.


Delete Campaign #

DELETE /wp-json/scd/v1/campaigns/{id}

Response:

{
  "deleted": true,
  "id": 123
}

Campaign Actions #

POST /wp-json/scd/v1/campaigns/{id}/activate
POST /wp-json/scd/v1/campaigns/{id}/pause
POST /wp-json/scd/v1/campaigns/{id}/resume
POST /wp-json/scd/v1/campaigns/{id}/duplicate

Analytics #

Get Analytics Summary #

GET /wp-json/scd/v1/analytics

Parameters:

Parameter Type Description
start_date string Start date (YYYY-MM-DD)
end_date string End date (YYYY-MM-DD)
campaign_id integer Filter by campaign

Response:

{
  "summary": {
    "total_revenue": 45000.00,
    "total_conversions": 850,
    "total_discount": 11250.00,
    "avg_order_value": 52.94
  },
  "campaigns": [
    {
      "id": 123,
      "name": "Summer Sale",
      "revenue": 25000.00,
      "conversions": 450
    },
    ...
  ],
  "daily_data": [
    {
      "date": "2025-06-01",
      "revenue": 1500.00,
      "conversions": 28
    },
    ...
  ]
}

Get Campaign Analytics #

GET /wp-json/scd/v1/campaigns/{id}/analytics

Products #

Get Campaign Products #

GET /wp-json/scd/v1/campaigns/{id}/products

Response:

{
  "products": [
    {
      "id": 45,
      "name": "Blue Widget",
      "sku": "BW-001",
      "original_price": 50.00,
      "discounted_price": 37.50,
      "discount_amount": 12.50
    },
    ...
  ],
  "total": 45
}

Check Product Discount #

GET /wp-json/scd/v1/products/{id}/discount

Response:

{
  "product_id": 45,
  "has_discount": true,
  "campaign_id": 123,
  "campaign_name": "Summer Sale",
  "original_price": 50.00,
  "discounted_price": 37.50,
  "discount_type": "percentage",
  "discount_value": 25
}

Settings #

Get Settings #

GET /wp-json/scd/v1/settings

Update Settings #

PUT /wp-json/scd/v1/settings

Error Handling #

Error Response Format #

{
  "code": "rest_invalid_param",
  "message": "Invalid parameter: discount_value",
  "data": {
    "status": 400,
    "params": {
      "discount_value": "Must be between 1 and 100"
    }
  }
}

Common Error Codes #

HTTP Code Error Code Description
400 rest_invalid_param Invalid parameters
401 rest_forbidden Authentication failed
403 rest_forbidden Insufficient permissions
404 rest_not_found Resource not found
500 rest_error Server error

Rate Limiting #

Limits #

Endpoint Type Limit
Read (GET) 120 requests/minute
Write (POST/PUT/DELETE) 60 requests/minute

Rate Limit Headers #

X-RateLimit-Limit: 120
X-RateLimit-Remaining: 115
X-RateLimit-Reset: 1625097600

Webhooks #

Available Webhook Events #

Event Trigger
campaign.created New campaign created
campaign.updated Campaign modified
campaign.activated Campaign becomes active
campaign.deactivated Campaign paused/expired
campaign.deleted Campaign deleted
discount.applied Discount applied to order

Webhook Payload #

{
  "event": "campaign.activated",
  "timestamp": "2025-06-01T00:00:00Z",
  "data": {
    "campaign_id": 123,
    "campaign_name": "Summer Sale",
    ...
  }
}

Code Examples #

PHP with WordPress HTTP API #

$response = wp_remote_get(
    'https://yoursite.com/wp-json/scd/v1/campaigns',
    array(
        'headers' => array(
            'Authorization' => 'Basic ' . base64_encode( $consumer_key . ':' . $consumer_secret ),
        ),
    )
);

$campaigns = json_decode( wp_remote_retrieve_body( $response ), true );

JavaScript (fetch) #

const response = await fetch('https://yoursite.com/wp-json/scd/v1/campaigns', {
    headers: {
        'Authorization': 'Basic ' + btoa(consumerKey + ':' + consumerSecret),
    },
});
const data = await response.json();

Python #

import requests
from requests.auth import HTTPBasicAuth

response = requests.get(
    'https://yoursite.com/wp-json/scd/v1/campaigns',
    auth=HTTPBasicAuth(consumer_key, consumer_secret)
)
campaigns = response.json()
Updated on February 14, 2026

What are your Feelings

  • Happy
  • Normal
  • Sad

Share This Article :

  • Facebook
  • X
  • LinkedIn
  • Pinterest
Hooks and Filters ReferenceCustom Discount Integration
Table of Contents
  • API Overview
    • Base URL
    • Authentication
    • Authentication Methods
    • Example Authentication
  • Endpoints
    • Campaigns
      • List Campaigns
      • Get Single Campaign
      • Create Campaign
      • Update Campaign
      • Delete Campaign
      • Campaign Actions
    • Analytics
      • Get Analytics Summary
      • Get Campaign Analytics
    • Products
      • Get Campaign Products
      • Check Product Discount
    • Settings
      • Get Settings
      • Update Settings
  • Error Handling
    • Error Response Format
    • Common Error Codes
  • Rate Limiting
    • Limits
    • Rate Limit Headers
  • Webhooks
    • Available Webhook Events
    • Webhook Payload
  • Code Examples
    • PHP with WordPress HTTP API
    • JavaScript (fetch)
    • Python
Newsletter

Insights that grow your business

Join thousands of WooCommerce store owners who get actionable tips, plugin updates, and industry news every week.

We respect your privacy. Unsubscribe at any time.

Weekly updates — Fresh content every Tuesday
Exclusive content — Tips you won't find on our blog
Early access — Be first to know about new plugins
Webstepper
Weekly WooCommerce Tips
Just now
This week: 5 proven strategies to boost your average order value using smart discount campaigns...
New issue!
Webstepper

Tools for store owners who'd rather grow than grind.

Simple, powerful plugins that help WooCommerce store owners sell more — without the learning curve.

500+ happy stores

Products

  • Smart Cycle Discounts
  • Pricing
  • Documentation
  • Changelog

Company

  • About Us
  • Blog
  • Contact
  • Affiliates

Resources

  • Help Center
  • Guides
  • Roadmap
  • Status

Questions? We actually answer.

Real humans, real help. No bots, no runaround. Usually within a few hours.

Get in touch

© 2026 Webstepper. All rights reserved.

Privacy Terms Refunds
Visa Mastercard PayPal Apple Pay Google Pay & more
  • WordPress
    Back
    WordPress Plugins
    View all
    Smart Cycle Discounts A cycling discount mark: rotating arrows around a center badge that cycles commerce icons.

    Smart Cycle Discounts

    Automate discount campaigns with scheduling, analytics, and smart product targeting.

    5 Discount Types Recurring Campaigns
    Free Pro from $59

    TrustLens

    Customer trust intelligence for WooCommerce. Score customers, spot abuse, protect revenue.

    Trust Scores Abuse Detection
    Free Pro from $79

    New Plugin

    Coming Soon

    Something exciting is in the works. Join the waitlist to be first to know.

    Get Notified
    Notify Me
    Secure Checkout
    WordPress.org
    14-Day Refund
    Resources
    Documentation Guides & tutorials
    Discount Calculator Plan your strategy
    Support Get help
    Changelog What's new
    Get notified on new releases
  • Affiliate
  • Blog
  • DOCS
    Back
    Documentation

    Choose a plugin to explore its documentation

    Smart Cycle Discounts Automated discount campaigns for WooCommerce
    Available
    New Plugin Something exciting is in development
    Coming Soon
    New Plugin Something exciting is in development
    Coming Soon
    Docs Home FAQ Get Support
    WordPress tools that solve real problems
  • Contact Us
  • About
    Back
    Company

    Our Story

    Founded 2020

    Built by store owners, for store owners. We create WordPress tools that solve real problems.

    Learn more
    Built from Experience Real solutions we use ourselves
    Time is Precious Simple, intuitive tools
    Real Support Talk to the founders
    Legal & Contact
    Contact Us Privacy Policy Terms of Service Refund Policy
    14-Day Money-Back Guarantee No questions asked