QR Code Tickets and Check-in – REST API

Version: 1.0.0 | Plugin Version: 3.2.0


๐Ÿ“‹ Table of Contents

↑ Back to top
  1. Getting Started
  2. Authentication
  3. Base URL
  4. Response Format
  5. Ticket Management
  6. Product Tickets
  7. Check-in & Validation
  8. Statistics
  9. Orders
  10. Customers
  11. Email
  12. Export
  13. Webhooks
  14. System
  15. Error Codes

๐Ÿš€ Getting Started

↑ Back to top

This 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 top

Most endpoints require authentication (Admin or Logged-in user).

Method 1: Application Password (Recommended)

↑ Back to top
  1. Go to Users โ†’ Profile in WordPress admin
  2. Scroll to Application Passwords
  3. Add new password (e.g., “Postman Testing”)
  4. Copy the generated password

Authentication Levels

↑ Back to top
LevelDescriptionEndpoints
๐Ÿ”“ PublicNo authentication needed/validate/{code}
๐Ÿ” Logged InAny logged-in user/my-tickets
๐Ÿ”’ AdminRequires manage_woocommerce capabilityMost endpoints
๐Ÿ”‘ Check-in StaffTicket checker role/checkin, /checkout

๐ŸŒ Base URL

↑ Back to top
http://your-domain.com/wp-json/wc-tickets/v1/

Example: http://localhost:10125/wp-json/wc-tickets/v1/


๐Ÿ“ฆ Response Format

↑ Back to top

Success Response:

{
  "success": true,
  "data": { ... }
}

Error Response:

{
  "code": "error_code",
  "message": "Error description",
  "data": { "status": 400 }
}

๐Ÿ“š Ticket Management

↑ Back to top

1. Get All Tickets

↑ Back to top

List all tickets with pagination and filtering.

Endpoint: GET /tickets

Authentication: ๐Ÿ”’ Admin

Parameters:

ParameterTypeDefaultDescription
pageinteger1Page number
per_pageinteger10Items per page (max 100)
statusstringallall, valid, checked_in, expired, invalid
searchstringSearch by ticket code, customer name, or email
date_fromdateFilter by creation date (YYYY-MM-DD)
date_todateFilter by creation date (YYYY-MM-DD)
product_idintegerFilter by product ID
orderbystringcreated_atid, ticket_code, order_id, customer_name, created_at
orderstringDESCASC 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 top

Retrieve a specific ticket by its code.

Endpoint: GET /tickets/{ticket_code}

Authentication: ๐Ÿ”“ Public

Example Request:

GET /tickets/TKT-8X7K9M2P

3. Create Ticket

↑ Back to top

Create 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 top

Update 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 top

Delete/cancel a ticket.

Endpoint: DELETE /tickets/{ticket_code}

Authentication: ๐Ÿ”’ Admin


๐ŸŽฏ Product Tickets

↑ Back to top

6. Get Product Tickets

↑ Back to top

Get all tickets for a specific product.

Endpoint: GET /products/{product_id}/tickets

Authentication: ๐Ÿ”’ Admin

Parameters:

ParameterDefaultDescription
statusallall, valid, checked_in, expired
page1Page number
per_page10Items per page

Example Request:

GET /products/123/tickets?status=valid&per_page=20

โœ… Check-in & Validation

↑ Back to top

7. Validate Ticket

↑ Back to top

Check 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 top

Mark 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 top

For 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 top

Check 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 top

Revert a checked-in ticket.

Endpoint: POST /checkin/{ticket_code}/undo

Authentication: ๐Ÿ”’ Admin


๐Ÿ“Š Statistics

↑ Back to top

12. Overall Statistics

↑ Back to top

Endpoint: 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 top

Endpoint: GET /stats/product/{product_id}

Authentication: ๐Ÿ”’ Admin


14. Real-time Statistics

↑ Back to top

Endpoint: GET /stats/realtime

Authentication: ๐Ÿ”’ Admin


15. Daily Statistics

↑ Back to top

Endpoint: GET /stats/daily?days=30

Authentication: ๐Ÿ”’ Admin


๐Ÿ“ฆ Orders

↑ Back to top

16. Get Order Tickets

↑ Back to top

Endpoint: GET /orders/{order_id}/tickets

Authentication: ๐Ÿ” Logged In


17. Regenerate Order Tickets

↑ Back to top

Endpoint: POST /orders/{order_id}/tickets/regenerate

Authentication: ๐Ÿ”’ Admin


๐Ÿ‘ฅ Customers

↑ Back to top

18. Get Customer Tickets

↑ Back to top

Endpoint: GET /customers/tickets?email={email}

Authentication: ๐Ÿ” Logged In


19. Get My Tickets

↑ Back to top

Endpoint: GET /my-tickets

Authentication: ๐Ÿ” Logged In


๐Ÿ“ง Email

↑ Back to top

20. Send Ticket Email

↑ Back to top

Endpoint: POST /tickets/{ticket_code}/email

Authentication: ๐Ÿ”’ Admin


21. Bulk Email Tickets

↑ Back to top

Endpoint: POST /tickets/bulk/email

Authentication: ๐Ÿ”’ Admin

Request Body:

{
  "ticket_codes": ["TKT-CODE1", "TKT-CODE2", "TKT-CODE3"]
}

๐Ÿ“ฅ Export

↑ Back to top

22. Export Tickets

↑ Back to top

Endpoint: GET /export

Authentication: ๐Ÿ”’ Admin

Parameters:

ParameterDefaultDescription
formatcsvcsv or json
statusallall, valid, checked_in, expired, invalid
date_fromFilter by creation date
date_toFilter by creation date
product_idFilter by product ID

Example Request:

GET /export?format=csv&status=valid&date_from=2025-01-01

๐Ÿ”” Webhooks

↑ Back to top

23. List Webhooks

↑ Back to top

Endpoint: GET /webhooks

Authentication: ๐Ÿ”’ Admin


24. Register Webhook

↑ Back to top

Endpoint: 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 top

Endpoint: DELETE /webhooks/{webhook_id}

Authentication: ๐Ÿ”’ Admin


โš™๏ธ System

↑ Back to top

26. API Status

↑ Back to top

Endpoint: 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 top

Endpoint: GET /docs

Authentication: ๐Ÿ”’ Admin


โŒ Error Codes

↑ Back to top
Error CodeHTTP StatusDescription
rest_forbidden401Authentication required or insufficient permissions
rest_no_route404Endpoint not found
not_found404Ticket/product/order not found
invalid_ticket400Ticket is marked as invalid
already_used400Ticket has already been used
expired400Ticket has expired
max_entries400Ticket reached maximum entries
create_failed500Failed 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

Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.