DOCS

v1.3.28
 // Pro v1.2.20

 · Latest

Docs/API Reference

API Reference

Order Daemon exposes a REST API under the /wp-json/odcm/v1/ namespace. The API covers rule management, audit log access, and webhook configuration. Pro endpoints require an active Pro licence in addition to authentication.

Authentication

The API uses WordPress Application Passwords. Generate one in WP Admin under Users > Profile > Application Passwords, then pass it as a Base64-encoded username:password string in the Authorization header.

curl -s 
  -H "Authorization: Basic YOUR_APP_PASSWORD" 
  https://YOUR_SITE_URL/wp-json/odcm/v1/rules

YOUR_APP_PASSWORD is the Base64 encoding of your_username:the_app_password_string. WordPress displays the app password separately from the username, so encode them together:

echo -n "admin:xxxx xxxx xxxx xxxx xxxx xxxx" | base64

Pass the result as Basic <encoded> in the Authorization header.

Base URL

https://YOUR_SITE_URL/wp-json/odcm/v1/

All endpoints are relative to this base.

Endpoint summary

EndpointDescription
GET /rulesList all rules
POST /rulesCreate a rule
GET /rules/{id}Retrieve a single rule
PUT /rules/{id}Update a rule
DELETE /rules/{id}Delete a rule
GET /audit-logQuery execution history
GET /webhooksList configured webhooks Pro
POST /webhooksRegister a webhook endpoint Pro

Pro endpoints return a 401 with code odcm_licence_required if no valid licence is active.

Error format

Order Daemon uses standard WordPress REST error responses. Every error is a JSON object with code, message, and data fields.

{
  "code": "odcm_rule_not_found",
  "message": "No rule exists with that ID.",
  "data": { "status": 404 }
}

HTTP status codes follow REST conventions: 400 bad input, 401 authentication failure, 403 insufficient permissions, 404 unknown resource, 500 server error.

Child docs in this section

  • REST API Overview covers request/response format, pagination, and filtering in detail
  • Rules Management API documents every endpoint for creating, reading, updating, and deleting rules
  • Audit Log API covers querying execution history with filtering by rule, date, and status
  • Webhooks API documents webhook endpoint registration and management Pro
  • Pro API covers Pro-only endpoints including licence status and rule testing Pro