Public API
Integrate NextInQue's reservation system directly into your own website or app. Create bookings, check availability, and manage reservations programmatically.
https://nextinque.com/api/v1/publicGetting Access
API access is available on request. Once enabled by the NextInQue team, you can generate API keys from your dashboard.
- Log into your NextInQue dashboard
- Go to Settings → API Access
- Click Request API Access and briefly describe your use case
- Once approved, click Generate Key — copy it immediately, it's shown only once
Authentication
Every request must include your API key in the header:
X-API-Key: your_api_key_hereKeep your API key secret. Do not expose it in client-side JavaScript. Use it only from your server.
Integration Flow
There are 4 steps to complete a booking — exactly the same flow staff use in the dashboard.
GET /servicesFetch available services and their IDs
GET /availabilityGet open time slots for a specific date and service
POST /reservationsBook the selected slot for a customer
GET /reservations/:codeConfirm the booking was created successfully
Step 1 — List Services
/servicesReturns all active services for your account. You need a serviceId to check availability and create reservations.
Request
GET https://nextinque.com/api/v1/public/services
X-API-Key: your_api_key_hereResponse 200
{
"services": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "General Consultation",
"description": "30-minute general consultation",
"durationMinutes": 30
},
{
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"name": "Follow-up Visit",
"description": null,
"durationMinutes": 30
}
]
}id values — you'll need them in the next steps.Step 2 — Check Availability
/availabilityReturns available time slots for a date and service. Only show slots where available > 0 to customers.
Query Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| date | Required | YYYY-MM-DD | The date to check |
| serviceId | Recommended | UUID | Service to check — omit only if you have no services configured |
Request
GET https://nextinque.com/api/v1/public/availability?date=2025-12-15&serviceId=a1b2c3d4-e5f6-7890-abcd-ef1234567890
X-API-Key: your_api_key_hereResponse 200
{
"date": "2025-12-15",
"service": {
"id": "a1b2c3d4-...",
"name": "General Consultation",
"durationMinutes": 30
},
"slots": [
{ "time": "09:00", "iso": "2025-12-15T09:00:00.000+05:00", "available": 1, "total": 1 },
{ "time": "09:30", "iso": "2025-12-15T09:30:00.000+05:00", "available": 0, "total": 1 },
{ "time": "10:00", "iso": "2025-12-15T10:00:00.000+05:00", "available": 1, "total": 1 }
]
}Slot Fields
| Parameter | Required | Type | Description |
|---|---|---|---|
| time | — | string | Human-readable time in HH:mm format (tenant timezone) |
| iso | — | ISO 8601 | Full datetime — use this as scheduledAt when creating a reservation |
| available | — | number | Remaining open bookings at this slot (0 = fully booked) |
| total | — | number | Maximum concurrent bookings allowed |
iso value as scheduledAt — it contains the correct timezone offset. Do not construct your own datetime string.Step 3 — Create a Reservation
/reservationsCreates a booking. A confirmation notification is sent automatically to the customer.
Request Body
| Parameter | Required | Type | Description |
|---|---|---|---|
| customerName | Required | string | Full name of the customer (min 2 chars) |
| phone | Required | string | Phone number — used for SMS/WhatsApp notifications |
| Optional | Email address for email notifications | ||
| scheduledAt | Required | ISO 8601 | Use the iso value from /availability exactly |
| serviceId | Required | UUID | Service ID from Step 1 |
| notes | Optional | string | Special requests or notes (max 1000 chars) |
Request
POST https://nextinque.com/api/v1/public/reservations
X-API-Key: your_api_key_here
Content-Type: application/json
{
"customerName": "John Doe",
"phone": "+923001234567",
"email": "john@example.com",
"scheduledAt": "2025-12-15T09:00:00.000+05:00",
"serviceId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"notes": "First-time customer"
}Response 201 Created
{
"reservation": {
"id": "c3d4e5f6-...",
"confirmationCode": "A3F1B9C02D4E",
"customerName": "John Doe",
"phone": "+923001234567",
"email": "john@example.com",
"scheduledAt": "2025-12-15T04:00:00.000Z",
"status": "PENDING",
"notes": "First-time customer",
"source": "API",
"createdAt": "2025-12-10T14:32:00.000Z",
"service": { "name": "General Consultation", "durationMinutes": 30 },
"tenant": { "name": "City Service Center" }
}
}confirmationCode — customers use it to view or cancel their booking.Step 4 — Retrieve a Reservation
/reservations/:codeRequest
GET https://nextinque.com/api/v1/public/reservations/A3F1B9C02D4E
X-API-Key: your_api_key_hereReservation Status Values
Optional — Cancel or Confirm
/reservations/:code/cancelCancel a reservation. Works on PENDING or CONFIRMED status.
PATCH https://nextinque.com/api/v1/public/reservations/A3F1B9C02D4E/cancel
X-API-Key: your_api_key_here/reservations/:code/confirmCustomer self-confirms (idempotent — safe to call multiple times).
PATCH https://nextinque.com/api/v1/public/reservations/A3F1B9C02D4E/confirm
X-API-Key: your_api_key_hereError Reference
All errors use the same JSON shape:
{ "message": "Human-readable description of what went wrong" }| Code | Scenario | Message |
|---|---|---|
400 | Invalid request body / params | Describes the invalid field |
400 | Scheduled time is in the past | Scheduled time must be in the future |
401 | Missing or invalid API key | Invalid or missing API key |
404 | Service not found or inactive | Service not found |
404 | Reservation code not found | Reservation not found |
409 | Slot is fully booked | See slot conflict section below |
Slot Conflict (409) — Includes Alternatives
When a slot is fully booked, the response includes the next available times on the same date:
{
"message": "\"General Consultation\" is fully booked at the selected time. Next available slots on 2025-12-15: 10:00, 10:30, 11:00.",
"service_name": "General Consultation",
"available_slots": ["10:00", "10:30", "11:00"],
"date": "2025-12-15"
}Recommended Handling
try {
const res = await createReservation({ scheduledAt: slot.iso, ... });
// success — show confirmation code to customer
} catch (err) {
if (err.response?.status === 409) {
const { message, available_slots } = err.response.data;
showMessage(message);
if (available_slots?.length > 0) {
offerAlternativeSlots(available_slots); // let customer pick another
}
}
}Full Working Example
Complete JavaScript example that walks through all 4 steps:
const API_BASE = "https://nextinque.com/api/v1/public";
const API_KEY = "your_api_key_here"; // store server-side, never in client JS
const headers = {
"Content-Type": "application/json",
"X-API-Key": API_KEY,
};
async function bookReservation() {
// Step 1: Get services
const { services } = await fetch(`${API_BASE}/services`, { headers }).then(r => r.json());
const service = services[0]; // let user pick from a dropdown
console.log("Service:", service.name, " — ID:", service.id);
// Step 2: Check availability
const date = "2025-12-15";
const { slots } = await fetch(
`${API_BASE}/availability?date=${date}&serviceId=${service.id}`,
{ headers }
).then(r => r.json());
const openSlots = slots.filter(s => s.available > 0);
console.log("Open slots:", openSlots.map(s => s.time));
if (openSlots.length === 0) {
console.log("No slots available on this date.");
return;
}
const chosenSlot = openSlots[0]; // user selects from UI
// Step 3: Create reservation
try {
const res = await fetch(`${API_BASE}/reservations`, {
method: "POST",
headers,
body: JSON.stringify({
customerName: "John Doe",
phone: "+923001234567",
email: "john@example.com",
scheduledAt: chosenSlot.iso, // always use .iso, not .time
serviceId: service.id,
notes: "Referred by Dr. Smith",
}),
});
const { reservation } = await res.json();
console.log("Booked! Code:", reservation.confirmationCode);
// Step 4: Verify
const check = await fetch(
`${API_BASE}/reservations/${reservation.confirmationCode}`,
{ headers }
).then(r => r.json());
console.log("Status:", check.reservation.status); // PENDING
} catch (err) {
if (err.response?.status === 409) {
const { message, available_slots } = err.response.data;
console.log(message);
if (available_slots?.length) {
console.log("Try instead:", available_slots);
}
}
}
}
bookReservation();All Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | https://nextinque.com/api/v1/public/services | List active services |
| GET | https://nextinque.com/api/v1/public/availability | Get available time slots for a date |
| POST | https://nextinque.com/api/v1/public/reservations | Create a reservation |
| GET | https://nextinque.com/api/v1/public/reservations/:code | Get reservation by confirmation code |
| PATCH | https://nextinque.com/api/v1/public/reservations/:code/confirm | Customer self-confirms |
| PATCH | https://nextinque.com/api/v1/public/reservations/:code/cancel | Cancel a reservation |
Need help with your integration?
Contact our team — we're happy to help you get set up.