Omnichannel Inquiries & Support Tickets API
APay unifies guest pre-sales/partnership inquiries and authenticated member support tickets into a single conversation model (tickets + ticket_messages). Unauthenticated visitors can submit inquiries with an email or contact handle and continue the conversation using the returned accessToken, while logged-in members automatically see both their member tickets and any prior guest inquiries submitted under the same email.
Public & Omnichannel Endpoints
1. Submit Inquiry (POST /api/inquiries)
Allows both unauthenticated guests and logged-in members to submit a pre-sales question, partnership proposal, feedback, or technical support ticket. Rate-limited per IP.
Request Body
{
"category": "presales",
"title": "Enterprise gateway quota inquiry",
"contactName": "Alex",
"contactEmail": "alex@example.com",
"contactInfo": "WeChat: alex_dev",
"content": "Hi, we would like to inquire about custom concurrency limits.",
"context": {
"sourcePath": "/zh/gateways",
"locale": "zh"
}
}
| Field | Type | Required | Description |
|---|---|---|---|
category | string | No | presales, cooperation, feedback, technical, billing, account, listing, studio, extension, other |
title | string | No | Optional subject line; automatically derived from content when omitted |
content | string | Yes | Inquiry message body (2–2000 characters) |
contactName | string | No | Sender display name (defaults to logged-in nickname or email prefix) |
contactEmail | string | Conditional | Required for guests if contactInfo is omitted; used for email reply notifications |
contactInfo | string | Conditional | Optional WeChat ID / Telegram / phone handle |
context | object | No | Context snapshot (sourcePath, locale, diagnostic metadata) |
Response (200)
{
"code": 200,
"message": "咨询提交成功",
"data": {
"id": 42,
"ticketNo": "TK-20261025-8391",
"accessToken": "f4a9c2...",
"title": "Enterprise gateway quota inquiry",
"category": "presales",
"status": "open",
"autoDiagnosed": false,
"botReply": null
}
}
2. Fetch Thread (GET /api/inquiries/:ticketNo)
Retrieves the inquiry metadata and full ticket_messages list. Authorized either by query parameter ?token=<accessToken> or by an active member session matching userId / contactEmail.
3. Reply to Thread (POST /api/inquiries/:ticketNo/reply)
Appends a follow-up message from the visitor or member and re-activates resolved threads back to in_progress.
{
"token": "f4a9c2...",
"content": "Thanks! Here are our expected daily request volumes..."
}
Member & Admin Endpoints
- Member Center (
/api/users/tickets):GET /api/users/tickets: Lists tickets matching the member'suserIdorcontactEmail.POST /api/users/tickets: Creates a member ticket with automatic diagnostic check.GET /api/users/tickets/:id&POST /api/users/tickets/:id/reply: Views and replies to a ticket.
- Admin Center (
/api/admin/tickets):GET /api/admin/tickets: Lists and filters all guest inquiries and member tickets.GET /api/admin/tickets/:id: Returns thread details, contact handles, context snapshot, and member wallet/order summary.POST /api/admin/tickets/:id/reply: Posts an admin reply, triggers an in-site notification (notifications), and sends an email notification (ticket_replytemplate) whencontactEmailoruserEmailis present.