Developers
REST API and realtime integration
Advanced guide · about 30 minutes · Developer / integrator.
At a glance
Audience: Developer / integrator. Difficulty: advanced. Time: about 30 minutes.
Prerequisites
- WordPress REST familiarity
- Authenticated session for writes
Steps
1. Use the namespace
All routes live under /wp-json/canvas-auctions/v1/.
2. Authenticate writes
Send cookie auth plus a valid REST nonce for POST routes.
3. Poll events by sequence
Live clients call GET /auctions/{id}/events incrementally. Recover from last confirmed sequence after reconnect.
4. Never trust push alone
If a push transport is configured, treat it as a wake signal only. Authoritative state always comes from WordPress.
REST routes
Namespace: canvas-auctions/v1 (full path /wp-json/canvas-auctions/v1).
| Methods | Path |
|---|---|
| GET, POST | /auctions |
| GET | /auctions/\{id\} |
| GET | /auctions/\{id\}/state |
| GET, POST | /auctions/\{id\}/bids |
| GET | /auctions/\{id\}/events |
| POST | /auctions/\{id\}/watch |
| POST | /auctions/\{id\}/submit |
| POST | /auctions/\{id\}/approve |
| POST | /media |
| POST | /live/\{id\}/host |
| POST | /live/\{id\}/join |
| POST | /awards/\{id\}/checkout |
| GET | /products |
| GET | /products/\{id\} |
| POST | /holder/apply |
| GET | /me/dashboard |
| POST | /auctions/\{id\}/accept-bid |
| POST | /orders/\{id\} |
| GET, POST | /payouts |
| POST | /payouts/method |
| POST | /payouts/\{id\}/cancel |
Actions
wcap_auction_createdwcap_auction_approvedwcap_auction_startedwcap_before_bid_validationwcap_bid_acceptedwcap_bidder_outbidwcap_auction_extendedwcap_auction_closedwcap_award_createdwcap_winner_checkout_initializedwcap_order_linkedwcap_payment_completedwcap_payment_failedwcap_payment_deadline_expiredwcap_settlement_calculatedwcap_payout_status_changedwcap_notification_dispatchwcap_realtime_notifywcap_holder_approvedwcap_holder_rejectedwcap_logged
Filters
wcap_bid_incrementwcap_commission_amountwcap_public_bidder_display_namewcap_role_restricted_accesswcap_enqueue_frontend_assetswcap_user_can_access_wp_adminwcap_dashboard_url_for_userwcap_login_redirectwcap_allow_frontend_registrationwcap_max_image_byteswcap_image_uploads_per_hour
WP-CLI
wp canvas-auctions list [--state=<state>]
wp canvas-auctions close <id>
wp canvas-auctions overdue
wp canvas-auctions rebuild <id>
wp canvas-auctions schema
wp canvas-auctions diagnostics
wp canvas-auctions reschedule <id>
wp canvas-auctions migrate