The Tickets API allows you to create, retrieve, update, and delete support tickets. Tickets represent customer support requests and issues.
The Ticket Object
Unique identifier for the ticket
Ticket status (e.g., open, replied, closed)
Ticket priority level (e.g., low, medium, high, urgent)
Department the ticket is assigned to
ID of the user who created the ticket
ID of the staff member assigned to this ticket (null if unassigned)
Timestamp when the ticket was created
Timestamp when the ticket was last updated
Relationships
The customer who created this ticket
The staff member assigned to this ticket
Messages/replies in the ticket conversation
ID of the user who sent the message
List Tickets
curl https://your-domain.com/api/v1/admin/tickets \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"
Query Parameters
Number of tickets to return per page (max 100)
Page number for pagination
Filter tickets by user ID
Sort tickets. Available: id, created_at, updated_at, status, priority, department. Prefix with - for descending.
Include related resources: messages, user, assigned_to. Comma-separated.
Response
{
"data": [
{
"type": "tickets",
"id": "1",
"attributes": {
"subject": "Unable to access hosting panel",
"status": "open",
"priority": "high",
"department": "technical",
"user_id": 1,
"assigned_to": 5,
"created_at": "2024-01-15T10:30:00.000000Z",
"updated_at": "2024-01-15T10:30:00.000000Z"
},
"relationships": {
"user": {
"data": {
"type": "users",
"id": "1"
}
},
"assigned_to": {
"data": {
"type": "users",
"id": "5"
}
},
"messages": {
"data": [
{
"type": "ticket_messages",
"id": "1"
}
]
}
}
}
],
"links": {
"first": "https://your-domain.com/api/v1/admin/tickets?page=1",
"last": "https://your-domain.com/api/v1/admin/tickets?page=7",
"prev": null,
"next": "https://your-domain.com/api/v1/admin/tickets?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"path": "https://your-domain.com/api/v1/admin/tickets",
"per_page": 15,
"to": 15
}
}
Retrieve a Ticket
curl https://your-domain.com/api/v1/admin/tickets/1 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"
Path Parameters
The ID of the ticket to retrieve
Query Parameters
Include related resources: messages, user, assigned_to
Response
{
"data": {
"type": "tickets",
"id": "1",
"attributes": {
"subject": "Unable to access hosting panel",
"status": "open",
"priority": "high",
"department": "technical",
"user_id": 1,
"assigned_to": 5,
"created_at": "2024-01-15T10:30:00.000000Z",
"updated_at": "2024-01-15T10:30:00.000000Z"
},
"relationships": {
"user": {
"data": {
"type": "users",
"id": "1"
}
},
"messages": {
"data": [
{
"type": "ticket_messages",
"id": "1"
}
]
}
}
}
}
Create a Ticket
curl -X POST https://your-domain.com/api/v1/admin/tickets \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"subject": "Billing question",
"user_id": 1,
"status": "open",
"priority": "medium",
"department": "billing"
}'
Request Body
Ticket subject line (max 255 characters)
ID of the user creating the ticket
Ticket status (e.g., open, replied, closed)
Priority level (e.g., low, medium, high, urgent)
Department to assign the ticket to
ID of staff member to assign the ticket to
ID of the service this ticket relates to
Creating a ticket only creates the ticket object. You’ll need to add the initial message separately using the Ticket Messages API.
Response
{
"data": {
"type": "tickets",
"id": "42",
"attributes": {
"subject": "Billing question",
"status": "open",
"priority": "medium",
"department": "billing",
"user_id": 1,
"assigned_to": null,
"created_at": "2024-01-20T15:45:00.000000Z",
"updated_at": "2024-01-20T15:45:00.000000Z"
}
}
}
Update a Ticket
curl -X PUT https://your-domain.com/api/v1/admin/tickets/1 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"status": "closed",
"priority": "low"
}'
Path Parameters
The ID of the ticket to update
Request Body
All fields are optional. Only include fields you want to update.
Staff member assignment (null to unassign)
Response
{
"data": {
"type": "tickets",
"id": "1",
"attributes": {
"subject": "Unable to access hosting panel",
"status": "closed",
"priority": "low",
"department": "technical",
"user_id": 1,
"assigned_to": 5,
"created_at": "2024-01-15T10:30:00.000000Z",
"updated_at": "2024-01-20T17:00:00.000000Z"
}
}
}
Delete a Ticket
curl -X DELETE https://your-domain.com/api/v1/admin/tickets/1 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"
Path Parameters
The ID of the ticket to delete
Response
Returns HTTP 204 No Content on success.
Deleting a ticket is permanent and removes all associated messages. Consider closing tickets instead of deleting them.
Ticket with Messages
To view a ticket with all its messages:
curl "https://your-domain.com/api/v1/admin/tickets/1?include=messages,user" \
-H "Authorization: Bearer YOUR_API_KEY"
Response:
{
"data": {
"type": "tickets",
"id": "1",
"attributes": {
"subject": "Unable to access hosting panel",
"status": "open",
"priority": "high",
"department": "technical",
"user_id": 1,
"assigned_to": 5,
"created_at": "2024-01-15T10:30:00.000000Z",
"updated_at": "2024-01-15T11:15:00.000000Z"
},
"relationships": {
"user": {
"data": {
"type": "users",
"id": "1"
}
},
"messages": {
"data": [
{
"type": "ticket_messages",
"id": "1"
},
{
"type": "ticket_messages",
"id": "2"
}
]
}
}
},
"included": [
{
"type": "users",
"id": "1",
"attributes": {
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]"
}
},
{
"type": "ticket_messages",
"id": "1",
"attributes": {
"message": "I can't log into my hosting control panel. It shows an error.",
"user_id": 1,
"created_at": "2024-01-15T10:30:00.000000Z"
}
},
{
"type": "ticket_messages",
"id": "2",
"attributes": {
"message": "Hi John, I've reset your password. Please check your email.",
"user_id": 5,
"created_at": "2024-01-15T11:15:00.000000Z"
}
}
]
}
Common Ticket Filters
Get Open Tickets
curl "https://your-domain.com/api/v1/admin/tickets?filter[status]=open" \
-H "Authorization: Bearer YOUR_API_KEY"
Get High Priority Tickets
curl "https://your-domain.com/api/v1/admin/tickets?filter[priority]=high" \
-H "Authorization: Bearer YOUR_API_KEY"
Get User’s Tickets
curl "https://your-domain.com/api/v1/admin/tickets?filter[user_id]=1" \
-H "Authorization: Bearer YOUR_API_KEY"
Get Unassigned Tickets
Filter for tickets where assigned_to is null (requires custom filtering in your application).
Ticket Statuses
Common ticket statuses (configured in Paymenter settings):
- open: Newly created, awaiting response
- replied: Staff has replied, awaiting customer response
- customer-reply: Customer has replied, awaiting staff response
- on-hold: Temporarily paused
- closed: Resolved and closed
Available statuses, priorities, and departments are configured in your Paymenter admin panel settings.
Managing Ticket Messages
Ticket messages are managed separately via the Ticket Messages API:
curl -X POST https://your-domain.com/api/v1/admin/ticket-messages \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"ticket_id": 1,
"message": "Thank you for contacting support. We are investigating your issue.",
"user_id": 5
}'
Ticket Workflow
Typical ticket lifecycle:
- Created - Customer or staff creates ticket
- Assigned - Ticket assigned to department/staff member
- Replied - Staff provides initial response
- Back and forth - Conversation continues with status updates
- Resolved - Issue is resolved
- Closed - Ticket is closed
Best Practices
When working with tickets via the API:
- Update status appropriately - Change status when replying or resolving tickets
- Include messages - Always fetch messages to get full ticket context
- Assign tickets - Use the
assigned_to field for ticket routing
- Set priorities correctly - Help staff prioritize urgent issues
- Link to services - Use
service_id to associate tickets with specific services