Tickets API
Manage customer support tickets
Tickets API
Handle customer support tickets, view messages, and respond to inquiries.
Endpoints Overview
| Method | Endpoint | Description |
|---|---|---|
GET | /v1/tickets | List all tickets |
GET | /v1/tickets/:id | Get ticket with messages |
POST | /v1/tickets/:id | Reply to a ticket |
PATCH | /v1/tickets/:id | Update ticket status |
List Tickets
GET /v1/ticketsQuery Parameters
| Parameter | Type | Description |
|---|---|---|
page | integer | Page number (default: 1) |
limit | integer | Items per page (default: 25, max: 100) |
status | string | Filter by status: open or closed |
Response
{
"data": [
{
"id": "tkt_abc123",
"subject": "help",
"status": "open",
"awaiting_response_from": "owner",
"customer_email": "customer@example.com",
"order_id": "ord_xyz789",
"invoice_id": "INV-12345",
"product_name": "Premium License",
"order_amount": 29.99,
"order_currency": "USD",
"message_count": 3,
"has_owner_reply": false,
"created_at": "2025-01-20T10:00:00Z",
"updated_at": "2025-01-20T12:30:00Z",
"closed_at": null
}
],
"stats": {
"total": 25,
"open": 12,
"closed": 13,
"needsResponse": 8
},
"meta": {
"total": 25,
"limit": 25,
"offset": 0
}
}Example Request
curl -X GET "https://api.sellgate.cc/v1/tickets?status=open" \
-H "Authorization: Bearer sg_live_your_api_key"Get Ticket
Retrieve a ticket with all its messages.
GET /v1/tickets/:idResponse
{
"data": {
"id": "tkt_abc123",
"subject": "Order not received",
"status": "open",
"customer_email": "customer@example.com",
"order_id": "ord_xyz789",
"messages": [
{
"id": "msg_001",
"sender": "customer",
"message": "I haven't received my order yet.",
"created_at": "2025-01-20T10:00:00Z"
},
{
"id": "msg_002",
"sender": "seller",
"message": "Let me check on that for you.",
"created_at": "2025-01-20T12:30:00Z"
}
],
"created_at": "2025-01-20T10:00:00Z"
}
}Reply to Ticket
POST /v1/tickets/:idRequest Body
{
"message": "Your order has been resent. Please check your email."
}Example Request
curl -X POST "https://api.sellgate.cc/v1/tickets/tkt_abc123" \
-H "Authorization: Bearer sg_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"message": "Your order has been resent. Please check your email."
}'Update Ticket Status
Close or reopen a ticket.
PATCH /v1/tickets/:idRequest Body
{
"status": "closed"
}Ticket Statuses
| Status | Description |
|---|---|
open | Ticket is open and awaiting response |
closed | Ticket has been resolved |
Ticket Stats
The list endpoint includes aggregate statistics:
| Field | Description |
|---|---|
total | Total tickets |
open | Open tickets |
closed | Closed tickets |
needsResponse | Tickets awaiting seller response |
Ticket Object
| Field | Type | Description |
|---|---|---|
id | string | Ticket identifier |
subject | string | Ticket subject |
status | string | open or closed |
awaiting_response_from | string | Who needs to respond (owner or customer) |
customer_email | string | Customer email |
order_id | string | Related order ID |
invoice_id | string | Related invoice ID |
product_name | string | Product name |
order_amount | number | Order amount |
order_currency | string | Currency |
message_count | integer | Number of messages |
has_owner_reply | boolean | Whether seller has replied |
created_at | string | Creation timestamp |
updated_at | string | Last update timestamp |
closed_at | string | Closure timestamp |