SellGate API

Tickets API

Manage customer support tickets

Tickets API

Handle customer support tickets, view messages, and respond to inquiries.

Endpoints Overview

MethodEndpointDescription
GET/v1/ticketsList all tickets
GET/v1/tickets/:idGet ticket with messages
POST/v1/tickets/:idReply to a ticket
PATCH/v1/tickets/:idUpdate ticket status

List Tickets

GET /v1/tickets

Query Parameters

ParameterTypeDescription
pageintegerPage number (default: 1)
limitintegerItems per page (default: 25, max: 100)
statusstringFilter 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/:id

Response

{
  "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/:id

Request 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/:id

Request Body

{
  "status": "closed"
}

Ticket Statuses

StatusDescription
openTicket is open and awaiting response
closedTicket has been resolved

Ticket Stats

The list endpoint includes aggregate statistics:

FieldDescription
totalTotal tickets
openOpen tickets
closedClosed tickets
needsResponseTickets awaiting seller response

Ticket Object

FieldTypeDescription
idstringTicket identifier
subjectstringTicket subject
statusstringopen or closed
awaiting_response_fromstringWho needs to respond (owner or customer)
customer_emailstringCustomer email
order_idstringRelated order ID
invoice_idstringRelated invoice ID
product_namestringProduct name
order_amountnumberOrder amount
order_currencystringCurrency
message_countintegerNumber of messages
has_owner_replybooleanWhether seller has replied
created_atstringCreation timestamp
updated_atstringLast update timestamp
closed_atstringClosure timestamp

On this page