Support Tickets API
The Support Tickets API allows you to manage customer support tickets in the Nilo platform. This API enables you to view, close, and request additional information for support tickets created by stores.
Understanding Support Tickets
Support tickets are created by stores when they need assistance. The lifecycle of a ticket is:
- Created: Store creates a ticket (you receive a webhook notification)
- In Progress: You are working on the issue
- Additional Info Requested: You need more information from the store
- Solved/Closed: The issue has been resolved
Ticket Statuses
| Status | Description |
|---|---|
| PENDING | Ticket just created, awaiting attention |
| IN_PROGRESS | Ticket is being worked on |
| ADDITIONAL_INFO_REQUESTED | Waiting for more info from the store |
| SOLVED | Issue has been resolved |
| CLOSED | Ticket has been closed |
Single Ticket Operations
Get Support Ticket Details
/support/ticket/{id}Retrieve detailed information about a specific support ticket.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | The support ticket ID (same as the one received in the webhook notification) |
Response Example
{
"id": 1234,
"status": "PENDING",
"userMessage": "I need help with my order",
"externalTicketId": "EXT-5678",
"niloInternalCode": "STORE-001",
"resolvedAt": null
}
Example Usage
- Javascript
- Python
const headers = {
Authorization: "YOUR_AUTH_TOKEN",
"x-api-key": "YOUR_API_KEY",
};
fetch(
"https://tm0cs5kjs6.execute-api.us-east-1.amazonaws.com/dev/support/ticket/1234",
{
method: "GET",
headers: headers,
}
)
.then((response) => response.json())
.then((result) => console.log(result))
.catch((error) => console.log("error", error));
import requests
url = "https://tm0cs5kjs6.execute-api.us-east-1.amazonaws.com/dev/support/ticket/1234"
headers = {
'Authorization': 'YOUR_AUTH_TOKEN',
'x-api-key': 'YOUR_API_KEY'
}
response = requests.get(url, headers=headers)
print(response.text)
List All Support Tickets
/support/ticketRetrieve a list of all support tickets with pagination and filtering support.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| take | number | No | Number of items per page (default: 50, max: 50) |
| page | string | No | Page number (default: 1) |
| status | string | No | Filter by status (CLOSED, PENDING, IN_PROGRESS, ADDITIONAL_INFO_REQUESTED, SOLVED) |
Example Usage
- Javascript
- Python
const headers = {
Authorization: "YOUR_AUTH_TOKEN",
"x-api-key": "YOUR_API_KEY",
};
fetch(
"https://tm0cs5kjs6.execute-api.us-east-1.amazonaws.com/dev/support/ticket?status=PENDING",
{
method: "GET",
headers: headers,
}
)
.then((response) => response.json())
.then((result) => console.log(result))
.catch((error) => console.log("error", error));
import requests
url = "https://tm0cs5kjs6.execute-api.us-east-1.amazonaws.com/dev/support/ticket?status=PENDING"
headers = {
'Authorization': 'YOUR_AUTH_TOKEN',
'x-api-key': 'YOUR_API_KEY'
}
response = requests.get(url, headers=headers)
print(response.text)
Close Support Ticket
/support/ticket/closeClose a support ticket with a resolution message.
Request Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| message | string | No | Message explaining the resolution |
| ticketId | number | No* | Ticket ID provided by Nilo |
| externalTicketId | string | No* | External ticket ID provided by your ticket service |
*Either ticketId OR externalTicketId must be provided.
Request Body Example
{
"message": "Issue has been resolved. The order was delivered successfully.",
"ticketId": 1234
}
Example Usage
- Javascript
- Python
const headers = {
Authorization: "YOUR_AUTH_TOKEN",
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json",
};
const data = {
message: "Issue has been resolved. The order was delivered successfully.",
ticketId: 1234,
};
fetch(
"https://tm0cs5kjs6.execute-api.us-east-1.amazonaws.com/dev/support/ticket/close",
{
method: "PUT",
headers: headers,
body: JSON.stringify(data),
}
)
.then((response) => response.json())
.then((result) => console.log(result))
.catch((error) => console.log("error", error));
import requests
url = "https://tm0cs5kjs6.execute-api.us-east-1.amazonaws.com/dev/support/ticket/close"
headers = {
'Authorization': 'YOUR_AUTH_TOKEN',
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
}
data = {
"message": "Issue has been resolved. The order was delivered successfully.",
"ticketId": 1234
}
response = requests.put(url, headers=headers, json=data)
print(response.text)
Request Additional Information
/support/ticket/additional-infoRequest additional information from the store for a specific ticket. The store will receive a notification and can respond with the requested information.
Request Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| message | string | No | Message specifying what additional information is needed |
| ticketId | number | No* | Ticket ID provided by Nilo |
| externalTicketId | string | No* | External ticket ID provided by your ticket service |
*Either ticketId OR externalTicketId must be provided.
Request Body Example
{
"message": "Please provide the order number and a photo of the damaged product.",
"ticketId": 1234
}
Example Usage
- Javascript
- Python
const headers = {
Authorization: "YOUR_AUTH_TOKEN",
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json",
};
const data = {
message: "Please provide the order number and a photo of the damaged product.",
ticketId: 1234,
};
fetch(
"https://tm0cs5kjs6.execute-api.us-east-1.amazonaws.com/dev/support/ticket/additional-info",
{
method: "POST",
headers: headers,
body: JSON.stringify(data),
}
)
.then((response) => response.json())
.then((result) => console.log(result))
.catch((error) => console.log("error", error));
import requests
url = "https://tm0cs5kjs6.execute-api.us-east-1.amazonaws.com/dev/support/ticket/additional-info"
headers = {
'Authorization': 'YOUR_AUTH_TOKEN',
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
}
data = {
"message": "Please provide the order number and a photo of the damaged product.",
"ticketId": 1234
}
response = requests.post(url, headers=headers, json=data)
print(response.text)
Related Webhooks
Support tickets integrate with webhooks to notify you of events:
| Webhook | Description |
|---|---|
POST /webhooks/support/create-ticket | Notifies when a new ticket is created |
POST /webhooks/support/ticket-additional-info-received | Notifies when the store responds to your additional info request |
See the Webhooks documentation for implementation details.
Security
Authentication
All endpoints require two types of authentication:
- API Key in header:
x-api-key - Authorization token in header:
Authorization
Required Permissions
- For reading operations:
supplier/support.read - For writing operations:
supplier/support.write