Version: 1.0.0 | Plugin Version: 3.2.0
๐ Table of Contents
↑ Back to top- Getting Started
- Authentication
- Base URL
- Response Format
- Ticket Management
- Product Tickets
- Check-in & Validation
- Statistics
- Orders
- Customers
- Export
- Webhooks
- System
- Error Codes
๐ Getting Started
↑ Back to topThis REST API allows you to manage tickets, process check-ins, and retrieve statistics for your WooCommerce ticket events.
Quick Example:
# Validate a ticket (no login required)
GET https://your-site.com/wp-json/wc-tickets/v1/validate/TKT-ABC123
# Check-in a ticket (requires login)
POST https://your-site.com/wp-json/wc-tickets/v1/checkin
๐ Authentication
↑ Back to topMost endpoints require authentication (Admin or Logged-in user).
Method 1: Application Password (Recommended)
↑ Back to top- Go to Users โ Profile in WordPress admin
- Scroll to Application Passwords
- Add new password (e.g., “Postman Testing”)
- Copy the generated password
Authentication Levels
↑ Back to top| Level | Description | Endpoints |
|---|---|---|
| ๐ Public | No authentication needed | /validate/{code} |
| ๐ Logged In | Any logged-in user | /my-tickets |
| ๐ Admin | Requires manage_woocommerce capability | Most endpoints |
| ๐ Check-in Staff | Ticket checker role | /checkin, /checkout |
๐ Base URL
↑ Back to tophttp://your-domain.com/wp-json/wc-tickets/v1/
Example: http://localhost:10125/wp-json/wc-tickets/v1/
๐ฆ Response Format
↑ Back to topSuccess Response:
{
"success": true,
"data": { ... }
}
Error Response:
{
"code": "error_code",
"message": "Error description",
"data": { "status": 400 }
}
๐ Ticket Management
↑ Back to top1. Get All Tickets
↑ Back to topList all tickets with pagination and filtering.
Endpoint: GET /tickets
Authentication: ๐ Admin
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
| page | integer | 1 | Page number |
| per_page | integer | 10 | Items per page (max 100) |
| status | string | all | all, valid, checked_in, expired, invalid |
| search | string | – | Search by ticket code, customer name, or email |
| date_from | date | – | Filter by creation date (YYYY-MM-DD) |
| date_to | date | – | Filter by creation date (YYYY-MM-DD) |
| product_id | integer | – | Filter by product ID |
| orderby | string | created_at | id, ticket_code, order_id, customer_name, created_at |
| order | string | DESC | ASC or DESC |
Example Request:
GET /tickets?status=valid&per_page=20&page=1
Example Response:
{
"success": true,
"data": [
{
"id": 1,
"ticket_code": "TKT-8X7K9M2P",
"order_id": 45,
"product_id": 123,
"product_name": "Conference Pass",
"customer_name": "John Doe",
"customer_email": "john@example.com",
"status": "Valid",
"status_class": "valid",
"is_checked_in": false,
"is_expired": false,
"checkin_type": "single_entry",
"checkin_count": 0,
"max_checkins": 1,
"expires_at": "2025-12-31 23:59:59",
"created_at": "2025-01-15 10:30:00",
"qr_code_url": "https://api.qrserver.com/..."
}
]
}
2. Get Single Ticket
↑ Back to topRetrieve a specific ticket by its code.
Endpoint: GET /tickets/{ticket_code}
Authentication: ๐ Public
Example Request:
GET /tickets/TKT-8X7K9M2P
3. Create Ticket
↑ Back to topCreate a new ticket manually.
Endpoint: POST /tickets
Authentication: ๐ Admin
Request Body:
{
"order_id": 45,
"item_id": 2,
"product_id": 123,
"customer_email": "john@example.com",
"customer_name": "John Doe",
"variation_id": 0
}
4. Update Ticket
↑ Back to topUpdate an existing ticket.
Endpoint: PUT /tickets/{ticket_code}
Authentication: ๐ Admin
Request Body:
{
"customer_name": "John Smith",
"customer_email": "john.smith@example.com",
"notes": "VIP access granted",
"expires_at": "2025-12-31 23:59:59"
}
5. Delete Ticket
↑ Back to topDelete/cancel a ticket.
Endpoint: DELETE /tickets/{ticket_code}
Authentication: ๐ Admin
๐ฏ Product Tickets
↑ Back to top6. Get Product Tickets
↑ Back to topGet all tickets for a specific product.
Endpoint: GET /products/{product_id}/tickets
Authentication: ๐ Admin
Parameters:
| Parameter | Default | Description |
|---|---|---|
| status | all | all, valid, checked_in, expired |
| page | 1 | Page number |
| per_page | 10 | Items per page |
Example Request:
GET /products/123/tickets?status=valid&per_page=20
โ Check-in & Validation
↑ Back to top7. Validate Ticket
↑ Back to topCheck if a ticket is valid without checking it in.
Endpoint: GET /validate/{ticket_code}
Authentication: ๐ Public
Example Response:
{
"success": true,
"data": {
"valid": true,
"ticket_code": "TKT-8X7K9M2P",
"customer_name": "John Doe",
"reason": "valid"
}
}
Possible reason values: valid, already_used, expired, not_found, max_entries_reached
8. Check-in Ticket
↑ Back to topMark a ticket as checked in.
Endpoint: POST /checkin
Authentication: ๐ Check-in Staff
Request Body:
{
"ticket_code": "TKT-8X7K9M2P",
"location": "Main Entrance",
"notes": "Arrived at 2:30 PM"
}
9. Check-out Ticket
↑ Back to topFor exit-enabled tickets (single_entry_exit or multiple_entry_exit).
Endpoint: POST /checkout
Authentication: ๐ Check-in Staff
Request Body:
{
"ticket_code": "TKT-8X7K9M2P",
"notes": "Exited at 6:00 PM"
}
10. Bulk Check-in
↑ Back to topCheck in multiple tickets at once.
Endpoint: POST /checkin/bulk
Authentication: ๐ Admin
Request Body:
{
"ticket_codes": ["TKT-CODE1", "TKT-CODE2", "TKT-CODE3"]
}
11. Undo Check-in
↑ Back to topRevert a checked-in ticket.
Endpoint: POST /checkin/{ticket_code}/undo
Authentication: ๐ Admin
๐ Statistics
↑ Back to top12. Overall Statistics
↑ Back to topEndpoint: GET /stats
Authentication: ๐ Admin
Example Response:
{
"success": true,
"data": {
"total_tickets": 1000,
"checked_in": 450,
"valid": 500,
"invalid": 20,
"expired": 30,
"today_checkins": 45,
"unique_customers": 850,
"checkin_rate": 45.0
}
}
13. Product Statistics
↑ Back to topEndpoint: GET /stats/product/{product_id}
Authentication: ๐ Admin
14. Real-time Statistics
↑ Back to topEndpoint: GET /stats/realtime
Authentication: ๐ Admin
15. Daily Statistics
↑ Back to topEndpoint: GET /stats/daily?days=30
Authentication: ๐ Admin
๐ฆ Orders
↑ Back to top16. Get Order Tickets
↑ Back to topEndpoint: GET /orders/{order_id}/tickets
Authentication: ๐ Logged In
17. Regenerate Order Tickets
↑ Back to topEndpoint: POST /orders/{order_id}/tickets/regenerate
Authentication: ๐ Admin
๐ฅ Customers
↑ Back to top18. Get Customer Tickets
↑ Back to topEndpoint: GET /customers/tickets?email={email}
Authentication: ๐ Logged In
19. Get My Tickets
↑ Back to topEndpoint: GET /my-tickets
Authentication: ๐ Logged In
๐ง Email
↑ Back to top20. Send Ticket Email
↑ Back to topEndpoint: POST /tickets/{ticket_code}/email
Authentication: ๐ Admin
21. Bulk Email Tickets
↑ Back to topEndpoint: POST /tickets/bulk/email
Authentication: ๐ Admin
Request Body:
{
"ticket_codes": ["TKT-CODE1", "TKT-CODE2", "TKT-CODE3"]
}
๐ฅ Export
↑ Back to top22. Export Tickets
↑ Back to topEndpoint: GET /export
Authentication: ๐ Admin
Parameters:
| Parameter | Default | Description |
|---|---|---|
| format | csv | csv or json |
| status | all | all, valid, checked_in, expired, invalid |
| date_from | – | Filter by creation date |
| date_to | – | Filter by creation date |
| product_id | – | Filter by product ID |
Example Request:
GET /export?format=csv&status=valid&date_from=2025-01-01
๐ Webhooks
↑ Back to top23. List Webhooks
↑ Back to topEndpoint: GET /webhooks
Authentication: ๐ Admin
24. Register Webhook
↑ Back to topEndpoint: POST /webhooks
Authentication: ๐ Admin
Request Body:
{
"url": "https://your-server.com/webhook-endpoint",
"event": "ticket.checked_in"
}
Available Events: ticket.created, ticket.checked_in, ticket.invalid, ticket.emailed
25. Delete Webhook
↑ Back to topEndpoint: DELETE /webhooks/{webhook_id}
Authentication: ๐ Admin
โ๏ธ System
↑ Back to top26. API Status
↑ Back to topEndpoint: GET /status
Authentication: ๐ Admin
Example Response:
{
"success": true,
"data": {
"status": "online",
"version": "1.0.0",
"plugin_version": "3.2.0",
"database_connected": true,
"total_tickets": 1250,
"timestamp": "2025-01-20 15:00:00"
}
}
27. API Documentation
↑ Back to topEndpoint: GET /docs
Authentication: ๐ Admin
โ Error Codes
↑ Back to top| Error Code | HTTP Status | Description |
|---|---|---|
| rest_forbidden | 401 | Authentication required or insufficient permissions |
| rest_no_route | 404 | Endpoint not found |
| not_found | 404 | Ticket/product/order not found |
| invalid_ticket | 400 | Ticket is marked as invalid |
| already_used | 400 | Ticket has already been used |
| expired | 400 | Ticket has expired |
| max_entries | 400 | Ticket reached maximum entries |
| create_failed | 500 | Failed to create ticket |
๐ฎ cURL Examples
↑ Back to top# Validate ticket
curl -X GET "http://localhost:10125/wp-json/wc-tickets/v1/validate/TKT-ABC123"
# Check-in ticket (with auth)
curl -X POST \
-u "admin:your_app_password" \
-H "Content-Type: application/json" \
-d '{"ticket_code":"TKT-ABC123","location":"Main Gate"}' \
"http://localhost:10125/wp-json/wc-tickets/v1/checkin"
# Get all tickets
curl -X GET \
-u "admin:your_app_password" \
"http://localhost:10125/wp-json/wc-tickets/v1/tickets?per_page=20"
# Get statistics
curl -X GET \
-u "admin:your_app_password" \
"http://localhost:10125/wp-json/wc-tickets/v1/stats"
# Export tickets
curl -X GET \
-u "admin:your_app_password" \
"http://localhost:10125/wp-json/wc-tickets/v1/export?format=csv&status=valid" \
--output tickets.csv
Need Help? Check the FAQ section in WordPress Admin โ WooCommerce โ Settings โ Tickets โ FAQs
Documentation generated: April 2025 | Plugin Version: 3.2.0