Developer Docs
REST API Reference
Smart Add-Ons REST API — 28+ endpoints under the saue/v1 namespace for addon groups, price preview, events, A/B tests, and licensing.
Base URL & namespace
Base URL: https://your-store.com/wp-json/saue/v1
Namespace: saue/v1Authentication
Endpoints are split into two access levels:
- Public — accessible without authentication. Used by the storefront (price preview, event tracking, addon group retrieval, cart validation).
manage_woocommerce— requires a WordPress user with themanage_woocommercecapability. Send credentials via WordPress REST API authentication (cookie nonce or Application Password).- Token — file upload endpoints accept a short-lived upload token generated server-side for the active session.
Example using Application Password:
curl -u "admin:xxxx xxxx xxxx xxxx xxxx xxxx"
https://your-store.com/wp-json/saue/v1/addonsAddon Group endpoints
| Endpoint | Method | Auth | Description |
|---|---|---|---|
/addons | GET | manage_woocommerce | List all addon groups with pagination |
/addons | POST | manage_woocommerce | Create a new addon group |
/addons/{id} | GET | manage_woocommerce | Get a single addon group by ID |
/addons/{id} | PUT | manage_woocommerce | Update an existing addon group |
/addons/{id} | DELETE | manage_woocommerce | Delete an addon group (permanent) |
/addons/{id}/duplicate | POST | manage_woocommerce | Create an exact copy of the group |
/addons/{id}/export | GET | manage_woocommerce | Export group as a JSON file download |
/addons/import | POST | manage_woocommerce | Import a group from JSON (multipart) |
Storefront endpoints (public)
| Endpoint | Method | Auth | Description |
|---|---|---|---|
/addons/product/{product_id} | GET | Public | Get all resolved addon groups for a product ID |
/price-preview | POST | Public | Calculate total price for a set of field selections |
/validate-addons | POST | Public | Validate field selections before add-to-cart (required fields, rules) |
/analytics/events | POST | Public | Record a storefront event (view, interaction, conversion) |
File upload endpoints
| Endpoint | Method | Auth | Description |
|---|---|---|---|
/upload | POST | Token (session) | Upload a file for a file upload field. Returns a file reference ID. |
/orders/{order_id}/items/{item_id}/uploads/{field_id}/download | GET | manage_woocommerce | Admin download for an uploaded file attached to an order item |
A/B Test endpoints
| Endpoint | Method | Auth | Description |
|---|---|---|---|
/ab-tests | GET | manage_woocommerce | List all A/B tests |
/ab-tests | POST | manage_woocommerce | Create a new A/B test |
/ab-tests/{id} | GET | manage_woocommerce | Get results and status for a single test |
/ab-tests/{id} | PUT | manage_woocommerce | Update a test (pause, change split) |
/ab-tests/{id}/declare-winner | POST | manage_woocommerce | End the test and apply the winning variant |
AI suggestions endpoint
| Endpoint | Method | Auth | Description |
|---|---|---|---|
/ai/suggest | POST | manage_woocommerce | Get AI-generated upsell suggestions for a product. Requires Pro plan and backend OpenAI key. |
License endpoints
| Endpoint | Method | Auth | Description |
|---|---|---|---|
/license/status | GET | manage_woocommerce | Get current license status (plan, expiry, features) |
/license/activate | POST | manage_woocommerce | Activate a license key on this site |
/license/deactivate | POST | manage_woocommerce | Deactivate the current license (frees an activation slot) |
Example: Price preview
POST /wp-json/saue/v1/price-preview
Content-Type: application/json
{
"product_id": 123,
"quantity": 2,
"selections": [
{ "field_id": 10, "value": "yes" },
{ "field_id": 11, "value": "Happy Birthday!" }
]
}Response:
{
"base_price": "49.99",
"addons_total": "6.00",
"total": "55.99",
"breakdown": [
{ "field_id": 10, "label": "Add gift wrapping", "price": "3.00" },
{ "field_id": 11, "label": "Gift message", "price": "0.00" }
]
}Example: Get addon groups for a product
GET /wp-json/saue/v1/addons/product/123Returns the resolved and ordered list of addon groups assigned to product 123, including all field definitions, options, pricing rules, and conditional logic.