Skip to main content
The Tickets API allows you to create, retrieve, update, and delete support tickets. Tickets represent customer support requests and issues.

The Ticket Object

id
integer
Unique identifier for the ticket
subject
string
Ticket subject line
status
string
Ticket status (e.g., open, replied, closed)
priority
string
Ticket priority level (e.g., low, medium, high, urgent)
department
string
Department the ticket is assigned to
user_id
integer
ID of the user who created the ticket
assigned_to
integer
ID of the staff member assigned to this ticket (null if unassigned)
created_at
datetime
Timestamp when the ticket was created
updated_at
datetime
Timestamp when the ticket was last updated

Relationships

user
object
The customer who created this ticket
assigned_to
object
The staff member assigned to this ticket
messages
array
Messages/replies in the ticket conversation

List Tickets

curl https://your-domain.com/api/v1/admin/tickets \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"

Query Parameters

per_page
integer
default:"15"
Number of tickets to return per page (max 100)
page
integer
default:"1"
Page number for pagination
filter[id]
integer
Filter tickets by ID
filter[user_id]
integer
Filter tickets by user ID
filter[status]
string
Filter by ticket status
filter[priority]
string
Filter by priority level
filter[department]
string
Filter by department
sort
string
Sort tickets. Available: id, created_at, updated_at, status, priority, department. Prefix with - for descending.
include
string
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

id
integer
required
The ID of the ticket to retrieve

Query Parameters

include
string
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

subject
string
required
Ticket subject line (max 255 characters)
user_id
integer
required
ID of the user creating the ticket
status
string
required
Ticket status (e.g., open, replied, closed)
priority
string
required
Priority level (e.g., low, medium, high, urgent)
department
string
required
Department to assign the ticket to
assigned_to
integer
ID of staff member to assign the ticket to
service_id
integer
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

id
integer
required
The ID of the ticket to update

Request Body

All fields are optional. Only include fields you want to update.
subject
string
Ticket subject line
status
string
Ticket status
priority
string
Priority level
department
string
Department assignment
assigned_to
integer
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

id
integer
required
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:
Add Ticket Message
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:
  1. Created - Customer or staff creates ticket
  2. Assigned - Ticket assigned to department/staff member
  3. Replied - Staff provides initial response
  4. Back and forth - Conversation continues with status updates
  5. Resolved - Issue is resolved
  6. 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

Build docs developers (and LLMs) love